56 {
57
61
66
69
74
75 const char*
text = sample.sampleText;
77
78 for (
SkScalar textSize : { 70, 150 }) {
79 font.setSize(textSize);
80 font.getMetrics(&metrics);
81
82 font.setSubpixel(
true);
83
85
87 for (bool fakeBold : { false, true }) {
88 font.setEmbolden(fakeBold);
94 if ((false)) {
98 canvas->
drawRect(advanceRect, advancePaint);
99 }
101 }
104 }
105 }
106 }
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorGRAY
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
@ kUTF8
uses bytes to represent UTF-8 or ASCII
void drawRect(const SkRect &rect, const SkPaint &paint)
void drawSimpleText(const void *text, size_t byteLength, SkTextEncoding encoding, SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
@ kAlias
no transparent pixels on glyph edges
void setStyle(Style style)
void setColor(SkColor color)
@ kStroke_Style
set to stroke geometry
void setStrokeWidth(SkScalar width)
ToolUtils::EmojiTestSample fontSamples[std::size(formatsToTest)]
Optional< SkRect > bounds
font
Font Metadata and Metrics.
SkScalar fLeading
distance to add between lines, typically positive or zero
SkScalar fAscent
distance to reserve above baseline, typically negative
SkScalar fDescent
distance to reserve below baseline, typically positive
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)