684 {
686
690
697 }
698 int weightIndex = (
SkTPin(style.
weight(), 100, 900) - 50) / 100;
699 if (weightIndex != 3) {
700 static constexpr const char* weights[] = {
701 "100", "200", "300", "normal", "400", "500", "600", "bold", "800", "900"
702 };
703 this->
addAttribute(
"font-weight", weights[weightIndex]);
704 }
705 int stretchIndex = style.
width() - 1;
706 if (stretchIndex != 4) {
707 static constexpr const char* stretches[] = {
708 "ultra-condensed", "extra-condensed", "condensed", "semi-condensed",
709 "normal",
710 "semi-expanded", "expanded", "extra-expanded", "ultra-expanded"
711 };
712 this->
addAttribute(
"font-stretch", stretches[stretchIndex]);
713 }
714
717 if (familyNameIter) {
718 while (familyNameIter->next(&familyString)) {
720 continue;
721 }
723 familyName.
appendf((familyName.
isEmpty() ?
"%s" :
", %s"), familyString.fString.c_str());
724 }
725 }
728 }
729}
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
bool contains(const T &item) const
font
Font Metadata and Metrics.