OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2006, 2010, 2011 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2006, 2010, 2011 Apple Inc. All rights reserved. |
6 * Copyright (c) 2007, 2008, 2010 Google Inc. All rights reserved. | 6 * Copyright (c) 2007, 2008, 2010 Google Inc. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 { | 700 { |
701 CachingWordShaper& shaper = m_fontFallbackList->cachingWordShaper(); | 701 CachingWordShaper& shaper = m_fontFallbackList->cachingWordShaper(); |
702 float width = shaper.width(this, run, fallbackFonts, glyphBounds); | 702 float width = shaper.width(this, run, fallbackFonts, glyphBounds); |
703 return width; | 703 return width; |
704 } | 704 } |
705 | 705 |
706 // Return the code point index for the given |x| offset into the text run. | 706 // Return the code point index for the given |x| offset into the text run. |
707 int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat, | 707 int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat, |
708 bool includePartialGlyphs) const | 708 bool includePartialGlyphs) const |
709 { | 709 { |
710 HarfBuzzShaper shaper(this, run); | 710 HashSet<const SimpleFontData*> fallbackFonts; |
| 711 HarfBuzzShaper shaper(this, run, &fallbackFonts); |
711 RefPtr<ShapeResult> shapeResult = shaper.shapeResult(); | 712 RefPtr<ShapeResult> shapeResult = shaper.shapeResult(); |
712 if (!shapeResult) | 713 if (!shapeResult) |
713 return 0; | 714 return 0; |
714 return shapeResult->offsetForPosition(xFloat); | 715 return shapeResult->offsetForPosition(xFloat); |
715 } | 716 } |
716 | 717 |
717 // Return the rectangle for selecting the given range of code-points in the Text
Run. | 718 // Return the rectangle for selecting the given range of code-points in the Text
Run. |
718 FloatRect Font::selectionRectForComplexText(const TextRun& run, | 719 FloatRect Font::selectionRectForComplexText(const TextRun& run, |
719 const FloatPoint& point, int height, int from, int to) const | 720 const FloatPoint& point, int height, int from, int to) const |
720 { | 721 { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 { | 835 { |
835 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts(); | 836 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts(); |
836 } | 837 } |
837 | 838 |
838 bool Font::isFallbackValid() const | 839 bool Font::isFallbackValid() const |
839 { | 840 { |
840 return !m_fontFallbackList || m_fontFallbackList->isValid(); | 841 return !m_fontFallbackList || m_fontFallbackList->isValid(); |
841 } | 842 } |
842 | 843 |
843 } // namespace blink | 844 } // namespace blink |
OLD | NEW |