OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 class SimpleFontData; | 51 class SimpleFontData; |
52 class HarfBuzzShaper; | 52 class HarfBuzzShaper; |
53 | 53 |
54 class PLATFORM_EXPORT ShapeResult : public RefCounted<ShapeResult> { | 54 class PLATFORM_EXPORT ShapeResult : public RefCounted<ShapeResult> { |
55 public: | 55 public: |
56 static PassRefPtr<ShapeResult> create(const Font* font, | 56 static PassRefPtr<ShapeResult> create(const Font* font, |
57 unsigned numCharacters, TextDirection direction) | 57 unsigned numCharacters, TextDirection direction) |
58 { | 58 { |
59 return adoptRef(new ShapeResult(font, numCharacters, direction)); | 59 return adoptRef(new ShapeResult(font, numCharacters, direction)); |
60 } | 60 } |
| 61 static PassRefPtr<ShapeResult> createForTabulationCharacters(const Font*, |
| 62 const TextRun&, float positionOffset, unsigned count); |
61 ~ShapeResult(); | 63 ~ShapeResult(); |
62 | 64 |
63 float width() { return m_width; } | 65 float width() { return m_width; } |
64 FloatRect bounds() { return m_glyphBoundingBox; } | 66 FloatRect bounds() { return m_glyphBoundingBox; } |
65 unsigned numCharacters() const { return m_numCharacters; } | 67 unsigned numCharacters() const { return m_numCharacters; } |
66 void fallbackFonts(HashSet<const SimpleFontData*>*) const; | 68 void fallbackFonts(HashSet<const SimpleFontData*>*) const; |
67 | 69 |
68 static int offsetForPosition(Vector<RefPtr<ShapeResult>>&, | 70 static int offsetForPosition(Vector<RefPtr<ShapeResult>>&, |
69 const TextRun&, float targetX); | 71 const TextRun&, float targetX); |
70 static float fillGlyphBuffer(Vector<RefPtr<ShapeResult>>&, | 72 static float fillGlyphBuffer(Vector<RefPtr<ShapeResult>>&, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 float m_letterSpacing; // Pixels to be added after each glyph. | 147 float m_letterSpacing; // Pixels to be added after each glyph. |
146 unsigned m_expansionOpportunityCount; | 148 unsigned m_expansionOpportunityCount; |
147 | 149 |
148 Vector<hb_feature_t, 4> m_features; | 150 Vector<hb_feature_t, 4> m_features; |
149 Vector<HarfBuzzRun, 16> m_harfBuzzRuns; | 151 Vector<HarfBuzzRun, 16> m_harfBuzzRuns; |
150 }; | 152 }; |
151 | 153 |
152 } // namespace blink | 154 } // namespace blink |
153 | 155 |
154 #endif // HarfBuzzShaper_h | 156 #endif // HarfBuzzShaper_h |
OLD | NEW |