OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the internal font implementation. | 2 * This file is part of the internal font implementation. |
3 * | 3 * |
4 * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved. | 4 * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved. |
5 * Copyright (C) 2007-2008 Torch Mobile, Inc. | 5 * Copyright (C) 2007-2008 Torch Mobile, Inc. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #endif | 46 #endif |
47 | 47 |
48 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) | 48 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) |
49 #include <wtf/RetainPtr.h> | 49 #include <wtf/RetainPtr.h> |
50 #endif | 50 #endif |
51 | 51 |
52 #if PLATFORM(WIN) && !OS(WINCE) | 52 #if PLATFORM(WIN) && !OS(WINCE) |
53 #include <usp10.h> | 53 #include <usp10.h> |
54 #endif | 54 #endif |
55 | 55 |
56 #if PLATFORM(QT) | |
57 #include <QRawFont> | |
58 #endif | |
59 | |
60 namespace WebCore { | 56 namespace WebCore { |
61 | 57 |
62 class FontDescription; | 58 class FontDescription; |
63 class SharedBuffer; | 59 class SharedBuffer; |
64 struct WidthIterator; | 60 struct WidthIterator; |
65 | 61 |
66 enum FontDataVariant { AutoVariant, NormalVariant, SmallCapsVariant, EmphasisMar
kVariant, BrokenIdeographVariant }; | 62 enum FontDataVariant { AutoVariant, NormalVariant, SmallCapsVariant, EmphasisMar
kVariant, BrokenIdeographVariant }; |
67 enum Pitch { UnknownPitch, FixedPitch, VariablePitch }; | 63 enum Pitch { UnknownPitch, FixedPitch, VariablePitch }; |
68 | 64 |
69 class SimpleFontData : public FontData { | 65 class SimpleFontData : public FontData { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 187 |
192 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) || USE(HARFBUZZ) | 188 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) || USE(HARFBUZZ) |
193 bool canRenderCombiningCharacterSequence(const UChar*, size_t) const; | 189 bool canRenderCombiningCharacterSequence(const UChar*, size_t) const; |
194 #endif | 190 #endif |
195 | 191 |
196 bool applyTransforms(GlyphBufferGlyph* glyphs, GlyphBufferAdvance* advances,
size_t glyphCount, TypesettingFeatures typesettingFeatures) const | 192 bool applyTransforms(GlyphBufferGlyph* glyphs, GlyphBufferAdvance* advances,
size_t glyphCount, TypesettingFeatures typesettingFeatures) const |
197 { | 193 { |
198 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 1080 | 194 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 1080 |
199 wkCTFontTransformOptions options = (typesettingFeatures & Kerning ? wkCT
FontTransformApplyPositioning : 0) | (typesettingFeatures & Ligatures ? wkCTFont
TransformApplyShaping : 0); | 195 wkCTFontTransformOptions options = (typesettingFeatures & Kerning ? wkCT
FontTransformApplyPositioning : 0) | (typesettingFeatures & Ligatures ? wkCTFont
TransformApplyShaping : 0); |
200 return wkCTFontTransformGlyphs(m_platformData.ctFont(), glyphs, reinterp
ret_cast<CGSize*>(advances), glyphCount, options); | 196 return wkCTFontTransformGlyphs(m_platformData.ctFont(), glyphs, reinterp
ret_cast<CGSize*>(advances), glyphCount, options); |
201 #elif PLATFORM(QT) && QT_VERSION >= 0x050100 | |
202 QRawFont::LayoutFlags flags = (typesettingFeatures & Kerning) ? QRawFont
::KernedAdvances : QRawFont::SeparateAdvances; | |
203 return m_platformData.rawFont().advancesForGlyphIndexes(glyphs, advances
, glyphCount, flags); | |
204 #else | 197 #else |
205 UNUSED_PARAM(glyphs); | 198 UNUSED_PARAM(glyphs); |
206 UNUSED_PARAM(advances); | 199 UNUSED_PARAM(advances); |
207 UNUSED_PARAM(glyphCount); | 200 UNUSED_PARAM(glyphCount); |
208 UNUSED_PARAM(typesettingFeatures); | 201 UNUSED_PARAM(typesettingFeatures); |
209 return false; | 202 return false; |
210 #endif | 203 #endif |
211 } | 204 } |
212 | 205 |
213 #if PLATFORM(QT) | |
214 QRawFont getQtRawFont() const { return m_platformData.rawFont(); } | |
215 #endif | |
216 | |
217 #if PLATFORM(WIN) | 206 #if PLATFORM(WIN) |
218 bool isSystemFont() const { return m_isSystemFont; } | 207 bool isSystemFont() const { return m_isSystemFont; } |
219 #if !OS(WINCE) // disable unused members to save space | 208 #if !OS(WINCE) // disable unused members to save space |
220 SCRIPT_FONTPROPERTIES* scriptFontProperties() const; | 209 SCRIPT_FONTPROPERTIES* scriptFontProperties() const; |
221 SCRIPT_CACHE* scriptCache() const { return &m_scriptCache; } | 210 SCRIPT_CACHE* scriptCache() const { return &m_scriptCache; } |
222 #endif | 211 #endif |
223 static void setShouldApplyMacAscentHack(bool); | 212 static void setShouldApplyMacAscentHack(bool); |
224 static bool shouldApplyMacAscentHack(); | 213 static bool shouldApplyMacAscentHack(); |
225 static float ascentConsideringMacAscentHack(const WCHAR*, float ascent, floa
t descent); | 214 static float ascentConsideringMacAscentHack(const WCHAR*, float ascent, floa
t descent); |
226 #endif | 215 #endif |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 #endif | 350 #endif |
362 else | 351 else |
363 width = platformWidthForGlyph(glyph); | 352 width = platformWidthForGlyph(glyph); |
364 | 353 |
365 m_glyphToWidthMap.setMetricsForGlyph(glyph, width); | 354 m_glyphToWidthMap.setMetricsForGlyph(glyph, width); |
366 return width; | 355 return width; |
367 } | 356 } |
368 | 357 |
369 } // namespace WebCore | 358 } // namespace WebCore |
370 #endif // SimpleFontData_h | 359 #endif // SimpleFontData_h |
OLD | NEW |