19 kUTF16_SkTextEncoding,
20 kUTF32_SkTextEncoding,
21 kGlyphID_SkTextEncoding,
108 kVertical_Flag = 1 << 4,
109 kGenA8FromLCD_Flag = 1 << 5,
110 kEmbolden_Flag = 1 << 6,
111 kDevKern_Flag = 1 << 7,
122 MaskType, uint32_t flags);
134 SkTypeface* getTypeface()
const {
return fTypeface.get(); }
135 SkScalar getSize()
const {
return fSize; }
136 SkScalar getScaleX()
const {
return fScaleX; }
137 SkScalar getSkewX()
const {
return fSkewX; }
138 uint32_t getFlags()
const {
return fFlags; }
139 MaskType getMaskType()
const {
return (MaskType)fMaskType; }
141 bool isVertical()
const {
return SkToBool(fFlags & kVertical_Flag); }
142 bool isEmbolden()
const {
return SkToBool(fFlags & kEmbolden_Flag); }
146 bool isDevKern()
const {
return SkToBool(fFlags & kDevKern_Flag); }
148 int textToGlyphs(
const void* text,
size_t byteLength, SkTextEncoding,
149 SkGlyphID glyphs[],
int maxGlyphCount)
const;
151 int countText(
const void* text,
size_t byteLength, SkTextEncoding encoding) {
152 return this->textToGlyphs(text, byteLength, encoding,
nullptr, 0);
155 SkScalar measureText(
const void* text,
size_t byteLength, SkTextEncoding)
const;
If the typeface contains explicit bitmaps for hinting, use them.
Definition: SkFont.h:95
uint16_t SkGlyphID
16 bit unsigned integer to hold a glyph index
Definition: SkTypes.h:299
sk_sp< SkFont > makeWithFlags(uint32_t newFlags) const
Return a font with the same attributes of this font, but with the flags.
Definition: SkRefCnt.h:125
The SkPaint class holds the style and color information about how to draw geometries, text and bitmaps.
Definition: SkPaint.h:45
Flags
Definition: SkFont.h:75
If the typeface contains explicit bytecodes for hinting, use them.
Definition: SkFont.h:88
#define SkToBool(cond)
Returns 0 or 1 based on the condition.
Definition: SkTypes.h:227
The SkTypeface class specifies the typeface and intrinsic style of a font.
Definition: SkTypeface.h:43
Shared pointer class to wrap classes that support a ref()/unref() interface.
Definition: SkRefCnt.h:246
sk_sp< SkFont > makeWithSize(SkScalar size) const
Return a font with the same attributes of this font, but with the specified size. ...
Use rounded metric values (e.g.
Definition: SkFont.h:106
Use the system's automatic hinting mechanism to hint the typeface.
Definition: SkFont.h:81