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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 { | 697 { |
698 CachingWordShaper& shaper = m_fontFallbackList->cachingWordShaper(); | 698 CachingWordShaper& shaper = m_fontFallbackList->cachingWordShaper(); |
699 float width = shaper.width(this, run, fallbackFonts, glyphBounds); | 699 float width = shaper.width(this, run, fallbackFonts, glyphBounds); |
700 return width; | 700 return width; |
701 } | 701 } |
702 | 702 |
703 // Return the code point index for the given |x| offset into the text run. | 703 // Return the code point index for the given |x| offset into the text run. |
704 int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat, | 704 int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat, |
705 bool includePartialGlyphs) const | 705 bool includePartialGlyphs) const |
706 { | 706 { |
707 HashSet<const SimpleFontData*> fallbackFonts; | 707 HarfBuzzShaper shaper(this, run); |
708 HarfBuzzShaper shaper(this, run, &fallbackFonts); | |
709 RefPtr<ShapeResult> shapeResult = shaper.shapeResult(); | 708 RefPtr<ShapeResult> shapeResult = shaper.shapeResult(); |
710 if (!shapeResult) | 709 if (!shapeResult) |
711 return 0; | 710 return 0; |
712 return shapeResult->offsetForPosition(xFloat); | 711 return shapeResult->offsetForPosition(xFloat); |
713 } | 712 } |
714 | 713 |
715 // Return the rectangle for selecting the given range of code-points in the Text
Run. | 714 // Return the rectangle for selecting the given range of code-points in the Text
Run. |
716 FloatRect Font::selectionRectForComplexText(const TextRun& run, | 715 FloatRect Font::selectionRectForComplexText(const TextRun& run, |
717 const FloatPoint& point, int height, int from, int to) const | 716 const FloatPoint& point, int height, int from, int to) const |
718 { | 717 { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 { | 831 { |
833 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts(); | 832 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts(); |
834 } | 833 } |
835 | 834 |
836 bool Font::isFallbackValid() const | 835 bool Font::isFallbackValid() const |
837 { | 836 { |
838 return !m_fontFallbackList || m_fontFallbackList->isValid(); | 837 return !m_fontFallbackList || m_fontFallbackList->isValid(); |
839 } | 838 } |
840 | 839 |
841 } // namespace blink | 840 } // namespace blink |
OLD | NEW |