[][src]Module piet::util

utilities shared by various backends Code useful for multiple backends

Structs

LayoutDefaults

A type backends can use to represent the default values for a TextLayout

Constants

DEFAULT_FONT_SIZE

The default point sie 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

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