| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkTypes.h" | 8 #include "SkTypes.h" |
| 9 #undef GetGlyphIndices | 9 #undef GetGlyphIndices |
| 10 | 10 |
| (...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1453 | 1453 |
| 1454 SkAutoTArray<UINT16> glyph(count); | 1454 SkAutoTArray<UINT16> glyph(count); |
| 1455 fontFace->GetGlyphIndices(chars.get(), count, glyph.get()); | 1455 fontFace->GetGlyphIndices(chars.get(), count, glyph.get()); |
| 1456 | 1456 |
| 1457 USHORT maxGlyph = 0; | 1457 USHORT maxGlyph = 0; |
| 1458 for (USHORT j = 0; j < count; ++j) { | 1458 for (USHORT j = 0; j < count; ++j) { |
| 1459 if (glyph[j] > maxGlyph) maxGlyph = glyph[j]; | 1459 if (glyph[j] > maxGlyph) maxGlyph = glyph[j]; |
| 1460 } | 1460 } |
| 1461 | 1461 |
| 1462 glyphToUnicode->setCount(maxGlyph+1); | 1462 glyphToUnicode->setCount(maxGlyph+1); |
| 1463 for (size_t j = 0; j < maxGlyph+1u; ++j) { | 1463 for (USHORT j = 0; j < maxGlyph+1u; ++j) { |
| 1464 (*glyphToUnicode)[j] = 0; | 1464 (*glyphToUnicode)[j] = 0; |
| 1465 } | 1465 } |
| 1466 | 1466 |
| 1467 //'invert' | 1467 //'invert' |
| 1468 for (USHORT j = 0; j < count; ++j) { | 1468 for (USHORT j = 0; j < count; ++j) { |
| 1469 if (glyph[j] < glyphCount && (*glyphToUnicode)[glyph[j]] == 0) { | 1469 if (glyph[j] < glyphCount && (*glyphToUnicode)[glyph[j]] == 0) { |
| 1470 (*glyphToUnicode)[glyph[j]] = chars[j]; | 1470 (*glyphToUnicode)[glyph[j]] = chars[j]; |
| 1471 } | 1471 } |
| 1472 } | 1472 } |
| 1473 } | 1473 } |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1930 SK_TRACEHR(hr, "Could not get GetUserDefaultLocaleName."); | 1930 SK_TRACEHR(hr, "Could not get GetUserDefaultLocaleName."); |
| 1931 } else { | 1931 } else { |
| 1932 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N
AME_MAX_LENGTH); | 1932 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N
AME_MAX_LENGTH); |
| 1933 if (localeNameLen) { | 1933 if (localeNameLen) { |
| 1934 localeName = localeNameStorage; | 1934 localeName = localeNameStorage; |
| 1935 }; | 1935 }; |
| 1936 } | 1936 } |
| 1937 | 1937 |
| 1938 return SkNEW_ARGS(SkFontMgr_DirectWrite, (sysFontCollection.get(), localeNam
e, localeNameLen)); | 1938 return SkNEW_ARGS(SkFontMgr_DirectWrite, (sysFontCollection.get(), localeNam
e, localeNameLen)); |
| 1939 } | 1939 } |
| OLD | NEW |