| 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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 | 744 |
| 745 // Return the rectangle for selecting the given range of code-points in the Text
Run. | 745 // Return the rectangle for selecting the given range of code-points in the Text
Run. |
| 746 FloatRect Font::selectionRectForComplexText(const TextRun& run, | 746 FloatRect Font::selectionRectForComplexText(const TextRun& run, |
| 747 const FloatPoint& point, int height, int from, int to) const | 747 const FloatPoint& point, int height, int from, int to) const |
| 748 { | 748 { |
| 749 CachingWordShaper shaper(m_fontFallbackList->shapeCache(m_fontDescription)); | 749 CachingWordShaper shaper(m_fontFallbackList->shapeCache(m_fontDescription)); |
| 750 CharacterRange range = shaper.getCharacterRange(this, run, from, to); | 750 CharacterRange range = shaper.getCharacterRange(this, run, from, to); |
| 751 return FloatRect(point.x() + range.start, point.y(), range.width(), height); | 751 return FloatRect(point.x() + range.start, point.y(), range.width(), height); |
| 752 } | 752 } |
| 753 | 753 |
| 754 CharacterRange Font::getCharacterRange(const TextRun& run, unsigned from, unsign
ed to) const |
| 755 { |
| 756 FontCachePurgePreventer purgePreventer; |
| 757 CachingWordShaper shaper(m_fontFallbackList->shapeCache(m_fontDescription)); |
| 758 return shaper.getCharacterRange(this, run, from, to); |
| 759 } |
| 760 |
| 754 Vector<CharacterRange> Font::individualCharacterRanges(const TextRun& run) const | 761 Vector<CharacterRange> Font::individualCharacterRanges(const TextRun& run) const |
| 755 { | 762 { |
| 756 // TODO(pdr): Android is temporarily (crbug.com/577306) using the old simple | 763 // TODO(pdr): Android is temporarily (crbug.com/577306) using the old simple |
| 757 // shaper and using the complex shaper here can show differences between | 764 // shaper and using the complex shaper here can show differences between |
| 758 // the two shapers. This function is currently only called through SVG | 765 // the two shapers. This function is currently only called through SVG |
| 759 // which now exclusively uses the complex shaper, so the primary difference | 766 // which now exclusively uses the complex shaper, so the primary difference |
| 760 // will be improved shaping in SVG when compared to HTML. | 767 // will be improved shaping in SVG when compared to HTML. |
| 761 FontCachePurgePreventer purgePreventer; | 768 FontCachePurgePreventer purgePreventer; |
| 762 CachingWordShaper shaper(m_fontFallbackList->shapeCache(m_fontDescription)); | 769 CachingWordShaper shaper(m_fontFallbackList->shapeCache(m_fontDescription)); |
| 763 return shaper.individualCharacterRanges(this, run); | 770 return shaper.individualCharacterRanges(this, run); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 { | 847 { |
| 841 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts(); | 848 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts(); |
| 842 } | 849 } |
| 843 | 850 |
| 844 bool Font::isFallbackValid() const | 851 bool Font::isFallbackValid() const |
| 845 { | 852 { |
| 846 return !m_fontFallbackList || m_fontFallbackList->isValid(); | 853 return !m_fontFallbackList || m_fontFallbackList->isValid(); |
| 847 } | 854 } |
| 848 | 855 |
| 849 } // namespace blink | 856 } // namespace blink |
| OLD | NEW |