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

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

Issue 1024473004: Do not treat '0' as 'none' for font-size-adjust (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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
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 29 matching lines...) Expand all
40 #include "wtf/MathExtras.h" 40 #include "wtf/MathExtras.h"
41 41
42 #include "wtf/RefPtr.h" 42 #include "wtf/RefPtr.h"
43 43
44 #include <unicode/uscript.h> 44 #include <unicode/uscript.h>
45 45
46 namespace blink { 46 namespace blink {
47 47
48 class PLATFORM_EXPORT FontDescription { 48 class PLATFORM_EXPORT FontDescription {
49 public: 49 public:
50 enum SizeAdjust { SizeAdjustNone = -1 };
dstockwell 2015/03/20 03:24:29 This should be a const, not an enum.
changseok 2015/03/20 08:29:39 Done.
50 enum GenericFamilyType { NoFamily, StandardFamily, SerifFamily, SansSerifFam ily, 51 enum GenericFamilyType { NoFamily, StandardFamily, SerifFamily, SansSerifFam ily,
51 MonospaceFamily, CursiveFamily, FantasyFamily, Pict ographFamily }; 52 MonospaceFamily, CursiveFamily, FantasyFamily, Pict ographFamily };
52 53
53 enum Kerning { AutoKerning, NormalKerning, NoneKerning }; 54 enum Kerning { AutoKerning, NormalKerning, NoneKerning };
54 55
55 enum LigaturesState { NormalLigaturesState, DisabledLigaturesState, EnabledL igaturesState }; 56 enum LigaturesState { NormalLigaturesState, DisabledLigaturesState, EnabledL igaturesState };
56 57
57 FontDescription() 58 FontDescription()
58 : m_specifiedSize(0) 59 : m_specifiedSize(0)
59 , m_computedSize(0) 60 , m_computedSize(0)
60 , m_adjustedSize(0) 61 , m_adjustedSize(0)
61 , m_sizeAdjust(0) 62 , m_sizeAdjust(SizeAdjustNone)
62 , m_letterSpacing(0) 63 , m_letterSpacing(0)
63 , m_wordSpacing(0) 64 , m_wordSpacing(0)
64 , m_orientation(Horizontal) 65 , m_orientation(Horizontal)
65 , m_nonCJKGlyphOrientation(NonCJKGlyphOrientationVerticalRight) 66 , m_nonCJKGlyphOrientation(NonCJKGlyphOrientationVerticalRight)
66 , m_widthVariant(RegularWidth) 67 , m_widthVariant(RegularWidth)
67 , m_style(FontStyleNormal) 68 , m_style(FontStyleNormal)
68 , m_variant(FontVariantNormal) 69 , m_variant(FontVariantNormal)
69 , m_isAbsoluteSize(false) 70 , m_isAbsoluteSize(false)
70 , m_weight(FontWeightNormal) 71 , m_weight(FontWeightNormal)
71 , m_stretch(FontStretchNormal) 72 , m_stretch(FontStretchNormal)
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 }; 129 };
129 130
130 const FontFamily& family() const { return m_familyList; } 131 const FontFamily& family() const { return m_familyList; }
131 FamilyDescription familyDescription() const { return FamilyDescription(gener icFamily(), family()); } 132 FamilyDescription familyDescription() const { return FamilyDescription(gener icFamily(), family()); }
132 FontFamily& firstFamily() { return m_familyList; } 133 FontFamily& firstFamily() { return m_familyList; }
133 Size size() const { return Size(m_keywordSize, m_specifiedSize, m_isAbsolute Size); } 134 Size size() const { return Size(m_keywordSize, m_specifiedSize, m_isAbsolute Size); }
134 float specifiedSize() const { return m_specifiedSize; } 135 float specifiedSize() const { return m_specifiedSize; }
135 float computedSize() const { return m_computedSize; } 136 float computedSize() const { return m_computedSize; }
136 float adjustedSize() const { return m_adjustedSize; } 137 float adjustedSize() const { return m_adjustedSize; }
137 float sizeAdjust() const { return m_sizeAdjust; } 138 float sizeAdjust() const { return m_sizeAdjust; }
139 bool hasSizeAdjust() const { return m_sizeAdjust >= 0; }
dstockwell 2015/03/20 03:24:29 Should be != SizeAdjustNone.
changseok 2015/03/20 08:29:39 Done.
138 FontStyle style() const { return static_cast<FontStyle>(m_style); } 140 FontStyle style() const { return static_cast<FontStyle>(m_style); }
139 int computedPixelSize() const { return int(m_computedSize + 0.5f); } 141 int computedPixelSize() const { return int(m_computedSize + 0.5f); }
140 FontVariant variant() const { return static_cast<FontVariant>(m_variant); } 142 FontVariant variant() const { return static_cast<FontVariant>(m_variant); }
141 bool isAbsoluteSize() const { return m_isAbsoluteSize; } 143 bool isAbsoluteSize() const { return m_isAbsoluteSize; }
142 FontWeight weight() const { return static_cast<FontWeight>(m_weight); } 144 FontWeight weight() const { return static_cast<FontWeight>(m_weight); }
143 FontStretch stretch() const { return static_cast<FontStretch>(m_stretch); } 145 FontStretch stretch() const { return static_cast<FontStretch>(m_stretch); }
144 static FontWeight lighterWeight(FontWeight); 146 static FontWeight lighterWeight(FontWeight);
145 static FontWeight bolderWeight(FontWeight); 147 static FontWeight bolderWeight(FontWeight);
146 static Size largerSize(const Size&); 148 static Size largerSize(const Size&);
147 static Size smallerSize(const Size&); 149 static Size smallerSize(const Size&);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 && m_script == other.m_script 307 && m_script == other.m_script
306 && m_syntheticBold == other.m_syntheticBold 308 && m_syntheticBold == other.m_syntheticBold
307 && m_syntheticItalic == other.m_syntheticItalic 309 && m_syntheticItalic == other.m_syntheticItalic
308 && m_featureSettings == other.m_featureSettings 310 && m_featureSettings == other.m_featureSettings
309 && m_subpixelTextPosition == other.m_subpixelTextPosition; 311 && m_subpixelTextPosition == other.m_subpixelTextPosition;
310 } 312 }
311 313
312 } // namespace blink 314 } // namespace blink
313 315
314 #endif 316 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698