| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkDataTable.h" | 8 #include "SkDataTable.h" |
| 9 #include "SkFixed.h" | 9 #include "SkFixed.h" |
| 10 #include "SkFontDescriptor.h" | 10 #include "SkFontDescriptor.h" |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 | 442 |
| 443 void onGetFamilyName(SkString* familyName) const override { | 443 void onGetFamilyName(SkString* familyName) const override { |
| 444 *familyName = get_string(fPattern, FC_FAMILY); | 444 *familyName = get_string(fPattern, FC_FAMILY); |
| 445 } | 445 } |
| 446 | 446 |
| 447 void onGetFontDescriptor(SkFontDescriptor* desc, bool* serialize) const over
ride { | 447 void onGetFontDescriptor(SkFontDescriptor* desc, bool* serialize) const over
ride { |
| 448 FCLocker lock; | 448 FCLocker lock; |
| 449 desc->setFamilyName(get_string(fPattern, FC_FAMILY)); | 449 desc->setFamilyName(get_string(fPattern, FC_FAMILY)); |
| 450 desc->setFullName(get_string(fPattern, FC_FULLNAME)); | 450 desc->setFullName(get_string(fPattern, FC_FULLNAME)); |
| 451 desc->setPostscriptName(get_string(fPattern, FC_POSTSCRIPT_NAME)); | 451 desc->setPostscriptName(get_string(fPattern, FC_POSTSCRIPT_NAME)); |
| 452 desc->setStyle(this->fontStyle()); |
| 452 *serialize = false; | 453 *serialize = false; |
| 453 } | 454 } |
| 454 | 455 |
| 455 SkStreamAsset* onOpenStream(int* ttcIndex) const override { | 456 SkStreamAsset* onOpenStream(int* ttcIndex) const override { |
| 456 FCLocker lock; | 457 FCLocker lock; |
| 457 *ttcIndex = get_int(fPattern, FC_INDEX, 0); | 458 *ttcIndex = get_int(fPattern, FC_INDEX, 0); |
| 458 return SkStream::NewFromFile(get_string(fPattern, FC_FILE)); | 459 return SkStream::NewFromFile(get_string(fPattern, FC_FILE)); |
| 459 } | 460 } |
| 460 | 461 |
| 461 void onFilterRec(SkScalerContextRec* rec) const override { | 462 void onFilterRec(SkScalerContextRec* rec) const override { |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 return typeface.release(); | 934 return typeface.release(); |
| 934 } | 935 } |
| 935 | 936 |
| 936 return this->matchFamilyStyle(nullptr, style); | 937 return this->matchFamilyStyle(nullptr, style); |
| 937 } | 938 } |
| 938 }; | 939 }; |
| 939 | 940 |
| 940 SK_API SkFontMgr* SkFontMgr_New_FontConfig(FcConfig* fc) { | 941 SK_API SkFontMgr* SkFontMgr_New_FontConfig(FcConfig* fc) { |
| 941 return new SkFontMgr_fontconfig(fc); | 942 return new SkFontMgr_fontconfig(fc); |
| 942 } | 943 } |
| OLD | NEW |