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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) || (PLATFORM(WX) && OS(D
ARWIN)) | 48 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) || (PLATFORM(WX) && OS(D
ARWIN)) |
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 || (OS(WINDOWS) && PLATFORM(WX)) | 53 || (OS(WINDOWS) && PLATFORM(WX)) |
54 #include <usp10.h> | 54 #include <usp10.h> |
55 #endif | 55 #endif |
56 | 56 |
57 #if USE(CAIRO) | |
58 #include <cairo.h> | |
59 #endif | |
60 | |
61 #if PLATFORM(QT) | 57 #if PLATFORM(QT) |
62 #include <QRawFont> | 58 #include <QRawFont> |
63 #endif | 59 #endif |
64 | 60 |
65 namespace WebCore { | 61 namespace WebCore { |
66 | 62 |
67 class FontDescription; | 63 class FontDescription; |
68 class SharedBuffer; | 64 class SharedBuffer; |
69 struct WidthIterator; | 65 struct WidthIterator; |
70 | 66 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 140 |
145 FloatRect boundsForGlyph(Glyph) const; | 141 FloatRect boundsForGlyph(Glyph) const; |
146 float widthForGlyph(Glyph glyph) const; | 142 float widthForGlyph(Glyph glyph) const; |
147 FloatRect platformBoundsForGlyph(Glyph) const; | 143 FloatRect platformBoundsForGlyph(Glyph) const; |
148 float platformWidthForGlyph(Glyph) const; | 144 float platformWidthForGlyph(Glyph) const; |
149 | 145 |
150 float spaceWidth() const { return m_spaceWidth; } | 146 float spaceWidth() const { return m_spaceWidth; } |
151 float adjustedSpaceWidth() const { return m_adjustedSpaceWidth; } | 147 float adjustedSpaceWidth() const { return m_adjustedSpaceWidth; } |
152 void setSpaceWidth(float spaceWidth) { m_spaceWidth = spaceWidth; } | 148 void setSpaceWidth(float spaceWidth) { m_spaceWidth = spaceWidth; } |
153 | 149 |
154 #if USE(CG) || USE(CAIRO) || PLATFORM(WX) || USE(SKIA_ON_MAC_CHROMIUM) | 150 #if USE(CG) || PLATFORM(WX) || USE(SKIA_ON_MAC_CHROMIUM) |
155 float syntheticBoldOffset() const { return m_syntheticBoldOffset; } | 151 float syntheticBoldOffset() const { return m_syntheticBoldOffset; } |
156 #endif | 152 #endif |
157 | 153 |
158 Glyph spaceGlyph() const { return m_spaceGlyph; } | 154 Glyph spaceGlyph() const { return m_spaceGlyph; } |
159 void setSpaceGlyph(Glyph spaceGlyph) { m_spaceGlyph = spaceGlyph; } | 155 void setSpaceGlyph(Glyph spaceGlyph) { m_spaceGlyph = spaceGlyph; } |
160 Glyph zeroWidthSpaceGlyph() const { return m_zeroWidthSpaceGlyph; } | 156 Glyph zeroWidthSpaceGlyph() const { return m_zeroWidthSpaceGlyph; } |
161 void setZeroWidthSpaceGlyph(Glyph spaceGlyph) { m_zeroWidthSpaceGlyph = spac
eGlyph; } | 157 void setZeroWidthSpaceGlyph(Glyph spaceGlyph) { m_zeroWidthSpaceGlyph = spac
eGlyph; } |
162 bool isZeroWidthSpaceGlyph(Glyph glyph) const { return glyph == m_zeroWidthS
paceGlyph && glyph; } | 158 bool isZeroWidthSpaceGlyph(Glyph glyph) const { return glyph == m_zeroWidthS
paceGlyph && glyph; } |
163 Glyph zeroGlyph() const { return m_zeroGlyph; } | 159 Glyph zeroGlyph() const { return m_zeroGlyph; } |
164 void setZeroGlyph(Glyph zeroGlyph) { m_zeroGlyph = zeroGlyph; } | 160 void setZeroGlyph(Glyph zeroGlyph) { m_zeroGlyph = zeroGlyph; } |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 | 302 |
307 private: | 303 private: |
308 DerivedFontData(bool custom) | 304 DerivedFontData(bool custom) |
309 : forCustomFont(custom) | 305 : forCustomFont(custom) |
310 { | 306 { |
311 } | 307 } |
312 }; | 308 }; |
313 | 309 |
314 mutable OwnPtr<DerivedFontData> m_derivedFontData; | 310 mutable OwnPtr<DerivedFontData> m_derivedFontData; |
315 | 311 |
316 #if USE(CG) || USE(CAIRO) || PLATFORM(WX) || USE(SKIA_ON_MAC_CHROMIUM) | 312 #if USE(CG) || PLATFORM(WX) || USE(SKIA_ON_MAC_CHROMIUM) |
317 float m_syntheticBoldOffset; | 313 float m_syntheticBoldOffset; |
318 #endif | 314 #endif |
319 | 315 |
320 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) || (PLATFORM(WX) && OS(D
ARWIN)) | 316 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) || (PLATFORM(WX) && OS(D
ARWIN)) |
321 mutable HashMap<unsigned, RetainPtr<CFDictionaryRef> > m_CFStringAttributes; | 317 mutable HashMap<unsigned, RetainPtr<CFDictionaryRef> > m_CFStringAttributes; |
322 #endif | 318 #endif |
323 | 319 |
324 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) || (PLATFORM(WX) && OS(D
ARWIN)) || USE(HARFBUZZ) | 320 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) || (PLATFORM(WX) && OS(D
ARWIN)) || USE(HARFBUZZ) |
325 mutable OwnPtr<HashMap<String, bool> > m_combiningCharacterSequenceSupport; | 321 mutable OwnPtr<HashMap<String, bool> > m_combiningCharacterSequenceSupport; |
326 #endif | 322 #endif |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 return 0; | 355 return 0; |
360 | 356 |
361 float width = m_glyphToWidthMap.metricsForGlyph(glyph); | 357 float width = m_glyphToWidthMap.metricsForGlyph(glyph); |
362 if (width != cGlyphSizeUnknown) | 358 if (width != cGlyphSizeUnknown) |
363 return width; | 359 return width; |
364 | 360 |
365 if (m_fontData) | 361 if (m_fontData) |
366 width = m_fontData->widthForSVGGlyph(glyph, m_platformData.size()); | 362 width = m_fontData->widthForSVGGlyph(glyph, m_platformData.size()); |
367 #if ENABLE(OPENTYPE_VERTICAL) | 363 #if ENABLE(OPENTYPE_VERTICAL) |
368 else if (m_verticalData) | 364 else if (m_verticalData) |
369 #if USE(CG) || USE(CAIRO) || PLATFORM(WX) || USE(SKIA_ON_MAC_CHROMIUM) | 365 #if USE(CG) || PLATFORM(WX) || USE(SKIA_ON_MAC_CHROMIUM) |
370 width = m_verticalData->advanceHeight(this, glyph) + m_syntheticBoldOffs
et; | 366 width = m_verticalData->advanceHeight(this, glyph) + m_syntheticBoldOffs
et; |
371 #else | 367 #else |
372 width = m_verticalData->advanceHeight(this, glyph); | 368 width = m_verticalData->advanceHeight(this, glyph); |
373 #endif | 369 #endif |
374 #endif | 370 #endif |
375 else | 371 else |
376 width = platformWidthForGlyph(glyph); | 372 width = platformWidthForGlyph(glyph); |
377 | 373 |
378 m_glyphToWidthMap.setMetricsForGlyph(glyph, width); | 374 m_glyphToWidthMap.setMetricsForGlyph(glyph, width); |
379 return width; | 375 return width; |
380 } | 376 } |
381 | 377 |
382 } // namespace WebCore | 378 } // namespace WebCore |
383 #endif // SimpleFontData_h | 379 #endif // SimpleFontData_h |
OLD | NEW |