View Source Vivid.Font.Char (vivid v0.4.4)

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

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

Functions

Link to this function

left_pad(char, scale \\ 1.0)

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

Returns the left padding specified for this character.

Link to this function

rendered_height(char, scale \\ 1.0)

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

Rendered height of a character.

Link to this function

rendered_width(char, scale \\ 1.0)

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

Rendered width of a character.

Link to this function

right_pad(char, scale \\ 1.0)

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

Returns the right padding specified for this character.

Link to this function

to_shape(char, center, scale \\ 1.0)

View Source
@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.
Link to this function

width(char, scale \\ 1.0)

View Source
@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.