OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkAdvancedTypefaceMetrics.h" | 9 #include "SkAdvancedTypefaceMetrics.h" |
10 #include "SkBase64.h" | 10 #include "SkBase64.h" |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 * This guy is public | 350 * This guy is public |
351 */ | 351 */ |
352 void SkLOGFONTFromTypeface(const SkTypeface* face, LOGFONT* lf) { | 352 void SkLOGFONTFromTypeface(const SkTypeface* face, LOGFONT* lf) { |
353 if (NULL == face) { | 353 if (NULL == face) { |
354 *lf = get_default_font(); | 354 *lf = get_default_font(); |
355 } else { | 355 } else { |
356 *lf = static_cast<const LogFontTypeface*>(face)->fLogFont; | 356 *lf = static_cast<const LogFontTypeface*>(face)->fLogFont; |
357 } | 357 } |
358 } | 358 } |
359 | 359 |
360 static void GetLogFontByID(SkFontID fontID, LOGFONT* lf) { | |
361 LogFontTypeface* face = static_cast<LogFontTypeface*>(SkTypefaceCache::FindB
yID(fontID)); | |
362 if (face) { | |
363 *lf = face->fLogFont; | |
364 } else { | |
365 sk_bzero(lf, sizeof(LOGFONT)); | |
366 } | |
367 } | |
368 | |
369 // Construct Glyph to Unicode table. | 360 // Construct Glyph to Unicode table. |
370 // Unicode code points that require conjugate pairs in utf16 are not | 361 // Unicode code points that require conjugate pairs in utf16 are not |
371 // supported. | 362 // supported. |
372 // TODO(arthurhsu): Add support for conjugate pairs. It looks like that may | 363 // TODO(arthurhsu): Add support for conjugate pairs. It looks like that may |
373 // require parsing the TTF cmap table (platform 4, encoding 12) directly instead | 364 // require parsing the TTF cmap table (platform 4, encoding 12) directly instead |
374 // of calling GetFontUnicodeRange(). | 365 // of calling GetFontUnicodeRange(). |
375 static void populate_glyph_to_unicode(HDC fontHdc, const unsigned glyphCount, | 366 static void populate_glyph_to_unicode(HDC fontHdc, const unsigned glyphCount, |
376 SkTDArray<SkUnichar>* glyphToUnicode) { | 367 SkTDArray<SkUnichar>* glyphToUnicode) { |
377 DWORD glyphSetBufferSize = GetFontUnicodeRanges(fontHdc, NULL); | 368 DWORD glyphSetBufferSize = GetFontUnicodeRanges(fontHdc, NULL); |
378 if (!glyphSetBufferSize) { | 369 if (!glyphSetBufferSize) { |
(...skipping 1997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2376 | 2367 |
2377 SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) { | 2368 SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) { |
2378 return create_from_stream(stream); | 2369 return create_from_stream(stream); |
2379 } | 2370 } |
2380 | 2371 |
2381 #endif | 2372 #endif |
2382 | 2373 |
2383 SkFontMgr* SkFontMgr::Factory() { | 2374 SkFontMgr* SkFontMgr::Factory() { |
2384 return SkNEW(SkFontMgrGDI); | 2375 return SkNEW(SkFontMgrGDI); |
2385 } | 2376 } |
OLD | NEW |