Index: Source/platform/fonts/shaping/Shaper.h |
diff --git a/Source/platform/fonts/shaping/Shaper.h b/Source/platform/fonts/shaping/Shaper.h |
index cbdfb841e4c5d6020b6a2bed69b3841b4c45ef5c..18ad7084a5e0850f5dd749ab90df3f48e8b08311 100644 |
--- a/Source/platform/fonts/shaping/Shaper.h |
+++ b/Source/platform/fonts/shaping/Shaper.h |
@@ -42,19 +42,18 @@ class GlyphBuffer; |
class SimpleFontData; |
class TextRun; |
-class PLATFORM_EXPORT Shaper { |
-public: |
- enum ForTextEmphasisOrNot { |
- NotForTextEmphasis, |
- ForTextEmphasis |
- }; |
+struct GlyphData; |
+class PLATFORM_EXPORT Shaper { |
protected: |
- Shaper(const Font*, const TextRun&, ForTextEmphasisOrNot = NotForTextEmphasis, HashSet<const SimpleFontData*>* fallbackFonts = nullptr, FloatRect* = nullptr); |
+ Shaper(const Font*, const TextRun&, const GlyphData* emphasisData = nullptr, |
+ HashSet<const SimpleFontData*>* fallbackFonts = nullptr, FloatRect* = nullptr); |
void trackNonPrimaryFallbackFont(const SimpleFontData*); |
-protected: |
+ bool forTextEmphasis() const { return m_emphasisSubstitutionData; } |
+ void addEmphasisMark(GlyphBuffer*, float midGlyphOffset) const; |
+ |
const Font* m_font; |
const TextRun& m_run; |
HashSet<const SimpleFontData*>* m_fallbackFonts; |
@@ -64,7 +63,11 @@ protected: |
float m_expansionPerOpportunity; // Pixels to be added to each expansion opportunity. |
bool m_isAfterExpansion; |
- ForTextEmphasisOrNot m_forTextEmphasis; |
+private: |
+ // Emphasis substitution info. If specified, this will be used to replace all glyphs which |
+ // can receive text emphasis with center-aligned emphasis glyphs. |
+ const GlyphData* m_emphasisSubstitutionData; |
+ FloatPoint m_emphasisGlyphCenter; |
}; |
inline void Shaper::trackNonPrimaryFallbackFont(const SimpleFontData* fontData) |