Expand description
utilities shared by various backends Code useful for multiple backends
Structs§
- Layout
Defaults - A type backends can use to represent the default values for a
TextLayout
Constants§
- DEFAULT_
FONT_ SIZE - The default point size for text in piet.
- DEFAULT_
TEXT_ COLOR - The default foreground text color.
Functions§
- compute_
blurred_ rect - Generate image for a blurred rect, writing it into the provided buffer.
- count_
until_ utf16 - returns utf8 text position (code unit offset) at the given utf-16 text position
- count_
utf16 - Counts the number of utf-16 code units in the given string. from xi-editor
- expected_
image_ buffer_ size - Returns the number of bytes needed to be read from the image buffer.
- first_
strong_ rtl - A heurstic for text direction.
- image_
buffer_ to_ tightly_ packed - Converts an image buffer to a tightly packed owned buffer.
- line_
number_ for_ position - Returns the index of the line containing this utf8 position, or the last line index if the position is out of bounds.
- resolve_
range - Resolves a
RangeBounds
into a range in the range 0..len. - size_
for_ blurred_ rect - Calculate the size required paint a blurred rect.
- trailing_
nlf - If this string ends in a newline function (NLF) (5.8), return the length of the NLF in bytes.
- unpremul
- If
x
is a single (non-alpha) channel of a premultiplied color anda
is the alpha channel, returns the corresponding channel of the unpremultiplied version of the color. - unpremultiply_
rgba - Takes a buffer of premultiplied RGBA pixels and unpremultiplies them in place.