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()); | |
453 *serialize = false; | 452 *serialize = false; |
454 } | 453 } |
455 | 454 |
456 SkStreamAsset* onOpenStream(int* ttcIndex) const override { | 455 SkStreamAsset* onOpenStream(int* ttcIndex) const override { |
457 FCLocker lock; | 456 FCLocker lock; |
458 *ttcIndex = get_int(fPattern, FC_INDEX, 0); | 457 *ttcIndex = get_int(fPattern, FC_INDEX, 0); |
459 return SkStream::NewFromFile(get_string(fPattern, FC_FILE)); | 458 return SkStream::NewFromFile(get_string(fPattern, FC_FILE)); |
460 } | 459 } |
461 | 460 |
462 void onFilterRec(SkScalerContextRec* rec) const override { | 461 void onFilterRec(SkScalerContextRec* rec) const override { |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 return typeface.release(); | 933 return typeface.release(); |
935 } | 934 } |
936 | 935 |
937 return this->matchFamilyStyle(nullptr, style); | 936 return this->matchFamilyStyle(nullptr, style); |
938 } | 937 } |
939 }; | 938 }; |
940 | 939 |
941 SK_API SkFontMgr* SkFontMgr_New_FontConfig(FcConfig* fc) { | 940 SK_API SkFontMgr* SkFontMgr_New_FontConfig(FcConfig* fc) { |
942 return new SkFontMgr_fontconfig(fc); | 941 return new SkFontMgr_fontconfig(fc); |
943 } | 942 } |
OLD | NEW |