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

Side by Side Diff: Source/core/platform/graphics/FontDescription.h

Issue 18551004: Miscellaneous cleanup to reduce number of includes in platform/graphics/ Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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
11 * version 2 of the License, or (at your option) any later version. 11 * version 2 of the License, or (at your option) any later version.
12 * 12 *
13 * This library is distributed in the hope that it will be useful, 13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details. 16 * Library General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Library General Public License 18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIother.m_ If not, write to 19 * along with this library; see the file COPYING.LIother.m_ If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USm_ 21 * Boston, MA 02110-1301, USm_
22 * 22 *
23 */ 23 */
24 24
25 #ifndef FontDescription_h 25 #ifndef FontDescription_h
26 #define FontDescription_h 26 #define FontDescription_h
27 27
28 #include "FontFamilyNames.h"
29 #include "core/platform/graphics/FontFamily.h" 28 #include "core/platform/graphics/FontFamily.h"
30 #include "core/platform/graphics/FontFeatureSettings.h" 29 #include "core/platform/graphics/FontFeatureSettings.h"
31 #include "core/platform/graphics/FontOrientation.h" 30 #include "core/platform/graphics/FontOrientation.h"
32 #include "core/platform/graphics/FontRenderingMode.h" 31 #include "core/platform/graphics/FontRenderingMode.h"
33 #include "core/platform/graphics/FontSmoothingMode.h" 32 #include "core/platform/graphics/FontSmoothingMode.h"
34 #include "core/platform/graphics/FontTraitsMask.h" 33 #include "core/platform/graphics/FontTraitsMask.h"
35 #include "core/platform/graphics/FontWidthVariant.h" 34 #include "core/platform/graphics/FontWidthVariant.h"
36 #include "core/platform/graphics/TextRenderingMode.h" 35 #include "core/platform/graphics/TextRenderingMode.h"
37 #include "core/platform/text/NonCJKGlyphOrientation.h" 36 #include "core/platform/text/NonCJKGlyphOrientation.h"
38 #include <wtf/MathExtras.h> 37 #include <wtf/MathExtras.h>
39 38
40 #include <wtf/RefPtr.h> 39 #include <wtf/RefPtr.h>
41 40
42 namespace WebCore { 41 namespace WebCore {
43 42
44 using namespace FontFamilyNames;
45
46 enum FontWeight { 43 enum FontWeight {
47 FontWeight100, 44 FontWeight100,
48 FontWeight200, 45 FontWeight200,
49 FontWeight300, 46 FontWeight300,
50 FontWeight400, 47 FontWeight400,
51 FontWeight500, 48 FontWeight500,
52 FontWeight600, 49 FontWeight600,
53 FontWeight700, 50 FontWeight700,
54 FontWeight800, 51 FontWeight800,
55 FontWeight900, 52 FontWeight900,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 float computedSize() const { return m_computedSize; } 107 float computedSize() const { return m_computedSize; }
111 FontItalic italic() const { return static_cast<FontItalic>(m_italic); } 108 FontItalic italic() const { return static_cast<FontItalic>(m_italic); }
112 int computedPixelSize() const { return int(m_computedSize + 0.5f); } 109 int computedPixelSize() const { return int(m_computedSize + 0.5f); }
113 FontSmallCaps smallCaps() const { return static_cast<FontSmallCaps>(m_smallC aps); } 110 FontSmallCaps smallCaps() const { return static_cast<FontSmallCaps>(m_smallC aps); }
114 bool isAbsoluteSize() const { return m_isAbsoluteSize; } 111 bool isAbsoluteSize() const { return m_isAbsoluteSize; }
115 FontWeight weight() const { return static_cast<FontWeight>(m_weight); } 112 FontWeight weight() const { return static_cast<FontWeight>(m_weight); }
116 FontWeight lighterWeight() const; 113 FontWeight lighterWeight() const;
117 FontWeight bolderWeight() const; 114 FontWeight bolderWeight() const;
118 GenericFamilyType genericFamily() const { return static_cast<GenericFamilyTy pe>(m_genericFamily); } 115 GenericFamilyType genericFamily() const { return static_cast<GenericFamilyTy pe>(m_genericFamily); }
119 bool usePrinterFont() const { return m_usePrinterFont; } 116 bool usePrinterFont() const { return m_usePrinterFont; }
120 // only use fixed default size when there is only one font family, and that family is "monospace" 117 bool useFixedDefaultSize() const;
121 bool useFixedDefaultSize() const { return genericFamily() == MonospaceFamily && !family().next() && family().family() == monospaceFamily; }
122 FontRenderingMode renderingMode() const { return static_cast<FontRenderingMo de>(m_renderingMode); } 118 FontRenderingMode renderingMode() const { return static_cast<FontRenderingMo de>(m_renderingMode); }
123 Kerning kerning() const { return static_cast<Kerning>(m_kerning); } 119 Kerning kerning() const { return static_cast<Kerning>(m_kerning); }
124 LigaturesState commonLigaturesState() const { return static_cast<LigaturesSt ate>(m_commonLigaturesState); } 120 LigaturesState commonLigaturesState() const { return static_cast<LigaturesSt ate>(m_commonLigaturesState); }
125 LigaturesState discretionaryLigaturesState() const { return static_cast<Liga turesState>(m_discretionaryLigaturesState); } 121 LigaturesState discretionaryLigaturesState() const { return static_cast<Liga turesState>(m_discretionaryLigaturesState); }
126 LigaturesState historicalLigaturesState() const { return static_cast<Ligatur esState>(m_historicalLigaturesState); } 122 LigaturesState historicalLigaturesState() const { return static_cast<Ligatur esState>(m_historicalLigaturesState); }
127 unsigned keywordSize() const { return m_keywordSize; } 123 unsigned keywordSize() const { return m_keywordSize; }
128 FontSmoothingMode fontSmoothing() const { return static_cast<FontSmoothingMo de>(m_fontSmoothing); } 124 FontSmoothingMode fontSmoothing() const { return static_cast<FontSmoothingMo de>(m_fontSmoothing); }
129 TextRenderingMode textRenderingMode() const { return static_cast<TextRenderi ngMode>(m_textRendering); } 125 TextRenderingMode textRenderingMode() const { return static_cast<TextRenderi ngMode>(m_textRendering); }
130 UScriptCode script() const { return static_cast<UScriptCode>(m_script); } 126 UScriptCode script() const { return static_cast<UScriptCode>(m_script); }
131 127
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 && m_orientation == other.m_orientation 224 && m_orientation == other.m_orientation
229 && m_nonCJKGlyphOrientation == other.m_nonCJKGlyphOrientation 225 && m_nonCJKGlyphOrientation == other.m_nonCJKGlyphOrientation
230 && m_widthVariant == other.m_widthVariant 226 && m_widthVariant == other.m_widthVariant
231 && m_script == other.m_script 227 && m_script == other.m_script
232 && m_featureSettings == other.m_featureSettings; 228 && m_featureSettings == other.m_featureSettings;
233 } 229 }
234 230
235 } 231 }
236 232
237 #endif 233 #endif
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/FontCache.cpp ('k') | Source/core/platform/graphics/FontDescription.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698