Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: third_party/WebKit/Source/platform/fonts/Font.cpp

Issue 1966703002: Support includePartialGlyphs=false in Font::offsetForPositionForComplexText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment as per eae review Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 CachingWordShaper shaper(m_fontFallbackList->shapeCache(m_fontDescription)); 735 CachingWordShaper shaper(m_fontFallbackList->shapeCache(m_fontDescription));
736 float width = shaper.width(this, run, fallbackFonts, glyphBounds); 736 float width = shaper.width(this, run, fallbackFonts, glyphBounds);
737 return width; 737 return width;
738 } 738 }
739 739
740 // Return the code point index for the given |x| offset into the text run. 740 // Return the code point index for the given |x| offset into the text run.
741 int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat, 741 int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat,
742 bool includePartialGlyphs) const 742 bool includePartialGlyphs) const
743 { 743 {
744 CachingWordShaper shaper(m_fontFallbackList->shapeCache(m_fontDescription)); 744 CachingWordShaper shaper(m_fontFallbackList->shapeCache(m_fontDescription));
745 return shaper.offsetForPosition(this, run, xFloat); 745 return shaper.offsetForPosition(this, run, xFloat, includePartialGlyphs);
746 } 746 }
747 747
748 // Return the rectangle for selecting the given range of code-points in the Text Run. 748 // Return the rectangle for selecting the given range of code-points in the Text Run.
749 FloatRect Font::selectionRectForComplexText(const TextRun& run, 749 FloatRect Font::selectionRectForComplexText(const TextRun& run,
750 const FloatPoint& point, int height, int from, int to) const 750 const FloatPoint& point, int height, int from, int to) const
751 { 751 {
752 CachingWordShaper shaper(m_fontFallbackList->shapeCache(m_fontDescription)); 752 CachingWordShaper shaper(m_fontFallbackList->shapeCache(m_fontDescription));
753 CharacterRange range = shaper.getCharacterRange(this, run, from, to); 753 CharacterRange range = shaper.getCharacterRange(this, run, from, to);
754 return FloatRect(point.x() + range.start, point.y(), range.width(), height); 754 return FloatRect(point.x() + range.start, point.y(), range.width(), height);
755 } 755 }
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 { 843 {
844 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts(); 844 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts();
845 } 845 }
846 846
847 bool Font::isFallbackValid() const 847 bool Font::isFallbackValid() const
848 { 848 {
849 return !m_fontFallbackList || m_fontFallbackList->isValid(); 849 return !m_fontFallbackList || m_fontFallbackList->isValid();
850 } 850 }
851 851
852 } // namespace blink 852 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698