|
static sk_sp< SkTextBlob > | MakeFromText (const void *text, size_t byteLength, const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8) |
|
static sk_sp< SkTextBlob > | MakeFromString (const char *string, const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8) |
|
static sk_sp< SkTextBlob > | MakeFromPosTextH (const void *text, size_t byteLength, const SkScalar xpos[], SkScalar constY, const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8) |
|
static sk_sp< SkTextBlob > | MakeFromPosText (const void *text, size_t byteLength, const SkPoint pos[], const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8) |
|
static sk_sp< SkTextBlob > | MakeFromRSXform (const void *text, size_t byteLength, const SkRSXform xform[], const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8) |
|
static sk_sp< SkTextBlob > | Deserialize (const void *data, size_t size, const SkDeserialProcs &procs) |
|
SkTextBlob combines multiple text runs into an immutable container. Each text run consists of glyphs, SkPaint, and position. Only parts of SkPaint related to fonts and text rendering are used by run.
Definition at line 41 of file SkTextBlob.h.
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.
- Parameters
-
data | pointer for serial data |
size | size of data |
procs | custom serial data decoders; may be nullptr |
- Returns
- SkTextBlob constructed from data in memory
Definition at line 855 of file SkTextBlob.cpp.
856 {
858 buffer.setDeserialProcs(procs);
860}
static sk_sp< SkTextBlob > MakeFromBuffer(SkReadBuffer &)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
std::shared_ptr< const fml::Mapping > data
Creates SkTextBlob with a single run. string meaning depends on SkTextEncoding; by default, string is encoded as UTF-8.
font contains attributes used to define the run text.
When encoding is SkTextEncoding::kUTF8, SkTextEncoding::kUTF16, or SkTextEncoding::kUTF32, this function uses the default character-to-glyph mapping from the SkTypeface in font. It does not perform typeface fallback for characters not found in the SkTypeface. It does not perform kerning or other complex shaping; glyphs are positioned based on their default advances.
- Parameters
-
string | character code points or glyphs drawn |
font | text size, typeface, text scale, and so on, used to draw |
encoding | text encoding used in the text array |
- Returns
- SkTextBlob constructed from one run
Definition at line 115 of file SkTextBlob.h.
116 {
117 if (!string) {
118 return nullptr;
119 }
121 }
static sk_sp< SkTextBlob > MakeFromText(const void *text, size_t byteLength, const SkFont &font, SkTextEncoding encoding=SkTextEncoding::kUTF8)
size_t SkTextBlob::serialize |
( |
const SkSerialProcs & |
procs, |
|
|
void * |
memory, |
|
|
size_t |
memory_size |
|
) |
| const |
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.
- Parameters
-
procs | custom serial data encoders; may be nullptr |
memory | storage for data |
memory_size | size of storage |
- Returns
- bytes written, or zero if required storage is larger than memory_size
example: https://fiddle.skia.org/c/@TextBlob_serialize
Definition at line 864 of file SkTextBlob.cpp.
864 {
867 return buffer.usingInitialStorage() ?
buffer.bytesWritten() : 0u;
868}