Lines Matching defs:font
23 // 1px font size "HarmonyOS Sans" metrics
32 // unordered_map<familyName, ScaleParam>: compress <familyName> font height, shift font baseline.
33 // target font size = font size * ScaleParam.scale.
34 // target baseline = baseline - height * font size * ScaleParam.baselineShiftScale.
45 UNDEFINED, // undefined font, the typeface is null.
46 SYSTEM, // system font, need to be compressed.
47 CUSTOM, // custom font, doesn't need to be compressed.
49 // the font padding does not take effect for these font families.
59 // symbol: need to ensure "the symbol height = the font size".
65 FontCompressionStatus getFontCompressionStatus(const RSFont& font)
67 auto typeface = font.GetTypeface();
73 std::string getFamilyNameFromFont(const RSFont& font)
75 auto typeface = font.GetTypeface();
79 FontCompressionStatus getFontCompressionStatus(const SkFont& font)
81 auto typeface = font.refTypeface();
87 std::string getFamilyNameFromFont(const SkFont& font)
89 auto typeface = font.refTypeface();
100 const ScaleParam& findCompressionConfigWithFont(const RSFont& font)
102 const ScaleParam& findCompressionConfigWithFont(const SkFont& font)
105 auto fontCompressionStatus = getFontCompressionStatus(font);
112 std::string familyName = getFamilyNameFromFont(font);
121 void metricsIncludeFontPadding(RSFontMetrics* metrics, const RSFont& font)
123 void metricsIncludeFontPadding(SkFontMetrics* metrics, const SkFont& font)
129 auto fontCompressionStatus = getFontCompressionStatus(font);
134 SkScalar fontSize = font.GetSize();
136 SkScalar fontSize = font.getSize();
140 !SkScalarNearlyZero(findCompressionConfigWithFont(font).fontScale)) {
147 std::string curFamilyName = getFamilyNameFromFont(font);
163 void scaleFontWithCompressionConfig(RSFont& font, ScaleOP op)
165 SkScalar fontSize = font.GetSize();
167 void scaleFontWithCompressionConfig(SkFont& font, ScaleOP op)
169 SkScalar fontSize = font.getSize();
171 auto config = findCompressionConfigWithFont(font);
186 font.SetSize(fontSize);
188 font.setSize(fontSize);
643 SkFont Cluster::font() const {
645 RSFont Cluster::font() const {
648 return fOwner->run(fRunIndex).font();