vivid v0.4.2 Vivid.Font.Char View Source

Describes an individual character defined by a Hershey font file.

Link to this section 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

Link to this section Types

Link to this section Functions

Link to this function left_pad(char, scale \\ 1.0) View Source
left_pad(Vivid.Font.Char.t, number) :: number

Returns the left padding specified for this character.

Link to this function rendered_height(char, scale \\ 1.0) View Source
rendered_height(Vivid.Font.Char.t, number) :: number

Rendered height of a character.

Link to this function rendered_width(char, scale \\ 1.0) View Source
rendered_width(Vivid.Font.Char.t, number) :: number

Rendered width of a character.

Link to this function right_pad(char, scale \\ 1.0) View Source
right_pad(Vivid.Font.Char.t, number) :: number

Returns the right padding specified for this character.

Link to this function to_shape(char, center, scale \\ 1.0) View Source
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.
Link to this function width(char, scale \\ 1.0) View Source
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.