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

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

Issue 1239513004: Change fallback font collection in HarfBuzzShaper (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Kill _ALL_ the new lines Created 5 years, 5 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
« no previous file with comments | « no previous file | Source/platform/fonts/shaping/CachingWordShapeIterator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 HarfBuzzShaper shaper(this, run);
711 HarfBuzzShaper shaper(this, run, &fallbackFonts);
712 RefPtr<ShapeResult> shapeResult = shaper.shapeResult(); 711 RefPtr<ShapeResult> shapeResult = shaper.shapeResult();
713 if (!shapeResult) 712 if (!shapeResult)
714 return 0; 713 return 0;
715 return shapeResult->offsetForPosition(xFloat); 714 return shapeResult->offsetForPosition(xFloat);
716 } 715 }
717 716
718 // Return the rectangle for selecting the given range of code-points in the Text Run. 717 // Return the rectangle for selecting the given range of code-points in the Text Run.
719 FloatRect Font::selectionRectForComplexText(const TextRun& run, 718 FloatRect Font::selectionRectForComplexText(const TextRun& run,
720 const FloatPoint& point, int height, int from, int to) const 719 const FloatPoint& point, int height, int from, int to) const
721 { 720 {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 { 834 {
836 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts(); 835 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts();
837 } 836 }
838 837
839 bool Font::isFallbackValid() const 838 bool Font::isFallbackValid() const
840 { 839 {
841 return !m_fontFallbackList || m_fontFallbackList->isValid(); 840 return !m_fontFallbackList || m_fontFallbackList->isValid();
842 } 841 }
843 842
844 } // namespace blink 843 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/platform/fonts/shaping/CachingWordShapeIterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698