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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 } | 331 } |
332 return face; | 332 return face; |
333 } | 333 } |
334 | 334 |
335 /** | 335 /** |
336 * The created SkTypeface takes ownership of fontMemResource. | 336 * The created SkTypeface takes ownership of fontMemResource. |
337 */ | 337 */ |
338 SkTypeface* SkCreateFontMemResourceTypefaceFromLOGFONT(const LOGFONT& origLF, HA
NDLE fontMemResource) { | 338 SkTypeface* SkCreateFontMemResourceTypefaceFromLOGFONT(const LOGFONT& origLF, HA
NDLE fontMemResource) { |
339 LOGFONT lf = origLF; | 339 LOGFONT lf = origLF; |
340 make_canonical(&lf); | 340 make_canonical(&lf); |
341 FontMemResourceTypeface* face = FontMemResourceTypeface::Create(lf, fontMemR
esource); | 341 // We'll never get a cache hit, so no point in putting this in SkTypefaceCac
he. |
342 SkTypefaceCache::Add(face, get_style(lf), false); | 342 return FontMemResourceTypeface::Create(lf, fontMemResource); |
343 return face; | |
344 } | 343 } |
345 | 344 |
346 /** | 345 /** |
347 * This guy is public | 346 * This guy is public |
348 */ | 347 */ |
349 void SkLOGFONTFromTypeface(const SkTypeface* face, LOGFONT* lf) { | 348 void SkLOGFONTFromTypeface(const SkTypeface* face, LOGFONT* lf) { |
350 if (NULL == face) { | 349 if (NULL == face) { |
351 *lf = get_default_font(); | 350 *lf = get_default_font(); |
352 } else { | 351 } else { |
353 *lf = static_cast<const LogFontTypeface*>(face)->fLogFont; | 352 *lf = static_cast<const LogFontTypeface*>(face)->fLogFont; |
(...skipping 2223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2577 | 2576 |
2578 private: | 2577 private: |
2579 SkTDArray<ENUMLOGFONTEX> fLogFontArray; | 2578 SkTDArray<ENUMLOGFONTEX> fLogFontArray; |
2580 }; | 2579 }; |
2581 | 2580 |
2582 /////////////////////////////////////////////////////////////////////////////// | 2581 /////////////////////////////////////////////////////////////////////////////// |
2583 | 2582 |
2584 SkFontMgr* SkFontMgr_New_GDI() { | 2583 SkFontMgr* SkFontMgr_New_GDI() { |
2585 return SkNEW(SkFontMgrGDI); | 2584 return SkNEW(SkFontMgrGDI); |
2586 } | 2585 } |
OLD | NEW |