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 HashSet<const SimpleFontData*> fallbackFonts; | 710 CachingWordShaper& shaper = m_fontFallbackList->cachingWordShaper(); |
711 HarfBuzzShaper shaper(this, run, &fallbackFonts); | 711 return shaper.offsetForPosition(this, run, xFloat); |
712 RefPtr<ShapeResult> shapeResult = shaper.shapeResult(); | |
713 if (!shapeResult) | |
714 return 0; | |
715 return shapeResult->offsetForPosition(xFloat); | |
716 } | 712 } |
717 | 713 |
718 // 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. |
719 FloatRect Font::selectionRectForComplexText(const TextRun& run, | 715 FloatRect Font::selectionRectForComplexText(const TextRun& run, |
720 const FloatPoint& point, int height, int from, int to) const | 716 const FloatPoint& point, int height, int from, int to) const |
721 { | 717 { |
722 CachingWordShaper& shaper = m_fontFallbackList->cachingWordShaper(); | 718 CachingWordShaper& shaper = m_fontFallbackList->cachingWordShaper(); |
723 return shaper.selectionRect(this, run, point, height, from, to); | 719 return shaper.selectionRect(this, run, point, height, from, to); |
724 } | 720 } |
725 | 721 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 { | 831 { |
836 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts(); | 832 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts(); |
837 } | 833 } |
838 | 834 |
839 bool Font::isFallbackValid() const | 835 bool Font::isFallbackValid() const |
840 { | 836 { |
841 return !m_fontFallbackList || m_fontFallbackList->isValid(); | 837 return !m_fontFallbackList || m_fontFallbackList->isValid(); |
842 } | 838 } |
843 | 839 |
844 } // namespace blink | 840 } // namespace blink |
OLD | NEW |