682 {
684
688
695 }
696 int weightIndex = (
SkTPin(style.
weight(), 100, 900) - 50) / 100;
697 if (weightIndex != 3) {
698 static constexpr const char* weights[] = {
699 "100", "200", "300", "normal", "400", "500", "600", "bold", "800", "900"
700 };
701 this->
addAttribute(
"font-weight", weights[weightIndex]);
702 }
703 int stretchIndex = style.
width() - 1;
704 if (stretchIndex != 4) {
705 static constexpr const char* stretches[] = {
706 "ultra-condensed", "extra-condensed", "condensed", "semi-condensed",
707 "normal",
708 "semi-expanded", "expanded", "extra-expanded", "ultra-expanded"
709 };
710 this->
addAttribute(
"font-stretch", stretches[stretchIndex]);
711 }
712
715 if (familyNameIter) {
716 while (familyNameIter->next(&familyString)) {
718 continue;
719 }
722 }
723 }
726 }
727}
static constexpr const T & SkTPin(const T &x, const T &lo, const T &hi)
void void void appendf(const char format[],...) SK_PRINTF_LIKE(2
LocalizedStrings * createFamilyNameIterator() const
SkFontStyle fontStyle() const
bool contains(const T &item) const
font
Font Metadata and Metrics.