Documentation ¶
Overview ¶
Package ttf provides support for Allegro's TTF font addon.
Index ¶
- Constants
- func Install()
- func Installed() bool
- func LoadFont(filename string, size int, flags TtfFlags) (*font.Font, error)
- func LoadFontF(file *allegro.File, filename string, size int, flags TtfFlags) (*font.Font, error)
- func LoadFontStretch(filename string, w, h int, flags TtfFlags) (*font.Font, error)
- func LoadFontStretchF(file *allegro.File, filename string, w, h int, flags TtfFlags) (*font.Font, error)
- func Uninstall()
- func Version() (major, minor, revision, release uint8)
- type TtfFlags
Constants ¶
const ( TTF_NO_KERNING TtfFlags = C.ALLEGRO_TTF_NO_KERNING TTF_MONOCHROME = C.ALLEGRO_TTF_MONOCHROME TTF_NO_AUTOHINT = C.ALLEGRO_TTF_NO_AUTOHINT )
Variables ¶
This section is empty.
Functions ¶
func Install ¶
func Install()
Call this after al_init_font_addon to make al_load_font recognize ".ttf" and other formats supported by al_load_ttf_font.
See https://liballeg.org/a5docs/5.2.6/font.html#al_init_ttf_addon
func Installed ¶
func Installed() bool
Returns true if the TTF addon is initialized, otherwise returns false.
See https://liballeg.org/a5docs/5.2.6/font.html#al_is_ttf_addon_initialized
func LoadFont ¶
Loads a TrueType font from a file using the FreeType library. Quoting from the FreeType FAQ this means support for many different font formats:
See https://liballeg.org/a5docs/5.2.6/font.html#al_load_ttf_font
func LoadFontF ¶
Like al_load_ttf_font, but the font is read from the file handle. The filename is only used to find possible additional files next to a font file.
See https://liballeg.org/a5docs/5.2.6/font.html#al_load_ttf_font_f
func LoadFontStretch ¶
Like al_load_ttf_font, except it takes separate width and height parameters instead of a single size parameter.
See https://liballeg.org/a5docs/5.2.6/font.html#al_load_ttf_font_stretch
func LoadFontStretchF ¶
func LoadFontStretchF(file *allegro.File, filename string, w, h int, flags TtfFlags) (*font.Font, error)
Like al_load_ttf_font_stretch, but the font is read from the file handle. The filename is only used to find possible additional files next to a font file.
See https://liballeg.org/a5docs/5.2.6/font.html#al_load_ttf_font_stretch_f
func Uninstall ¶
func Uninstall()
Unloads the ttf addon again. You normally don't need to call this.
See https://liballeg.org/a5docs/5.2.6/font.html#al_shutdown_ttf_addon
func Version ¶
func Version() (major, minor, revision, release uint8)
Returns the (compiled) version of the addon, in the same format as al_get_allegro_version.
See https://liballeg.org/a5docs/5.2.6/font.html#al_get_allegro_ttf_version