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

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

Issue 2888643004: [LayoutNG] Implement LayoutBR/preserved newlines and tabs (Closed)
Patch Set: Rebase Created 3 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // Metrics that we query the FontFallbackList for. 165 // Metrics that we query the FontFallbackList for.
166 float SpaceWidth() const { 166 float SpaceWidth() const {
167 DCHECK(PrimaryFont()); 167 DCHECK(PrimaryFont());
168 return (PrimaryFont() ? PrimaryFont()->SpaceWidth() : 0) + 168 return (PrimaryFont() ? PrimaryFont()->SpaceWidth() : 0) +
169 GetFontDescription().LetterSpacing(); 169 GetFontDescription().LetterSpacing();
170 } 170 }
171 float TabWidth(const SimpleFontData*, const TabSize&, float position) const; 171 float TabWidth(const SimpleFontData*, const TabSize&, float position) const;
172 float TabWidth(const TabSize& tab_size, float position) const { 172 float TabWidth(const TabSize& tab_size, float position) const {
173 return TabWidth(PrimaryFont(), tab_size, position); 173 return TabWidth(PrimaryFont(), tab_size, position);
174 } 174 }
175 LayoutUnit TabWidth(const TabSize&, LayoutUnit position) const;
175 176
176 int EmphasisMarkAscent(const AtomicString&) const; 177 int EmphasisMarkAscent(const AtomicString&) const;
177 int EmphasisMarkDescent(const AtomicString&) const; 178 int EmphasisMarkDescent(const AtomicString&) const;
178 int EmphasisMarkHeight(const AtomicString&) const; 179 int EmphasisMarkHeight(const AtomicString&) const;
179 180
180 // This may fail and return a nullptr in case the last resort font cannot be 181 // This may fail and return a nullptr in case the last resort font cannot be
181 // loaded. This *should* not happen but in reality it does ever now and then 182 // loaded. This *should* not happen but in reality it does ever now and then
182 // when, for whatever reason, the last resort font cannot be loaded. 183 // when, for whatever reason, the last resort font cannot be loaded.
183 const SimpleFontData* PrimaryFont() const; 184 const SimpleFontData* PrimaryFont() const;
184 const FontData* FontDataAt(unsigned) const; 185 const FontData* FontDataAt(unsigned) const;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 // advance an additional tab stop. 262 // advance an additional tab stop.
262 if (distance_to_tab_stop < font_data->SpaceWidth() / 2) 263 if (distance_to_tab_stop < font_data->SpaceWidth() / 2)
263 distance_to_tab_stop += base_tab_width; 264 distance_to_tab_stop += base_tab_width;
264 265
265 return distance_to_tab_stop; 266 return distance_to_tab_stop;
266 } 267 }
267 268
268 } // namespace blink 269 } // namespace blink
269 270
270 #endif 271 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc ('k') | third_party/WebKit/Source/platform/fonts/Font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698