| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 enum FontDataVariant { AutoVariant, NormalVariant, SmallCapsVariant, EmphasisMar
kVariant }; | 50 enum FontDataVariant { AutoVariant, NormalVariant, SmallCapsVariant, EmphasisMar
kVariant }; |
| 51 | 51 |
| 52 class PLATFORM_EXPORT SimpleFontData : public FontData { | 52 class PLATFORM_EXPORT SimpleFontData : public FontData { |
| 53 public: | 53 public: |
| 54 // Used to create platform fonts. | 54 // Used to create platform fonts. |
| 55 static PassRefPtr<SimpleFontData> create(const FontPlatformData& platformDat
a, PassRefPtr<CustomFontData> customData = nullptr, bool isTextOrientationFallba
ck = false) | 55 static PassRefPtr<SimpleFontData> create(const FontPlatformData& platformDat
a, PassRefPtr<CustomFontData> customData = nullptr, bool isTextOrientationFallba
ck = false) |
| 56 { | 56 { |
| 57 return adoptRef(new SimpleFontData(platformData, customData, isTextOrien
tationFallback)); | 57 return adoptRef(new SimpleFontData(platformData, customData, isTextOrien
tationFallback)); |
| 58 } | 58 } |
| 59 | 59 |
| 60 virtual ~SimpleFontData(); | 60 ~SimpleFontData() override; |
| 61 | 61 |
| 62 const FontPlatformData& platformData() const { return m_platformData; } | 62 const FontPlatformData& platformData() const { return m_platformData; } |
| 63 const OpenTypeVerticalData* verticalData() const { return m_verticalData.get
(); } | 63 const OpenTypeVerticalData* verticalData() const { return m_verticalData.get
(); } |
| 64 | 64 |
| 65 PassRefPtr<SimpleFontData> smallCapsFontData(const FontDescription&) const; | 65 PassRefPtr<SimpleFontData> smallCapsFontData(const FontDescription&) const; |
| 66 PassRefPtr<SimpleFontData> emphasisMarkFontData(const FontDescription&) cons
t; | 66 PassRefPtr<SimpleFontData> emphasisMarkFontData(const FontDescription&) cons
t; |
| 67 | 67 |
| 68 PassRefPtr<SimpleFontData> variantFontData(const FontDescription& descriptio
n, FontDataVariant variant) const | 68 PassRefPtr<SimpleFontData> variantFontData(const FontDescription& descriptio
n, FontDataVariant variant) const |
| 69 { | 69 { |
| 70 switch (variant) { | 70 switch (variant) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 void setSpaceWidth(float spaceWidth) { m_spaceWidth = spaceWidth; } | 105 void setSpaceWidth(float spaceWidth) { m_spaceWidth = spaceWidth; } |
| 106 | 106 |
| 107 Glyph spaceGlyph() const { return m_spaceGlyph; } | 107 Glyph spaceGlyph() const { return m_spaceGlyph; } |
| 108 void setSpaceGlyph(Glyph spaceGlyph) { m_spaceGlyph = spaceGlyph; } | 108 void setSpaceGlyph(Glyph spaceGlyph) { m_spaceGlyph = spaceGlyph; } |
| 109 Glyph zeroWidthSpaceGlyph() const { return m_zeroWidthSpaceGlyph; } | 109 Glyph zeroWidthSpaceGlyph() const { return m_zeroWidthSpaceGlyph; } |
| 110 void setZeroWidthSpaceGlyph(Glyph spaceGlyph) { m_zeroWidthSpaceGlyph = spac
eGlyph; } | 110 void setZeroWidthSpaceGlyph(Glyph spaceGlyph) { m_zeroWidthSpaceGlyph = spac
eGlyph; } |
| 111 bool isZeroWidthSpaceGlyph(Glyph glyph) const { return glyph == m_zeroWidthS
paceGlyph && glyph; } | 111 bool isZeroWidthSpaceGlyph(Glyph glyph) const { return glyph == m_zeroWidthS
paceGlyph && glyph; } |
| 112 Glyph zeroGlyph() const { return m_zeroGlyph; } | 112 Glyph zeroGlyph() const { return m_zeroGlyph; } |
| 113 void setZeroGlyph(Glyph zeroGlyph) { m_zeroGlyph = zeroGlyph; } | 113 void setZeroGlyph(Glyph zeroGlyph) { m_zeroGlyph = zeroGlyph; } |
| 114 | 114 |
| 115 virtual const SimpleFontData* fontDataForCharacter(UChar32) const override; | 115 const SimpleFontData* fontDataForCharacter(UChar32) const override; |
| 116 | 116 |
| 117 Glyph glyphForCharacter(UChar32) const; | 117 Glyph glyphForCharacter(UChar32) const; |
| 118 | 118 |
| 119 virtual bool isCustomFont() const override { return m_customFontData; } | 119 bool isCustomFont() const override { return m_customFontData; } |
| 120 virtual bool isLoading() const override { return m_customFontData ? m_custom
FontData->isLoading() : false; } | 120 bool isLoading() const override { return m_customFontData ? m_customFontData
->isLoading() : false; } |
| 121 virtual bool isLoadingFallback() const override { return m_customFontData ?
m_customFontData->isLoadingFallback() : false; } | 121 bool isLoadingFallback() const override { return m_customFontData ? m_custom
FontData->isLoadingFallback() : false; } |
| 122 virtual bool isSegmented() const override; | 122 bool isSegmented() const override; |
| 123 virtual bool shouldSkipDrawing() const override { return m_customFontData &&
m_customFontData->shouldSkipDrawing(); } | 123 bool shouldSkipDrawing() const override { return m_customFontData && m_custo
mFontData->shouldSkipDrawing(); } |
| 124 | 124 |
| 125 const GlyphData& missingGlyphData() const { return m_missingGlyphData; } | 125 const GlyphData& missingGlyphData() const { return m_missingGlyphData; } |
| 126 void setMissingGlyphData(const GlyphData& glyphData) { m_missingGlyphData =
glyphData; } | 126 void setMissingGlyphData(const GlyphData& glyphData) { m_missingGlyphData =
glyphData; } |
| 127 | 127 |
| 128 bool canRenderCombiningCharacterSequence(const UChar*, size_t) const; | 128 bool canRenderCombiningCharacterSequence(const UChar*, size_t) const; |
| 129 | 129 |
| 130 PassRefPtr<CustomFontData> customFontData() const { return m_customFontData;
} | 130 PassRefPtr<CustomFontData> customFontData() const { return m_customFontData;
} |
| 131 | 131 |
| 132 // Implemented by the platform. | 132 // Implemented by the platform. |
| 133 virtual bool fillGlyphPage(GlyphPage* pageToFill, unsigned offset, unsigned
length, UChar* buffer, unsigned bufferLength) const; | 133 virtual bool fillGlyphPage(GlyphPage* pageToFill, unsigned offset, unsigned
length, UChar* buffer, unsigned bufferLength) const; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 width = platformWidthForGlyph(glyph); | 219 width = platformWidthForGlyph(glyph); |
| 220 | 220 |
| 221 m_glyphToWidthMap.setMetricsForGlyph(glyph, width); | 221 m_glyphToWidthMap.setMetricsForGlyph(glyph, width); |
| 222 return width; | 222 return width; |
| 223 } | 223 } |
| 224 | 224 |
| 225 DEFINE_FONT_DATA_TYPE_CASTS(SimpleFontData, false); | 225 DEFINE_FONT_DATA_TYPE_CASTS(SimpleFontData, false); |
| 226 | 226 |
| 227 } // namespace blink | 227 } // namespace blink |
| 228 #endif // SimpleFontData_h | 228 #endif // SimpleFontData_h |
| OLD | NEW |