Documentation
¶
Index ¶
- Constants
- Variables
- func Marshal(fnt *opentype.Font, options *opentype.FaceOptions, codepoints string) ([]byte, error)
- type Glyph
- type Glyphs
- func (gs Glyphs) AsImage() (_ *image.RGBA, tileSize image.Point, _ error)
- func (gs Glyphs) AsImageOutline(strokeWidth float32) (_ *image.RGBA, tileSize image.Point, _ error)
- func (gs Glyphs) AsTexture() (glen.TextureFont, error)
- func (gs Glyphs) AsTextureFromImage(img *image.RGBA, tileSize image.Point) (glen.TextureFont, error)
- func (gs Glyphs) AsTextureOutline(strokeWidth float32) (glen.TextureFont, error)
Constants ¶
View Source
const ASCII = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
ASCII defines all ascii characters.
View Source
const Magic = "FNCV"
View Source
const MagicSDF = "FSDF"
Variables ¶
View Source
var InvalidBinary = fmt.Errorf("fntconv: invalid binary")
Functions ¶
Types ¶
type Glyphs ¶
type Glyphs struct {
Glyphs []Glyph
MaxAdvance fixed.Int26_6
PPEM fixed.Int26_6
Ascent fixed.Int26_6
Height fixed.Int26_6
// contains filtered or unexported fields
}
func Unmarshal ¶
Unmarshal decodes a binary font representation into a Glyphs structure, returning an error if the format is invalid.
func (Glyphs) AsImage ¶
AsImage converts a serialized binary font representation into an image.Image, arranging glyphs in a grid layout.
func (Glyphs) AsImageOutline ¶
AsImageOutline converts glyphs into an image with outlined (stroked) glyphs instead of filled.
func (Glyphs) AsTextureFromImage ¶
func (Glyphs) AsTextureOutline ¶
func (gs Glyphs) AsTextureOutline(strokeWidth float32) (glen.TextureFont, error)
Click to show internal directories.
Click to hide internal directories.