| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_GFX_RENDER_TEXT_HARFBUZZ_H_ | 5 #ifndef UI_GFX_RENDER_TEXT_HARFBUZZ_H_ |
| 6 #define UI_GFX_RENDER_TEXT_HARFBUZZ_H_ | 6 #define UI_GFX_RENDER_TEXT_HARFBUZZ_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace gfx { | 27 namespace gfx { |
| 28 | 28 |
| 29 class Range; | 29 class Range; |
| 30 class RangeF; | 30 class RangeF; |
| 31 | 31 |
| 32 namespace internal { | 32 namespace internal { |
| 33 | 33 |
| 34 struct GFX_EXPORT TextRunHarfBuzz { | 34 struct GFX_EXPORT TextRunHarfBuzz { |
| 35 TextRunHarfBuzz(); | 35 // Construct the run with |template_font| since determining the details of a |
| 36 // default-constructed gfx::Font is expensive, but it will always be replaced. |
| 37 explicit TextRunHarfBuzz(const gfx::Font& template_font); |
| 36 ~TextRunHarfBuzz(); | 38 ~TextRunHarfBuzz(); |
| 37 | 39 |
| 38 // Returns the index of the first glyph that corresponds to the character at | 40 // Returns the index of the first glyph that corresponds to the character at |
| 39 // |pos|. | 41 // |pos|. |
| 40 size_t CharToGlyph(size_t pos) const; | 42 size_t CharToGlyph(size_t pos) const; |
| 41 | 43 |
| 42 // Returns the corresponding glyph range of the given character range. | 44 // Returns the corresponding glyph range of the given character range. |
| 43 // |range| is in text-space (0 corresponds to |GetDisplayText()[0]|). Returned | 45 // |range| is in text-space (0 corresponds to |GetDisplayText()[0]|). Returned |
| 44 // value is in run-space (0 corresponds to the first glyph in the run). | 46 // value is in run-space (0 corresponds to the first glyph in the run). |
| 45 Range CharRangeToGlyphRange(const Range& range) const; | 47 Range CharRangeToGlyphRange(const Range& range) const; |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 276 |
| 275 // Fixed width of glyphs. This should only be set in test environments. | 277 // Fixed width of glyphs. This should only be set in test environments. |
| 276 float glyph_width_for_test_; | 278 float glyph_width_for_test_; |
| 277 | 279 |
| 278 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz); | 280 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz); |
| 279 }; | 281 }; |
| 280 | 282 |
| 281 } // namespace gfx | 283 } // namespace gfx |
| 282 | 284 |
| 283 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_ | 285 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_ |
| OLD | NEW |