class SkFontPriv { public: /* This is the size we use when we ask for a glyph's path. We then * post-transform it as we draw to match the request. * This is done to try to re-use cache entries for the path. * * This value is somewhat arbitrary. In theory, it could be 1, since * we store paths as floats. However, we get the path from the font * scaler, and it may represent its paths as fixed-point (or 26.6), * so we shouldn't ask for something too big (might overflow 16.16) * or too small (underflow 26.6). * * This value could track kMaxSizeForGlyphCache, assuming the above * constraints, but since we ask for unhinted paths, the two values * need not match per-se.
*/ inlinestatic constexpr int kCanonicalTextSizeForPaths = 64;
/** * Return a matrix that applies the paint's text values: size, scale, skew
*/ static SkMatrix MakeTextMatrix(SkScalar size, SkScalar scaleX, SkScalar skewX) {
SkMatrix m = SkMatrix::Scale(size * scaleX, size); if (skewX) {
m.postSkew(skewX, 0);
} return m;
}
/** 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 }.
@return union of bounds of all glyphs
*/ static SkRect GetFontBounds(const SkFont&);
/** Return the approximate largest dimension of typical text when transformed by the matrix. * * @param matrix used to transform size * @param textLocation location of the text prior to matrix transformation. Used if the * matrix has perspective. * @return typical largest dimension
*/ static SkScalar ApproximateTransformedTextSize(const SkFont& font, const SkMatrix& matrix, const SkPoint& textLocation);
// Returns the number of elements (characters or glyphs) in the array. staticint CountTextElements(constvoid* text, size_t byteLength, SkTextEncoding);
staticvoid GlyphsToUnichars(const SkFont&, const uint16_t glyphs[], int count, SkUnichar[]);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.