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

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

Issue 1119663002: Making Unicode character names consistent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase patch Created 5 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
« no previous file with comments | « Source/platform/fonts/GlyphPageTreeNode.cpp ('k') | Source/platform/fonts/UTF16TextIterator.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) 2005, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2006 Alexey Proskuryakov 3 * Copyright (C) 2006 Alexey Proskuryakov
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 return; 276 return;
277 } 277 }
278 278
279 // Ask for the glyph for 0 to avoid paging in ZERO WIDTH SPACE. Control char acters, including 0, 279 // Ask for the glyph for 0 to avoid paging in ZERO WIDTH SPACE. Control char acters, including 0,
280 // are mapped to the ZERO WIDTH SPACE glyph. 280 // are mapped to the ZERO WIDTH SPACE glyph.
281 m_zeroWidthSpaceGlyph = glyphPageZero->glyphForCharacter(0); 281 m_zeroWidthSpaceGlyph = glyphPageZero->glyphForCharacter(0);
282 282
283 // Nasty hack to determine if we should round or ceil space widths. 283 // Nasty hack to determine if we should round or ceil space widths.
284 // If the font is monospace or fake monospace we ceil to ensure that 284 // If the font is monospace or fake monospace we ceil to ensure that
285 // every character and the space are the same width. Otherwise we round. 285 // every character and the space are the same width. Otherwise we round.
286 m_spaceGlyph = glyphPageZero->glyphForCharacter(space); 286 m_spaceGlyph = glyphPageZero->glyphForCharacter(spaceCharacter);
287 float width = widthForGlyph(m_spaceGlyph); 287 float width = widthForGlyph(m_spaceGlyph);
288 m_spaceWidth = width; 288 m_spaceWidth = width;
289 m_zeroGlyph = glyphPageZero->glyphForCharacter('0'); 289 m_zeroGlyph = glyphPageZero->glyphForCharacter('0');
290 m_fontMetrics.setZeroWidth(widthForGlyph(m_zeroGlyph)); 290 m_fontMetrics.setZeroWidth(widthForGlyph(m_zeroGlyph));
291 291
292 // Force the glyph for ZERO WIDTH SPACE to have zero width, unless it is sha red with SPACE. 292 // Force the glyph for ZERO WIDTH SPACE to have zero width, unless it is sha red with SPACE.
293 // Helvetica is an example of a non-zero width ZERO WIDTH SPACE glyph. 293 // Helvetica is an example of a non-zero width ZERO WIDTH SPACE glyph.
294 // See <http://bugs.webkit.org/show_bug.cgi?id=13178> 294 // See <http://bugs.webkit.org/show_bug.cgi?id=13178>
295 if (m_zeroWidthSpaceGlyph == m_spaceGlyph) { 295 if (m_zeroWidthSpaceGlyph == m_spaceGlyph) {
296 m_zeroWidthSpaceGlyph = 0; 296 m_zeroWidthSpaceGlyph = 0;
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 if (glyphs[i]) { 508 if (glyphs[i]) {
509 pageToFill->setGlyphDataForIndex(offset + i, glyphs[i], this); 509 pageToFill->setGlyphDataForIndex(offset + i, glyphs[i], this);
510 haveGlyphs = true; 510 haveGlyphs = true;
511 } 511 }
512 } 512 }
513 513
514 return haveGlyphs; 514 return haveGlyphs;
515 } 515 }
516 516
517 } // namespace blink 517 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/fonts/GlyphPageTreeNode.cpp ('k') | Source/platform/fonts/UTF16TextIterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698