Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(572)

Side by Side Diff: Source/platform/fonts/FontDescription.h

Issue 602373003: Make style building for 'font-family' less custom. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Init genericFamily in all cases. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/css/resolver/StyleBuilderCustom.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 : keyword(keyword) 108 : keyword(keyword)
109 , isAbsolute(isAbsolute) 109 , isAbsolute(isAbsolute)
110 , value(value) 110 , value(value)
111 { 111 {
112 } 112 }
113 unsigned keyword : 4; // FontDescription::keywordSize 113 unsigned keyword : 4; // FontDescription::keywordSize
114 unsigned isAbsolute : 1; // FontDescription::isAbsoluteSize 114 unsigned isAbsolute : 1; // FontDescription::isAbsoluteSize
115 float value; 115 float value;
116 }; 116 };
117 117
118 struct FamilyDescription {
119 FamilyDescription(GenericFamilyType genericFamily) : genericFamily(gener icFamily) { }
120 FamilyDescription(GenericFamilyType genericFamily, const FontFamily& fam ily)
121 : genericFamily(genericFamily)
122 , family(family)
123 {
124 }
125 GenericFamilyType genericFamily;
126 FontFamily family;
127 };
128
118 const FontFamily& family() const { return m_familyList; } 129 const FontFamily& family() const { return m_familyList; }
130 FamilyDescription familyDescription() const { return FamilyDescription(gener icFamily(), family()); }
119 FontFamily& firstFamily() { return m_familyList; } 131 FontFamily& firstFamily() { return m_familyList; }
120 Size size() const { return Size(m_keywordSize, m_specifiedSize, m_isAbsolute Size); } 132 Size size() const { return Size(m_keywordSize, m_specifiedSize, m_isAbsolute Size); }
121 float specifiedSize() const { return m_specifiedSize; } 133 float specifiedSize() const { return m_specifiedSize; }
122 float computedSize() const { return m_computedSize; } 134 float computedSize() const { return m_computedSize; }
123 FontStyle style() const { return static_cast<FontStyle>(m_style); } 135 FontStyle style() const { return static_cast<FontStyle>(m_style); }
124 int computedPixelSize() const { return int(m_computedSize + 0.5f); } 136 int computedPixelSize() const { return int(m_computedSize + 0.5f); }
125 FontVariant variant() const { return static_cast<FontVariant>(m_variant); } 137 FontVariant variant() const { return static_cast<FontVariant>(m_variant); }
126 bool isAbsoluteSize() const { return m_isAbsoluteSize; } 138 bool isAbsoluteSize() const { return m_isAbsoluteSize; }
127 FontWeight weight() const { return static_cast<FontWeight>(m_weight); } 139 FontWeight weight() const { return static_cast<FontWeight>(m_weight); }
128 FontStretch stretch() const { return static_cast<FontStretch>(m_stretch); } 140 FontStretch stretch() const { return static_cast<FontStretch>(m_stretch); }
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 && m_script == other.m_script 290 && m_script == other.m_script
279 && m_syntheticBold == other.m_syntheticBold 291 && m_syntheticBold == other.m_syntheticBold
280 && m_syntheticItalic == other.m_syntheticItalic 292 && m_syntheticItalic == other.m_syntheticItalic
281 && m_featureSettings == other.m_featureSettings 293 && m_featureSettings == other.m_featureSettings
282 && m_subpixelTextPosition == other.m_subpixelTextPosition; 294 && m_subpixelTextPosition == other.m_subpixelTextPosition;
283 } 295 }
284 296
285 } // namespace blink 297 } // namespace blink
286 298
287 #endif 299 #endif
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleBuilderCustom.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698