Font_Size adjusts the overall text size in points. Font_Size can be set to any positive value or zero. Font_Size defaults to 12. Font_Size
Font_Scale_X adjusts the text horizontal scale. Text scaling approximates condensed and expanded type faces when the actual face is not available. Font_Scale_X can be set to any value. Font_Scale_X defaults to 1.
Font_Skew_X adjusts the text horizontal slant. Text skewing approximates italic and oblique type faces when the actual face is not available. Font_Skew_X can be set to any value. Font_Skew_X defaults to 0.
Font_Embolden approximates the bold font style accompanying a normal font when a bold font face is not available. Skia does not provide font substitution; it is up to the client to find the bold font face using the platform Font_Manager.
Use Font_Skew_X to approximate an italic font style when the italic font face is not available.
A FreeType based port may define SK_USE_FREETYPE_EMBOLDEN at compile time to direct the font engine to create the bold Glyphs. Otherwise, the extra bold is computed by increasing the stroke width and setting the SkPaint::Style to SkPaint::kStrokeAndFill_Style as needed.
Font_Embolden is disabled by default.
If Hinting is set to SkFontHinting::kFull, Hinting_Spacing adjusts the character spacing by the difference of the hinted and unhinted Left_Side_Bearing and Right_Side_Bearing. Hinting_Spacing only applies to platforms that use FreeType as their Font_Engine.
Hinting_Spacing is not related to text kerning, where the space between a specific pair of characters is adjusted using data in the font kerning tables.
Font_Linear selects whether text is rendered as a Glyph or as a Path. If Font_Linear is set, it has the same effect as setting Hinting to SkFontHinting::kNormal. If Font_Linear is clear, it is the same as setting Hinting to SkFontHinting::kNone.
Font_Subpixel uses the pixel transparency to represent a fractional offset. As the opaqueness of the color increases, the edge of the glyph appears to move towards the outside of the pixel.
When set, Anti_Alias positions glyphs within a pixel, using alpha and possibly RGB striping. It can take advantage of the organization of RGB stripes that create a color, and relies on the small size of the stripe and visual perception to make the color fringing imperceptible.
Anti_Alias can be enabled on devices that orient stripes horizontally or vertically, and that order the color components as RGB or BGR. Internally, the glyph cache may store multiple copies of the same glyph with different sub-pixel positions, requiring more memory.
If Hinting is set to SkFontHinting::kNormal or SkFontHinting::kFull, Force_Hinting instructs the Font_Manager to always hint Glyphs. Force_Hinting has no effect if Hinting is set to SkFontHinting::kNone or SkFontHinting::kSlight.
Force_Hinting only affects platforms that use FreeType as the Font_Manager.
Embedded_Bitmaps allows selecting custom sized bitmap Glyphs. Embedded_Bitmaps when set chooses an embedded bitmap glyph over an outline contained in a font if the platform supports this option.
FreeType selects the bitmap glyph if available when Embedded_Bitmaps is set, and selects the outline glyph if Embedded_Bitmaps is clear. Windows may select the bitmap glyph but is not required to do so. OS_X and iOS do not support this option.
SkFont controls options applied when drawing and measuring text.
Whether edge pixels draw opaque or with partial transparency.
incomplete
Constructs SkFont with default values.
default initialized SkFont
incomplete
Constructs SkFont with default values with SkTypeface and size in points.
initialized SkFont
incomplete
Constructs SkFont with default values with SkTypeface and size in points, horizontal scale, and horizontal skew. Horizontal scale emulates condensed and expanded fonts. Horizontal skew emulates oblique fonts.
initialized SkFont
incomplete
Compares SkFont and font, and returns true if they are equivalent. May return false if SkTypeface has identical contents but different pointers.
true if SkFont pair are equivalent
incomplete
If true, instructs the font manager to always hint glyphs. Returned value is only meaningful if platform uses FreeType as the font manager.
true if all glyphs are hinted
incomplete
Returns true if font engine may return glyphs from font bitmaps instead of from outlines.
true if glyphs may be font bitmaps
incomplete
Returns true if glyphs at different sub-pixel positions may differ on pixel edge coverage.
true if glyph positioned in pixel using transparency
incomplete
Returns true if text is converted to SkPath before drawing and measuring.
true glyph hints are never applied
incomplete
Returns true if bold is approximated by increasing the stroke width when creating glyph bitmaps from outlines.
bold is approximated through stroke width
incomplete
Sets whether to always hint glyphs. If forceAutoHinting is set, instructs the font manager to always hint glyphs.
Only affects platforms that use FreeType as the font manager.
incomplete
Requests, but does not require, to use bitmaps in fonts instead of outlines.
incomplete
Requests, but does not require, that glyphs respect sub-pixel positioning.
incomplete
Requests, but does not require, that glyphs are converted to SkPath before drawing and measuring.
incomplete
Increases stroke width when creating glyph bitmaps to approximate a bold typeface.
incomplete
Whether edge pixels draw opaque or with partial transparency.
one of: Edging::kAlias, Edging::kAntiAlias, Edging::kSubpixelAntiAlias
incomplete
Requests, but does not require, that edge pixels draw opaque or with partial transparency.
incomplete
Sets level of glyph outline adjustment. Does not check for valid values of hintingLevel.
SkFontHinting::kNormal, SkFontHinting::kFull
incomplete
Returns level of glyph outline adjustment.
one of: SkFontHinting::kNone, SkFontHinting::kSlight, SkFontHinting::kNormal,
SkFontHinting::kFull
incomplete
Returns a font with the same attributes of this font, but with the specified size. Returns nullptr if size is less than zero, infinite, or NaN.
initialized SkFont
incomplete
Returns SkTypeface if set, or nullptr. Does not alter SkTypeface SkRefCnt.
SkTypeface if previously set, nullptr otherwise
incomplete
Returns text size in points.
typographic height of text
incomplete
Returns text scale on x-axis. Default value is 1.
text horizontal scale
incomplete
Returns text skew on x-axis. Default value is zero.
additional shear on x-axis relative to y-axis
incomplete
Increases SkTypeface SkRefCnt by one.
SkTypeface if previously set, nullptr otherwise
incomplete
Sets SkTypeface to typeface, decreasing SkRefCnt of the previous SkTypeface. Pass nullptr to clear SkTypeface and use the default typeface. Increments tf SkRefCnt by one.
incomplete
Sets text size in points. Has no effect if textSize is not greater than or equal to zero.
incomplete
Sets text scale on x-axis. Default value is 1.
incomplete
Sets text skew on x-axis. Default value is zero.
incomplete
Converts text into glyph indices. Returns the number of glyph indices represented by text. SkTextEncoding specifies how text represents characters or glyphs. glyphs may be nullptr, to compute the glyph count.
Does not check text for valid character codes or valid glyph indices.
If byteLength equals zero, returns zero. If byteLength includes a partial character, the partial character is ignored.
If encoding is SkTextEncoding::kUTF8 and text contains an invalid UTF-8 sequence, zero is returned.
If maxGlyphCount is not sufficient to store all the glyphs, no glyphs are copied. The total glyph count is returned for subsequent buffer reallocation.
SkTextEncoding::kUTF32, SkTextEncoding::kGlyphID
number of glyphs represented by text of length byteLength
incomplete
Returns glyph index for Unicode character.
glyph index
incomplete
Returns number of glyphs represented by text.
SkTextEncoding::kUTF32, SkTextEncoding::kGlyphID
number of glyphs represented by text of length byteLength
incomplete
Returns true if all text corresponds to a non-zero glyph index. Returns false if any characters in text are not supported in SkTypeface.
If SkTextEncoding is SkTextEncoding::kGlyphID, returns true if all glyph indices in text are non-zero; does not check to see if text contains valid glyph indices for SkTypeface.
Returns true if byteLength is zero.
true if all text corresponds to a non-zero glyph index
incomplete
Returns the bytes of text that fit within maxWidth. The text fragment fits if its advance width is less than or equal to maxWidth. Measures only while the advance is less than or equal to maxWidth. Returns the advance or the text fragment in measuredWidth if it not nullptr. Uses encoding to decode text, SkTypeface to get the font metrics, and text size to scale the metrics. Does not scale the advance or bounds by fake bold.
bytes of text that fit, always less than or equal to length
incomplete
Returns the advance width of text. The advance is the normal distance to move before drawing additional text. Returns the bounding box of text if bounds is not nullptr.
SkTextEncoding::kUTF32, SkTextEncoding::kGlyphID
number of glyphs represented by text of length byteLength
incomplete
Returns path corresponding to glyph outline. If glyph has an outline, copies outline to path and returns true. path returned may be empty. If glyph is described by a bitmap, returns false and ignores path parameter.
true if glyphID is described by path
incomplete
Returns path corresponding to glyph array.
incomplete
Returns SkFontMetrics associated with SkTypeface. The return value is the recommended spacing between lines: the sum of metrics descent, ascent, and leading. If metrics is not nullptr, SkFontMetrics is copied to metrics. Results are scaled by text size but does not take into account dimensions required by text scale, text skew, fake bold, style stroke, and SkPathEffect.
recommended spacing between lines
incomplete
Returns the recommended spacing between lines: the sum of metrics descent, ascent, and leading. Result is scaled by text size but does not take into account dimensions required by stroking and SkPathEffect. Returns the same result as getMetrics().
recommended spacing between lines
incomplete