Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: Source/platform/fonts/WidthIterator.h

Issue 181443002: Use glyph-ids for lookups of SVG font kerning-pairs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Vector<...>::append -> Vector<...>::appendVector. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | Source/platform/text/TextRun.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Holger Hans Peter Freyther 3 * Copyright (C) 2008 Holger Hans Peter Freyther
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 float maxGlyphBoundingBoxY() const { ASSERT(m_accountForGlyphBounds); return m_maxGlyphBoundingBoxY; } 49 float maxGlyphBoundingBoxY() const { ASSERT(m_accountForGlyphBounds); return m_maxGlyphBoundingBoxY; }
50 float minGlyphBoundingBoxY() const { ASSERT(m_accountForGlyphBounds); return m_minGlyphBoundingBoxY; } 50 float minGlyphBoundingBoxY() const { ASSERT(m_accountForGlyphBounds); return m_minGlyphBoundingBoxY; }
51 float firstGlyphOverflow() const { ASSERT(m_accountForGlyphBounds); return m _firstGlyphOverflow; } 51 float firstGlyphOverflow() const { ASSERT(m_accountForGlyphBounds); return m _firstGlyphOverflow; }
52 float lastGlyphOverflow() const { ASSERT(m_accountForGlyphBounds); return m_ lastGlyphOverflow; } 52 float lastGlyphOverflow() const { ASSERT(m_accountForGlyphBounds); return m_ lastGlyphOverflow; }
53 53
54 const TextRun& run() const { return m_run; } 54 const TextRun& run() const { return m_run; }
55 float runWidthSoFar() const { return m_runWidthSoFar; } 55 float runWidthSoFar() const { return m_runWidthSoFar; }
56 56
57 #if ENABLE(SVG_FONTS) 57 #if ENABLE(SVG_FONTS)
58 String lastGlyphName() const { return m_lastGlyphName; }
59 void setLastGlyphName(const String& name) { m_lastGlyphName = name; }
60 Vector<SVGGlyph::ArabicForm>& arabicForms() { return m_arabicForms; } 58 Vector<SVGGlyph::ArabicForm>& arabicForms() { return m_arabicForms; }
61 #endif 59 #endif
62 60
63 static bool supportsTypesettingFeatures(const Font& font) 61 static bool supportsTypesettingFeatures(const Font& font)
64 { 62 {
65 63
66 return !font.fontDescription().typesettingFeatures(); 64 return !font.fontDescription().typesettingFeatures();
67 } 65 }
68 66
69 const Font* m_font; 67 const Font* m_font;
70 68
71 const TextRun& m_run; 69 const TextRun& m_run;
72 70
73 unsigned m_currentCharacter; 71 unsigned m_currentCharacter;
74 float m_runWidthSoFar; 72 float m_runWidthSoFar;
75 float m_expansion; 73 float m_expansion;
76 float m_expansionPerOpportunity; 74 float m_expansionPerOpportunity;
77 bool m_isAfterExpansion; 75 bool m_isAfterExpansion;
78 float m_finalRoundingWidth; 76 float m_finalRoundingWidth;
79 77
80 #if ENABLE(SVG_FONTS) 78 #if ENABLE(SVG_FONTS)
81 String m_lastGlyphName;
82 Vector<SVGGlyph::ArabicForm> m_arabicForms; 79 Vector<SVGGlyph::ArabicForm> m_arabicForms;
83 #endif 80 #endif
84 81
85 private: 82 private:
86 GlyphData glyphDataForCharacter(UChar32, bool mirror, int currentCharacter, unsigned& advanceLength); 83 GlyphData glyphDataForCharacter(UChar32, bool mirror, int currentCharacter, unsigned& advanceLength);
87 template <typename TextIterator> 84 template <typename TextIterator>
88 inline unsigned advanceInternal(TextIterator&, GlyphBuffer*); 85 inline unsigned advanceInternal(TextIterator&, GlyphBuffer*);
89 86
90 bool shouldApplyFontTransforms() const { return m_run.length() > 1 && (m_typ esettingFeatures & (Kerning | Ligatures)); } 87 bool shouldApplyFontTransforms() const { return m_run.length() > 1 && (m_typ esettingFeatures & (Kerning | Ligatures)); }
91 88
92 TypesettingFeatures m_typesettingFeatures; 89 TypesettingFeatures m_typesettingFeatures;
93 HashSet<const SimpleFontData*>* m_fallbackFonts; 90 HashSet<const SimpleFontData*>* m_fallbackFonts;
94 bool m_accountForGlyphBounds; 91 bool m_accountForGlyphBounds;
95 float m_maxGlyphBoundingBoxY; 92 float m_maxGlyphBoundingBoxY;
96 float m_minGlyphBoundingBoxY; 93 float m_minGlyphBoundingBoxY;
97 float m_firstGlyphOverflow; 94 float m_firstGlyphOverflow;
98 float m_lastGlyphOverflow; 95 float m_lastGlyphOverflow;
99 bool m_forTextEmphasis; 96 bool m_forTextEmphasis;
100 }; 97 };
101 98
102 } 99 }
103 100
104 #endif 101 #endif
OLDNEW
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | Source/platform/text/TextRun.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698