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

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

Issue 1978683002: Enable hyphens: auto and none in BreakingContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments for heuristic, adjust widths of hyphens-auto-mock test 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) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 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, 2007, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2006, 2007, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) 2008 Holger Hans Peter Freyther 6 * Copyright (C) 2008 Holger Hans Peter Freyther
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 bool drawText(SkCanvas*, const TextRunPaintInfo&, const FloatPoint&, float d eviceScaleFactor, const SkPaint&) const; 80 bool drawText(SkCanvas*, const TextRunPaintInfo&, const FloatPoint&, float d eviceScaleFactor, const SkPaint&) const;
81 bool drawBidiText(SkCanvas*, const TextRunPaintInfo&, const FloatPoint&, Cus tomFontNotReadyAction, float deviceScaleFactor, const SkPaint&) const; 81 bool drawBidiText(SkCanvas*, const TextRunPaintInfo&, const FloatPoint&, Cus tomFontNotReadyAction, float deviceScaleFactor, const SkPaint&) const;
82 void drawEmphasisMarks(SkCanvas*, const TextRunPaintInfo&, const AtomicStrin g& mark, const FloatPoint&, float deviceScaleFactor, const SkPaint&) const; 82 void drawEmphasisMarks(SkCanvas*, const TextRunPaintInfo&, const AtomicStrin g& mark, const FloatPoint&, float deviceScaleFactor, const SkPaint&) const;
83 83
84 // Glyph bounds will be the minimum rect containing all glyph strokes, in co ordinates using 84 // Glyph bounds will be the minimum rect containing all glyph strokes, in co ordinates using
85 // (<text run x position>, <baseline position>) as the origin. 85 // (<text run x position>, <baseline position>) as the origin.
86 float width(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = nullptr, FloatRect* glyphBounds = nullptr) const; 86 float width(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = nullptr, FloatRect* glyphBounds = nullptr) const;
87 87
88 int offsetForPosition(const TextRun&, float position, bool includePartialGly phs) const; 88 int offsetForPosition(const TextRun&, float position, bool includePartialGly phs) const;
89 FloatRect selectionRectForText(const TextRun&, const FloatPoint&, int h, int from = 0, int to = -1, bool accountForGlyphBounds = false) const; 89 FloatRect selectionRectForText(const TextRun&, const FloatPoint&, int h, int from = 0, int to = -1, bool accountForGlyphBounds = false) const;
90 CharacterRange getCharacterRange(const TextRun&, unsigned from, unsigned to) const;
90 Vector<CharacterRange> individualCharacterRanges(const TextRun&) const; 91 Vector<CharacterRange> individualCharacterRanges(const TextRun&) const;
91 92
92 // Metrics that we query the FontFallbackList for. 93 // Metrics that we query the FontFallbackList for.
93 const FontMetrics& getFontMetrics() const 94 const FontMetrics& getFontMetrics() const
94 { 95 {
95 RELEASE_ASSERT(primaryFont()); 96 RELEASE_ASSERT(primaryFont());
96 return primaryFont()->getFontMetrics(); 97 return primaryFont()->getFontMetrics();
97 } 98 }
98 float spaceWidth() const { return primaryFont()->spaceWidth() + getFontDescr iption().letterSpacing(); } 99 float spaceWidth() const { return primaryFont()->spaceWidth() + getFontDescr iption().letterSpacing(); }
99 float tabWidth(const SimpleFontData&, const TabSize&, float position) const; 100 float tabWidth(const SimpleFontData&, const TabSize&, float position) const;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 // if the distance to the next tab stop is less than that, advance an additi onal tab stop. 198 // if the distance to the next tab stop is less than that, advance an additi onal tab stop.
198 if (distanceToTabStop < std::max(getFontDescription().letterSpacing(), Layou tUnit::epsilon())) 199 if (distanceToTabStop < std::max(getFontDescription().letterSpacing(), Layou tUnit::epsilon()))
199 distanceToTabStop += baseTabWidth; 200 distanceToTabStop += baseTabWidth;
200 201
201 return distanceToTabStop; 202 return distanceToTabStop;
202 } 203 }
203 204
204 } // namespace blink 205 } // namespace blink
205 206
206 #endif 207 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/MockHyphenation.cpp ('k') | third_party/WebKit/Source/platform/fonts/Font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698