Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 1f02e84

Browse files
fmalitaSkia Commit-Bot
authored andcommitted
[skottie] Add support for more font weights
Also shuffle the search order to better match use frequency. Change-Id: I8ba7f5474f0937aecb75215a1129b439f89a7dbf Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216357 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Ben Wagner <bungeman@google.com>
1 parent 9bba726 commit 1f02e84

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

modules/skottie/src/text/TextLayer.cpp

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,30 @@ SkFontStyle FontStyle(const AnimationBuilder* abuilder, const char* style) {
3131
const char* fName;
3232
const SkFontStyle::Weight fWeight;
3333
} gWeightMap[] = {
34-
{ "ExtraLight", SkFontStyle::kExtraLight_Weight },
35-
{ "Light" , SkFontStyle::kLight_Weight },
3634
{ "Regular" , SkFontStyle::kNormal_Weight },
3735
{ "Medium" , SkFontStyle::kMedium_Weight },
38-
{ "SemiBold" , SkFontStyle::kSemiBold_Weight },
3936
{ "Bold" , SkFontStyle::kBold_Weight },
37+
{ "Light" , SkFontStyle::kLight_Weight },
38+
{ "Black" , SkFontStyle::kBlack_Weight },
39+
{ "Thin" , SkFontStyle::kThin_Weight },
40+
{ "Extra" , SkFontStyle::kExtraBold_Weight },
4041
{ "ExtraBold" , SkFontStyle::kExtraBold_Weight },
42+
{ "ExtraLight", SkFontStyle::kExtraLight_Weight },
43+
{ "ExtraBlack", SkFontStyle::kExtraBlack_Weight },
44+
{ "SemiBold" , SkFontStyle::kSemiBold_Weight },
45+
{ "Hairline" , SkFontStyle::kThin_Weight },
46+
{ "Normal" , SkFontStyle::kNormal_Weight },
47+
{ "Plain" , SkFontStyle::kNormal_Weight },
48+
{ "Standard" , SkFontStyle::kNormal_Weight },
49+
{ "Roman" , SkFontStyle::kNormal_Weight },
50+
{ "Heavy" , SkFontStyle::kBlack_Weight },
51+
{ "Demi" , SkFontStyle::kSemiBold_Weight },
52+
{ "DemiBold" , SkFontStyle::kSemiBold_Weight },
53+
{ "Ultra" , SkFontStyle::kExtraBold_Weight },
54+
{ "UltraBold" , SkFontStyle::kExtraBold_Weight },
55+
{ "UltraBlack", SkFontStyle::kExtraBlack_Weight },
56+
{ "UltraHeavy", SkFontStyle::kExtraBlack_Weight },
57+
{ "UltraLight", SkFontStyle::kExtraLight_Weight },
4158
};
4259

4360
SkFontStyle::Weight weight = SkFontStyle::kNormal_Weight;

0 commit comments

Comments
 (0)