vivid v0.4.1 Vivid.Font.Char

Describes an individual character defined by a Hershey font file.

Summary

Functions

Returns the left padding specified for this character

Rendered height of a character

Rendered width of a character

Returns the right padding specified for this character

Convert a %Char{} into a shape which can be rendered

Returns the (documented) width of a specific character. This is not the maximum width of the character, as some go beyond or don’t reach their documented bounds. I assume this is for kerning. I may be wrong

Types

t()
t

Functions

left_pad(char, scale \\ 1.0)
left_pad(Vivid.Font.Char.t, number) :: number

Returns the left padding specified for this character.

rendered_height(char, scale \\ 1.0)
rendered_height(Vivid.Font.Char.t, number) :: number

Rendered height of a character.

rendered_width(char, scale \\ 1.0)
rendered_width(Vivid.Font.Char.t, number) :: number

Rendered width of a character.

right_pad(char, scale \\ 1.0)
right_pad(Vivid.Font.Char.t, number) :: number

Returns the right padding specified for this character.

to_shape(char, center, scale \\ 1.0)
to_shape(Vivid.Font.Char.t, Vivid.Point.t, number) :: Shape.t

Convert a %Char{} into a shape which can be rendered.

  • char is a %Char{} struct.
  • center the center %Point{} around which to render the character.
  • scale how much to scale the character by.
width(char, scale \\ 1.0)
width(Vivid.Font.Char.t, number) :: number

Returns the (documented) width of a specific character. This is not the maximum width of the character, as some go beyond or don’t reach their documented bounds. I assume this is for kerning. I may be wrong.