| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 Glyph zeroGlyph() const { return m_zeroGlyph; } | 124 Glyph zeroGlyph() const { return m_zeroGlyph; } |
| 125 void setZeroGlyph(Glyph zeroGlyph) { m_zeroGlyph = zeroGlyph; } | 125 void setZeroGlyph(Glyph zeroGlyph) { m_zeroGlyph = zeroGlyph; } |
| 126 | 126 |
| 127 virtual const SimpleFontData* fontDataForCharacter(UChar32) const override; | 127 virtual const SimpleFontData* fontDataForCharacter(UChar32) const override; |
| 128 | 128 |
| 129 Glyph glyphForCharacter(UChar32) const; | 129 Glyph glyphForCharacter(UChar32) const; |
| 130 | 130 |
| 131 void determinePitch(); | 131 void determinePitch(); |
| 132 Pitch pitch() const { return m_treatAsFixedPitch ? FixedPitch : VariablePitc
h; } | 132 Pitch pitch() const { return m_treatAsFixedPitch ? FixedPitch : VariablePitc
h; } |
| 133 | 133 |
| 134 bool isSVGFont() const { return m_customFontData && m_customFontData->isSVGF
ont(); } | |
| 135 virtual bool isCustomFont() const override { return m_customFontData; } | 134 virtual bool isCustomFont() const override { return m_customFontData; } |
| 136 virtual bool isLoading() const override { return m_customFontData ? m_custom
FontData->isLoading() : false; } | 135 virtual bool isLoading() const override { return m_customFontData ? m_custom
FontData->isLoading() : false; } |
| 137 virtual bool isLoadingFallback() const override { return m_customFontData ?
m_customFontData->isLoadingFallback() : false; } | 136 virtual bool isLoadingFallback() const override { return m_customFontData ?
m_customFontData->isLoadingFallback() : false; } |
| 138 virtual bool isSegmented() const override; | 137 virtual bool isSegmented() const override; |
| 139 virtual bool shouldSkipDrawing() const override { return m_customFontData &&
m_customFontData->shouldSkipDrawing(); } | 138 virtual bool shouldSkipDrawing() const override { return m_customFontData &&
m_customFontData->shouldSkipDrawing(); } |
| 140 | 139 |
| 141 const GlyphData& missingGlyphData() const { return m_missingGlyphData; } | 140 const GlyphData& missingGlyphData() const { return m_missingGlyphData; } |
| 142 void setMissingGlyphData(const GlyphData& glyphData) { m_missingGlyphData =
glyphData; } | 141 void setMissingGlyphData(const GlyphData& glyphData) { m_missingGlyphData =
glyphData; } |
| 143 | 142 |
| 144 #if OS(MACOSX) | 143 #if OS(MACOSX) |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 234 |
| 236 ALWAYS_INLINE float SimpleFontData::widthForGlyph(Glyph glyph) const | 235 ALWAYS_INLINE float SimpleFontData::widthForGlyph(Glyph glyph) const |
| 237 { | 236 { |
| 238 if (isZeroWidthSpaceGlyph(glyph)) | 237 if (isZeroWidthSpaceGlyph(glyph)) |
| 239 return 0; | 238 return 0; |
| 240 | 239 |
| 241 float width = m_glyphToWidthMap.metricsForGlyph(glyph); | 240 float width = m_glyphToWidthMap.metricsForGlyph(glyph); |
| 242 if (width != cGlyphSizeUnknown) | 241 if (width != cGlyphSizeUnknown) |
| 243 return width; | 242 return width; |
| 244 | 243 |
| 245 if (isSVGFont()) | |
| 246 width = m_customFontData->widthForSVGGlyph(glyph, m_platformData.size())
; | |
| 247 #if ENABLE(OPENTYPE_VERTICAL) | 244 #if ENABLE(OPENTYPE_VERTICAL) |
| 248 else if (m_verticalData) | 245 if (m_verticalData) |
| 249 width = m_verticalData->advanceHeight(this, glyph); | 246 width = m_verticalData->advanceHeight(this, glyph); |
| 247 else |
| 250 #endif | 248 #endif |
| 251 else | |
| 252 width = platformWidthForGlyph(glyph); | 249 width = platformWidthForGlyph(glyph); |
| 253 | 250 |
| 254 m_glyphToWidthMap.setMetricsForGlyph(glyph, width); | 251 m_glyphToWidthMap.setMetricsForGlyph(glyph, width); |
| 255 return width; | 252 return width; |
| 256 } | 253 } |
| 257 | 254 |
| 258 DEFINE_FONT_DATA_TYPE_CASTS(SimpleFontData, false); | 255 DEFINE_FONT_DATA_TYPE_CASTS(SimpleFontData, false); |
| 259 | 256 |
| 260 } // namespace blink | 257 } // namespace blink |
| 261 #endif // SimpleFontData_h | 258 #endif // SimpleFontData_h |
| OLD | NEW |