Vivid.Font.Char (vivid v0.4.5)

Copy Markdown View Source

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()

@type t() :: %Vivid.Font.Char{
  character: term(),
  coordinates: term(),
  left_pos: term(),
  right_pos: term(),
  vertices: term()
}

Functions

left_pad(char, scale \\ 1.0)

@spec left_pad(t(), number()) :: number()

Returns the left padding specified for this character.

rendered_height(char, scale \\ 1.0)

@spec rendered_height(t(), number()) :: number()

Rendered height of a character.

rendered_width(char, scale \\ 1.0)

@spec rendered_width(t(), number()) :: number()

Rendered width of a character.

right_pad(char, scale \\ 1.0)

@spec right_pad(t(), number()) :: number()

Returns the right padding specified for this character.

to_shape(char, center, scale \\ 1.0)

@spec to_shape(t(), Vivid.Point.t(), number()) :: Vivid.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)

@spec width(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.