bmfont v0.1.0 BMFont

Parses text and binary BMFont files in accordance with the AngelCode spec.

Everything is kept pretty much as is, with the exception of some of the fields being renamed to their longer forms.

Link to this section Summary

Functions

Parse a BMFont file format, supports both text and binary versions.

Link to this section Types

Link to this type

t()

t() :: %BMFont{
  chars: [
    %BMFont.Char{
      channel: term(),
      height: term(),
      id: term(),
      page: term(),
      width: term(),
      x: term(),
      xadvance: term(),
      xoffset: term(),
      y: term(),
      yoffset: term()
    }
  ],
  common: %BMFont.Common{
    alpha_channel: term(),
    base: term(),
    blue_channel: term(),
    green_channel: term(),
    height: term(),
    line_height: term(),
    packed: term(),
    pages: term(),
    red_channel: term(),
    width: term()
  },
  info: %BMFont.Info{
    bold: term(),
    charset: term(),
    face: term(),
    italic: term(),
    outline: term(),
    padding: term(),
    size: term(),
    smooth: term(),
    spacing: term(),
    stretch_height: term(),
    supersampling: term(),
    unicode: term()
  },
  kernings: [%BMFont.Kerning{amount: term(), first: term(), second: term()}],
  pages: [%BMFont.Page{file: term(), id: term()}]
}

Link to this section Functions

Link to this function

parse(data)

parse(binary() | [String.t()]) :: t()

Parse a BMFont file format, supports both text and binary versions.

The parse/1 function can be passed either the binary data, the entire string, or an enumerable with the separate lines of text.