Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder reads and decodes a font from an input stream.
func NewDecoder ¶
NewDecoder returns a new decoder that reads from r.
type Font ¶
type Font struct { BaseAdvanceWidth uint16 // LineHeight is the total height of each line in the font. This can be used // for rendering text over multiple lines. // For example, F_BOOKS.FNT has a line height of 14 pixels. LineHeight uint32 // The BaseAdvanceHeight is the amount of pixels to advance when rendering a // new line of text. If this is set to 0 then the bottoms of glyphs will // touch the tops of glyphs from the following line. BaseAdvanceHeight uint16 // TODO Height2 uint16 Unknown1 uint16 Glyphs []*Glyph // contains filtered or unexported fields }
type Glyph ¶
type Glyph struct { // Type provides information about how to interpret the glyph image. Type GlyphType // Image is the decoded glyph data converted into an image.Image. Image image.Image // The AdvanceWidth of the glyph. After the glyph is rendered, the start of // the next glyph is offset on the x-axis from the current glyph origin by // this amount, plus the base advance width found in Font.BaseAdvanceWidth. // This is always less than or equal to the width of the glyph. It is the // offset on the x-axis to move the current point to the start of the next // glyph. AdvanceWidth uint16 // TODO: Both of these affect vertical/y-axis positioning when rendering. Unknown1 uint8 Unknown2 uint8 }
Click to show internal directories.
Click to hide internal directories.