Flutter Engine
The Flutter Engine
|
#include <SkTextBlob.h>
Classes | |
struct | RunBuffer |
Public Member Functions | |
SkTextBlobBuilder () | |
~SkTextBlobBuilder () | |
sk_sp< SkTextBlob > | make () |
const RunBuffer & | allocRun (const SkFont &font, int count, SkScalar x, SkScalar y, const SkRect *bounds=nullptr) |
const RunBuffer & | allocRunPosH (const SkFont &font, int count, SkScalar y, const SkRect *bounds=nullptr) |
const RunBuffer & | allocRunPos (const SkFont &font, int count, const SkRect *bounds=nullptr) |
const RunBuffer & | allocRunRSXform (const SkFont &font, int count) |
const RunBuffer & | allocRunText (const SkFont &font, int count, SkScalar x, SkScalar y, int textByteCount, const SkRect *bounds=nullptr) |
const RunBuffer & | allocRunTextPosH (const SkFont &font, int count, SkScalar y, int textByteCount, const SkRect *bounds=nullptr) |
const RunBuffer & | allocRunTextPos (const SkFont &font, int count, int textByteCount, const SkRect *bounds=nullptr) |
const RunBuffer & | allocRunTextRSXform (const SkFont &font, int count, int textByteCount, const SkRect *bounds=nullptr) |
Friends | |
class | SkTextBlobPriv |
class | SkTextBlobBuilderPriv |
Helper class for constructing SkTextBlob.
Definition at line 290 of file SkTextBlob.h.
SkTextBlobBuilder::SkTextBlobBuilder | ( | ) |
Constructs empty SkTextBlobBuilder. By default, SkTextBlobBuilder has no runs.
example: https://fiddle.skia.org/c/@TextBlobBuilder_empty_constructor
Definition at line 258 of file SkTextBlob.cpp.
SkTextBlobBuilder::~SkTextBlobBuilder | ( | ) |
Deletes data allocated internally by SkTextBlobBuilder.
Definition at line 267 of file SkTextBlob.cpp.
const SkTextBlobBuilder::RunBuffer & SkTextBlobBuilder::allocRun | ( | const SkFont & | font, |
int | count, | ||
SkScalar | x, | ||
SkScalar | y, | ||
const SkRect * | bounds = nullptr |
||
) |
Returns run with storage for glyphs. Caller must write count glyphs to RunBuffer::glyphs before next call to SkTextBlobBuilder.
RunBuffer::pos, 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.
font | SkFont used for this run |
count | number of glyphs |
x | horizontal offset within the blob |
y | vertical offset within the blob |
bounds | optional run bounding box |
Definition at line 539 of file SkTextBlob.cpp.
const SkTextBlobBuilder::RunBuffer & SkTextBlobBuilder::allocRunPos | ( | const SkFont & | font, |
int | count, | ||
const SkRect * | bounds = nullptr |
||
) |
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.
font | SkFont used for this run |
count | number of glyphs |
bounds | optional run bounding box |
Definition at line 553 of file SkTextBlob.cpp.
const SkTextBlobBuilder::RunBuffer & SkTextBlobBuilder::allocRunPosH | ( | const SkFont & | font, |
int | count, | ||
SkScalar | y, | ||
const SkRect * | bounds = nullptr |
||
) |
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.
font | SkFont used for this run |
count | number of glyphs |
y | vertical offset within the blob |
bounds | optional run bounding box |
Definition at line 546 of file SkTextBlob.cpp.
const SkTextBlobBuilder::RunBuffer & SkTextBlobBuilder::allocRunRSXform | ( | const SkFont & | font, |
int | count | ||
) |
Definition at line 560 of file SkTextBlob.cpp.
const SkTextBlobBuilder::RunBuffer & SkTextBlobBuilder::allocRunText | ( | const SkFont & | font, |
int | count, | ||
SkScalar | x, | ||
SkScalar | y, | ||
int | textByteCount, | ||
const SkRect * | bounds = nullptr |
||
) |
Returns run with storage for glyphs, text, and clusters. Caller must write count glyphs to RunBuffer::glyphs, textByteCount UTF-8 code units into RunBuffer::utf8text, and count monotonic indexes into utf8text into RunBuffer::clusters before next call to SkTextBlobBuilder.
RunBuffer::pos 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.
font | SkFont used for this run |
count | number of glyphs |
x | horizontal offset within the blob |
y | vertical offset within the blob |
textByteCount | number of UTF-8 code units |
bounds | optional run bounding box |
Definition at line 565 of file SkTextBlob.cpp.
const SkTextBlobBuilder::RunBuffer & SkTextBlobBuilder::allocRunTextPos | ( | const SkFont & | font, |
int | count, | ||
int | textByteCount, | ||
const SkRect * | bounds = nullptr |
||
) |
Returns run with storage for glyphs, SkPoint positions, text, and clusters. Caller must write count glyphs to RunBuffer::glyphs, count SkPoint to RunBuffer::pos, textByteCount UTF-8 code units into RunBuffer::utf8text, and count monotonic indexes into utf8text into RunBuffer::clusters before next call to SkTextBlobBuilder.
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.
font | SkFont used for this run |
count | number of glyphs |
textByteCount | number of UTF-8 code units |
bounds | optional run bounding box |
Definition at line 592 of file SkTextBlob.cpp.
const SkTextBlobBuilder::RunBuffer & SkTextBlobBuilder::allocRunTextPosH | ( | const SkFont & | font, |
int | count, | ||
SkScalar | y, | ||
int | textByteCount, | ||
const SkRect * | bounds = nullptr |
||
) |
Returns run with storage for glyphs, positions along baseline, text, and clusters. Caller must write count glyphs to RunBuffer::glyphs, count scalars to RunBuffer::pos, textByteCount UTF-8 code units into RunBuffer::utf8text, and count monotonic indexes into utf8text into RunBuffer::clusters before next call to SkTextBlobBuilder.
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.
font | SkFont used for this run |
count | number of glyphs |
y | vertical offset within the blob |
textByteCount | number of UTF-8 code units |
bounds | optional run bounding box |
Definition at line 578 of file SkTextBlob.cpp.
const SkTextBlobBuilder::RunBuffer & SkTextBlobBuilder::allocRunTextRSXform | ( | const SkFont & | font, |
int | count, | ||
int | textByteCount, | ||
const SkRect * | bounds = nullptr |
||
) |
Definition at line 604 of file SkTextBlob.cpp.
sk_sp< SkTextBlob > SkTextBlobBuilder::make | ( | ) |
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.
example: https://fiddle.skia.org/c/@TextBlobBuilder_make
Definition at line 617 of file SkTextBlob.cpp.
|
friend |
Definition at line 505 of file SkTextBlob.h.
|
friend |
Definition at line 504 of file SkTextBlob.h.