#include <SkFontPriv.h>
|
static SkMatrix | MakeTextMatrix (SkScalar size, SkScalar scaleX, SkScalar skewX) |
|
static SkMatrix | MakeTextMatrix (const SkFont &font) |
|
static void | ScaleFontMetrics (SkFontMetrics *, SkScalar) |
|
static SkRect | GetFontBounds (const SkFont &) |
|
static SkScalar | ApproximateTransformedTextSize (const SkFont &font, const SkMatrix &matrix, const SkPoint &textLocation) |
|
static bool | IsFinite (const SkFont &font) |
|
static int | CountTextElements (const void *text, size_t byteLength, SkTextEncoding) |
|
static void | GlyphsToUnichars (const SkFont &, const uint16_t glyphs[], int count, SkUnichar[]) |
|
static void | Flatten (const SkFont &, SkWriteBuffer &buffer) |
|
static bool | Unflatten (SkFont *, SkReadBuffer &buffer) |
|
static uint8_t | Flags (const SkFont &font) |
|
Definition at line 20 of file SkFontPriv.h.
◆ ApproximateTransformedTextSize()
Return the approximate largest dimension of typical text when transformed by the matrix.
- Parameters
-
matrix | used to transform size |
textLocation | location of the text prior to matrix transformation. Used if the matrix has perspective. |
- Returns
- typical largest dimension
Definition at line 366 of file SkFont.cpp.
367 {
368 if (!
matrix.hasPerspective()) {
370 } else {
371
375 } else {
376 return -
font.getSize();
377 }
378 }
379}
static bool SkIsFinite(T x, Pack... values)
static bool SkScalarNearlyZero(SkScalar x, SkScalar tolerance=SK_ScalarNearlyZero)
static SkScalar DifferentialAreaScale(const SkMatrix &m, const SkPoint &p)
unsigned useCenter Optional< SkMatrix > matrix
font
Font Metadata and Metrics.
◆ CountTextElements()
int SkFontPriv::CountTextElements |
( |
const void * |
text, |
|
|
size_t |
byteLength, |
|
|
SkTextEncoding |
encoding |
|
) |
| |
|
static |
Definition at line 381 of file SkFont.cpp.
381 {
382 switch (encoding) {
388 return byteLength >> 2;
390 return byteLength >> 1;
391 }
393 return 0;
394}
@ kUTF8
uses bytes to represent UTF-8 or ASCII
@ kUTF16
uses two byte words to represent most of Unicode
@ kUTF32
uses four byte words to represent all of Unicode
@ kGlyphID
uses two byte words to represent glyph indices
SK_SPI int CountUTF16(const uint16_t *utf16, size_t byteLength)
SK_SPI int CountUTF8(const char *utf8, size_t byteLength)
◆ Flags()
static uint8_t SkFontPriv::Flags |
( |
const SkFont & |
font | ) |
|
|
inlinestatic |
◆ Flatten()
Definition at line 48 of file SkFont_serial.cpp.
48 {
53
54 uint32_t packed = 0;
58
62 }
63 if (
font.fScaleX != 1) {
65 }
66 if (
font.fSkewX != 0) {
68 }
71 }
72
76 }
79 }
82 }
85 }
86}
static bool scalar_is_byte(SkScalar x)
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
◆ GetFontBounds()
Returns the union of bounds of all glyphs. Returned dimensions are computed by font manager from font data, ignoring SkPaint::Hinting. Includes font metrics, but not fake bold or SkPathEffect.
If text size is large, text scale is one, and text skew is zero, returns the bounds as: { SkFontMetrics::fXMin, SkFontMetrics::fTop, SkFontMetrics::fXMax, SkFontMetrics::fBottom }.
- Returns
- union of bounds of all glyphs
Definition at line 354 of file SkFont.cpp.
354 {
356 m.setScale(
font.getSize() *
font.getScaleX(),
font.getSize());
357 m.postSkew(
font.getSkewX(), 0);
358
360
364}
Optional< SkRect > bounds
◆ GlyphsToUnichars()
void SkFontPriv::GlyphsToUnichars |
( |
const SkFont & |
font, |
|
|
const uint16_t |
glyphs[], |
|
|
int |
count, |
|
|
SkUnichar |
text[] |
|
) |
| |
|
static |
Definition at line 396 of file SkFont.cpp.
397 {
399 return;
400 }
401
402 auto typeface =
font.getTypeface();
403 const unsigned numGlyphsInTypeface = typeface->countGlyphs();
405 typeface->getGlyphToUnicodeMap(unichars.get());
406
409 text[
i] = (
id < numGlyphsInTypeface) ? unichars[
id] : 0xFFFD;
410 }
411}
◆ IsFinite()
static bool SkFontPriv::IsFinite |
( |
const SkFont & |
font | ) |
|
|
inlinestatic |
◆ MakeTextMatrix() [1/2]
Definition at line 49 of file SkFontPriv.h.
49 {
51 }
static SkMatrix MakeTextMatrix(SkScalar size, SkScalar scaleX, SkScalar skewX)
◆ MakeTextMatrix() [2/2]
Return a matrix that applies the paint's text values: size, scale, skew
Definition at line 41 of file SkFontPriv.h.
41 {
43 if (skewX) {
45 }
47 }
static SkMatrix Scale(SkScalar sx, SkScalar sy)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
◆ ScaleFontMetrics()
Definition at line 336 of file SkFont.cpp.
336 {
352}
SkScalar fTop
greatest extent above origin of any glyph bounding box, typically negative; deprecated with variable ...
SkScalar fLeading
distance to add between lines, typically positive or zero
SkScalar fAvgCharWidth
average character width, zero if unknown
SkScalar fStrikeoutPosition
distance from baseline to bottom of stroke, typically negative
SkScalar fStrikeoutThickness
strikeout thickness
SkScalar fMaxCharWidth
maximum character width, zero if unknown
SkScalar fBottom
greatest extent below origin of any glyph bounding box, typically positive; deprecated with variable ...
SkScalar fAscent
distance to reserve above baseline, typically negative
SkScalar fXHeight
height of lower-case 'x', zero if unknown, typically negative
SkScalar fUnderlineThickness
underline thickness
SkScalar fDescent
distance to reserve below baseline, typically positive
SkScalar fCapHeight
height of an upper-case letter, zero if unknown, typically negative
SkScalar fXMin
greatest extent to left of origin of any glyph bounding box, typically negative; deprecated with vari...
SkScalar fUnderlinePosition
distance from baseline to top of stroke, typically positive
SkScalar fXMax
greatest extent to right of origin of any glyph bounding box, typically positive; deprecated with var...
◆ Unflatten()
Definition at line 88 of file SkFont_serial.cpp.
88 {
89 const uint32_t packed =
buffer.read32();
90
93 } else {
95 }
98 }
101 }
104 }
105
107
109
112 edging = 0;
113 }
115
118 hinting = 0;
119 }
121
123}
@ kFull
modifies glyph outlines for maximum constrast
constexpr uint8_t SkToU8(S x)
@ kSubpixelAntiAlias
glyph positioned in pixel using transparency
◆ kCanonicalTextSizeForPaths
constexpr int SkFontPriv::kCanonicalTextSizeForPaths = 64 |
|
inlinestaticconstexpr |
The documentation for this class was generated from the following files: