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

Side by Side Diff: Source/platform/fonts/GlyphPageTreeNode.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/FontFallbackList.cpp ('k') | Source/platform/fonts/SimpleFontData.cpp » ('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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 // Fill in a buffer with the entire "page" of characters that we want to loo k up glyphs for. 179 // Fill in a buffer with the entire "page" of characters that we want to loo k up glyphs for.
180 if (start < 0x10000) { 180 if (start < 0x10000) {
181 bufferLength = GlyphPage::size; 181 bufferLength = GlyphPage::size;
182 for (i = 0; i < GlyphPage::size; i++) 182 for (i = 0; i < GlyphPage::size; i++)
183 buffer[i] = start + i; 183 buffer[i] = start + i;
184 184
185 if (start == 0) { 185 if (start == 0) {
186 // Control characters must not render at all. 186 // Control characters must not render at all.
187 for (i = 0; i < 0x20; ++i) 187 for (i = 0; i < 0x20; ++i)
188 buffer[i] = zeroWidthSpace; 188 buffer[i] = zeroWidthSpaceCharacter;
189 for (i = 0x7F; i < 0xA0; i++) 189 for (i = 0x7F; i < 0xA0; i++)
190 buffer[i] = zeroWidthSpace; 190 buffer[i] = zeroWidthSpaceCharacter;
191 buffer[softHyphen] = zeroWidthSpace; 191 buffer[softHyphenCharacter] = zeroWidthSpaceCharacter;
192 192
193 // \n and \t must render as a space. 193 // \n and \t must render as a spaceCharacter.
194 buffer[newlineCharacter] = space; 194 buffer[newlineCharacter] = spaceCharacter;
195 buffer[characterTabulation] = space; 195 buffer[tabulationCharacter] = spaceCharacter;
196 } else if (start == (arabicLetterMark & ~(GlyphPage::size - 1))) { 196 } else if (start == (arabicLetterMarkCharacter & ~(GlyphPage::size - 1)) ) {
197 buffer[arabicLetterMark - start] = zeroWidthSpace; 197 buffer[arabicLetterMarkCharacter - start] = zeroWidthSpaceCharacter;
198 } else if (start == (leftToRightMark & ~(GlyphPage::size - 1))) { 198 } else if (start == (leftToRightMarkCharacter & ~(GlyphPage::size - 1))) {
199 // LRM, RLM, LRE, RLE, ZWNJ, ZWJ, and PDF must not render at all. 199 // LRM, RLM, LRE, RLE, ZWNJ, ZWJ, and PDF must not render at all.
200 buffer[leftToRightMark - start] = zeroWidthSpace; 200 buffer[leftToRightMarkCharacter - start] = zeroWidthSpaceCharacter;
201 buffer[rightToLeftMark - start] = zeroWidthSpace; 201 buffer[rightToLeftMarkCharacter - start] = zeroWidthSpaceCharacter;
202 buffer[leftToRightEmbed - start] = zeroWidthSpace; 202 buffer[leftToRightEmbedCharacter - start] = zeroWidthSpaceCharacter;
203 buffer[rightToLeftEmbed - start] = zeroWidthSpace; 203 buffer[rightToLeftEmbedCharacter - start] = zeroWidthSpaceCharacter;
204 buffer[leftToRightOverride - start] = zeroWidthSpace; 204 buffer[leftToRightOverrideCharacter - start] = zeroWidthSpaceCharact er;
205 buffer[rightToLeftOverride - start] = zeroWidthSpace; 205 buffer[rightToLeftOverrideCharacter - start] = zeroWidthSpaceCharact er;
206 buffer[zeroWidthNonJoiner - start] = zeroWidthSpace; 206 buffer[zeroWidthNonJoinerCharacter - start] = zeroWidthSpaceCharacte r;
207 buffer[zeroWidthJoiner - start] = zeroWidthSpace; 207 buffer[zeroWidthJoinerCharacter - start] = zeroWidthSpaceCharacter;
208 buffer[popDirectionalFormatting - start] = zeroWidthSpace; 208 buffer[popDirectionalFormattingCharacter - start] = zeroWidthSpaceCh aracter;
209 buffer[activateArabicFormShaping - start] = zeroWidthSpace; 209 buffer[activateArabicFormShapingCharacter - start] = zeroWidthSpaceC haracter;
210 buffer[activateSymmetricSwapping - start] = zeroWidthSpace; 210 buffer[activateSymmetricSwappingCharacter - start] = zeroWidthSpaceC haracter;
211 buffer[firstStrongIsolate - start] = zeroWidthSpace; 211 buffer[firstStrongIsolateCharacter - start] = zeroWidthSpaceCharacte r;
212 buffer[inhibitArabicFormShaping - start] = zeroWidthSpace; 212 buffer[inhibitArabicFormShapingCharacter - start] = zeroWidthSpaceCh aracter;
213 buffer[inhibitSymmetricSwapping - start] = zeroWidthSpace; 213 buffer[inhibitSymmetricSwappingCharacter - start] = zeroWidthSpaceCh aracter;
214 buffer[leftToRightIsolate - start] = zeroWidthSpace; 214 buffer[leftToRightIsolateCharacter - start] = zeroWidthSpaceCharacte r;
215 buffer[nationalDigitShapes - start] = zeroWidthSpace; 215 buffer[nationalDigitShapesCharacter - start] = zeroWidthSpaceCharact er;
216 buffer[nominalDigitShapes - start] = zeroWidthSpace; 216 buffer[nominalDigitShapesCharacter - start] = zeroWidthSpaceCharacte r;
217 buffer[popDirectionalIsolate - start] = zeroWidthSpace; 217 buffer[popDirectionalIsolateCharacter - start] = zeroWidthSpaceChara cter;
218 buffer[rightToLeftIsolate - start] = zeroWidthSpace; 218 buffer[rightToLeftIsolateCharacter - start] = zeroWidthSpaceCharacte r;
219 } else if (start == (objectReplacementCharacter & ~(GlyphPage::size - 1) )) { 219 } else if (start == (objectReplacementCharacter & ~(GlyphPage::size - 1) )) {
220 // Object replacement character must not render at all. 220 // Object replacement character must not render at all.
221 buffer[objectReplacementCharacter - start] = zeroWidthSpace; 221 buffer[objectReplacementCharacter - start] = zeroWidthSpaceCharacter ;
222 } else if (start == (zeroWidthNoBreakSpace & ~(GlyphPage::size - 1))) { 222 } else if (start == (zeroWidthNoBreakSpaceCharacter & ~(GlyphPage::size - 1))) {
223 // ZWNBS/BOM must not render at all. 223 // ZWNBS/BOM must not render at all.
224 buffer[zeroWidthNoBreakSpace - start] = zeroWidthSpace; 224 buffer[zeroWidthNoBreakSpaceCharacter - start] = zeroWidthSpaceChara cter;
225 } 225 }
226 } else { 226 } else {
227 bufferLength = GlyphPage::size * 2; 227 bufferLength = GlyphPage::size * 2;
228 for (i = 0; i < GlyphPage::size; i++) { 228 for (i = 0; i < GlyphPage::size; i++) {
229 int c = i + start; 229 int c = i + start;
230 buffer[i * 2] = U16_LEAD(c); 230 buffer[i * 2] = U16_LEAD(c);
231 buffer[i * 2 + 1] = U16_TRAIL(c); 231 buffer[i * 2 + 1] = U16_TRAIL(c);
232 } 232 }
233 } 233 }
234 234
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 // entries may use different fonts depending on character. If the Font 438 // entries may use different fonts depending on character. If the Font
439 // ever finds it needs a glyph out of the system fallback page, it will 439 // ever finds it needs a glyph out of the system fallback page, it will
440 // ask the system for the best font to use and fill that glyph in for us. 440 // ask the system for the best font to use and fill that glyph in for us.
441 if (GlyphPage* parentPage = m_parent->page()) 441 if (GlyphPage* parentPage = m_parent->page())
442 return parentPage->createCopiedSystemFallbackPage(this); 442 return parentPage->createCopiedSystemFallbackPage(this);
443 return GlyphPage::createForMixedFontData(this); 443 return GlyphPage::createForMixedFontData(this);
444 } 444 }
445 445
446 } // namespace blink 446 } // namespace blink
447 447
OLDNEW
« no previous file with comments | « Source/platform/fonts/FontFallbackList.cpp ('k') | Source/platform/fonts/SimpleFontData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698