Helper class for constructing SkTextBlob.
RunBuffer supplies storage for Glyphs and positions within a run.
A run is a sequence of Glyphs sharing Font_Metrics and positioning. Each run may position its Glyphs in one of three ways: by specifying where the first Glyph is drawn, and allowing Font_Metrics to determine the advance to subsequent Glyphs; by specifying a baseline, and the position on that baseline for each Glyph in run; or by providing Point array, one per Glyph.
allocRun allocRunPos allocRunPosH
Constructs empty SkTextBlobBuilder. By default, SkTextBlobBuilder has no runs.
empty SkTextBlobBuilder
blob equals nullptr
make SkTextBlob::MakeFromText
Deletes data allocated internally by SkTextBlobBuilder.
SkTextBlobBuilder()
Returns SkTextBlob built from runs of glyphs added by builder. Returned SkTextBlob is immutable; it may be copied, but its contents may not be altered. Returns nullptr if no runs of glyphs were added by builder.
Resets SkTextBlobBuilder to its initial empty state, allowing it to be reused to build a new set of runs.
SkTextBlob or nullptr
blob equals nullptr blob does not equal nullptr blob equals nullptr
SkTextBlob::MakeFromText
Returns run with storage for glyphs. Caller must write count glyphs to RunBuffer::glyphs before next call to SkTextBlobBuilder.
RunBuffer::utf8text, and RunBuffer::clusters should be ignored.
Glyphs share metrics in font.
Glyphs are positioned on a baseline at (x, y), using font metrics to determine their relative placement.
bounds defines an optional bounding box, used to suppress drawing when SkTextBlob bounds does not intersect SkSurface bounds. If bounds is nullptr, SkTextBlob bounds is computed from (x, y) and RunBuffer::glyphs metrics.
writable glyph buffer
allocRunPosH allocRunPos
Returns run with storage for glyphs and positions along baseline. Caller must write count glyphs to RunBuffer::glyphs, and count scalars to RunBuffer::pos; before next call to SkTextBlobBuilder.
RunBuffer::utf8text, and RunBuffer::clusters should be ignored.
Glyphs share metrics in font.
Glyphs are positioned on a baseline at y, using x-axis positions written by caller to RunBuffer::pos.
bounds defines an optional bounding box, used to suppress drawing when SkTextBlob bounds does not intersect SkSurface bounds. If bounds is nullptr, SkTextBlob bounds is computed from y, RunBuffer::pos, and RunBuffer::glyphs metrics.
writable glyph buffer and x-axis position buffer
allocRunPos allocRun
Returns run with storage for glyphs and SkPoint positions. Caller must write count glyphs to RunBuffer::glyphs, and count SkPoint to RunBuffer::pos; before next call to SkTextBlobBuilder.
RunBuffer::utf8text, and RunBuffer::clusters should be ignored.
Glyphs share metrics in font.
Glyphs are positioned using SkPoint written by caller to RunBuffer::pos, using two scalar values for each SkPoint.
bounds defines an optional bounding box, used to suppress drawing when SkTextBlob bounds does not intersect SkSurface bounds. If bounds is nullptr, SkTextBlob bounds is computed from RunBuffer::pos, and RunBuffer::glyphs metrics.
writable glyph buffer and SkPoint buffer
allocRunPosH allocRun