| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 "SkFontHost.h" | 8 #include "SkFontHost.h" |
| 9 #include "SkFontHost_FreeType_common.h" | 9 #include "SkFontHost_FreeType_common.h" |
| 10 #include "SkFontDescriptor.h" | 10 #include "SkFontDescriptor.h" |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 SkTypeface::Style oldStyle = (SkTypeface::Style)styleBits; | 286 SkTypeface::Style oldStyle = (SkTypeface::Style)styleBits; |
| 287 SkFontStyle style = SkFontStyle(oldStyle & SkTypeface::kBold | 287 SkFontStyle style = SkFontStyle(oldStyle & SkTypeface::kBold |
| 288 ? SkFontStyle::kBold_Weight | 288 ? SkFontStyle::kBold_Weight |
| 289 : SkFontStyle::kNormal_Weight, | 289 : SkFontStyle::kNormal_Weight, |
| 290 SkFontStyle::kNormal_Width, | 290 SkFontStyle::kNormal_Width, |
| 291 oldStyle & SkTypeface::kItalic | 291 oldStyle & SkTypeface::kItalic |
| 292 ? SkFontStyle::kItalic_Slant | 292 ? SkFontStyle::kItalic_Slant |
| 293 : SkFontStyle::kUpright_Slant); | 293 : SkFontStyle::kUpright_Slant); |
| 294 SkTypeface* tf = NULL; | 294 SkTypeface* tf = NULL; |
| 295 | 295 |
| 296 if (NULL != familyName) { | 296 if (familyName) { |
| 297 tf = this->onMatchFamilyStyle(familyName, style); | 297 tf = this->onMatchFamilyStyle(familyName, style); |
| 298 } | 298 } |
| 299 | 299 |
| 300 if (NULL == tf) { | 300 if (NULL == tf) { |
| 301 tf = gDefaultFamily->matchStyle(style); | 301 tf = gDefaultFamily->matchStyle(style); |
| 302 } | 302 } |
| 303 | 303 |
| 304 return SkSafeRef(tf); | 304 return SkSafeRef(tf); |
| 305 } | 305 } |
| 306 | 306 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 } | 397 } |
| 398 | 398 |
| 399 SkTArray<SkAutoTUnref<SkFontStyleSet_Custom>, true> fFamilies; | 399 SkTArray<SkAutoTUnref<SkFontStyleSet_Custom>, true> fFamilies; |
| 400 SkFontStyleSet_Custom* gDefaultFamily; | 400 SkFontStyleSet_Custom* gDefaultFamily; |
| 401 SkTypeface* gDefaultNormal; | 401 SkTypeface* gDefaultNormal; |
| 402 }; | 402 }; |
| 403 | 403 |
| 404 SkFontMgr* SkFontMgr::Factory() { | 404 SkFontMgr* SkFontMgr::Factory() { |
| 405 return new SkFontMgr_Custom(SK_FONT_FILE_PREFIX); | 405 return new SkFontMgr_Custom(SK_FONT_FILE_PREFIX); |
| 406 } | 406 } |
| OLD | NEW |