SkTextBlob combines multiple text runs into an immutable container. Each text run consists of Glyphs, Paint, and position. Only parts of Paint related to fonts and text rendering are used by run.
Returns conservative bounding box. Uses SkPaint associated with each glyph to determine glyph bounds, and unions all bounds. Returned bounds may be larger than the bounds of all glyphs in runs.
conservative bounding box
SkPath::getBounds
Returns a non-zero value unique among all text blobs.
identifier for SkTextBlob
SkRefCnt
Creates Text Blob with a single run. text meaning depends on Paint Text Encoding; by default, text is encoded as UTF-8.
font contains attributes used to define the run text: Typeface, Paint Text Size, Paint Text Scale X, Paint Text Skew X, Paint Hinting, Anti Alias, Paint Fake Bold, Font Embedded Bitmaps, Full Hinting Spacing, LCD Text, Linear Text, and Subpixel Text.
Text Blob constructed from one run
MakeFromString TextBlobBuilder
Creates Text Blob with a single run. string meaning depends on Paint Text Encoding; by default, string is encoded as UTF-8.
font contains Paint Font Metrics used to define the run text: Typeface, Paint Text Size, Paint Text Scale X, Paint Text Skew X, Paint Hinting, Anti Alias, Paint Fake Bold, Font Embedded Bitmaps, Full Hinting Spacing, LCD Text, Linear Text, and Subpixel Text.
Text Blob constructed from one run
MakeFromText TextBlobBuilder
Writes data to allow later reconstruction of SkTextBlob. memory points to storage to receive the encoded data, and memory_size describes the size of storage. Returns bytes used if provided storage is large enough to hold all data; otherwise, returns zero.
procs.fTypefaceProc permits supplying a custom function to encode SkTypeface. If procs.fTypefaceProc is nullptr, default encoding is used. procs.fTypefaceCtx may be used to provide user context to procs.fTypefaceProc; procs.fTypefaceProc is called with a pointer to SkTypeface and user context.
bytes written, or zero if required storage is larger than memory_size
Deserialize SkSerialProcs
Returns storage containing SkData describing SkTextBlob, using optional custom encoders.
procs.fTypefaceProc permits supplying a custom function to encode SkTypeface. If procs.fTypefaceProc is nullptr, default encoding is used. procs.fTypefaceCtx may be used to provide user context to procs.fTypefaceProc; procs.fTypefaceProc is called with a pointer to SkTypeface and user context.
storage containing serialized SkTextBlob
Deserialize SkData SkSerialProcs
Recreates SkTextBlob that was serialized into data. Returns constructed SkTextBlob if successful; otherwise, returns nullptr. Fails if size is smaller than required data length, or if data does not permit constructing valid SkTextBlob.
procs.fTypefaceProc permits supplying a custom function to decode SkTypeface. If procs.fTypefaceProc is nullptr, default decoding is used. procs.fTypefaceCtx may be used to provide user context to procs.fTypefaceProc; procs.fTypefaceProc is called with a pointer to SkTypeface data, data byte length, and user context.
SkTextBlob constructed from data in memory
serialize[2] SkDeserialProcs