ttf

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetError

func GetError() error

func Init

func Init() error

func Quit

func Quit()

func RenderUTF8Blended

func RenderUTF8Blended(font *Font, text string, fg sdl.Color) (*sdl.Surface, error)

func WasInit

func WasInit() bool

Types

type Destroyable

type Destroyable interface {
	Destroy()
}

type Font

type Font C.struct_TTF_Font

func OpenFont

func OpenFont(file string, size int) (*Font, error)

func OpenFontIndex

func OpenFontIndex(file string, size int, index int) (*Font, error)

func OpenFontRW

func OpenFontRW(src *sdl.RWOps, freeSrc bool, size int) (*Font, error)

func (*Font) Ascent

func (f *Font) Ascent() int

func (*Font) Close

func (f *Font) Close()

func (*Font) Descent

func (f *Font) Descent() int

func (*Font) FaceFamilyName

func (f *Font) FaceFamilyName() string

func (*Font) FaceIsFixedWidth

func (f *Font) FaceIsFixedWidth() bool

func (*Font) FaceStyleName

func (f *Font) FaceStyleName() string

func (*Font) Faces

func (f *Font) Faces() int

func (*Font) GlyphIsProvided

func (f *Font) GlyphIsProvided(glyph rune) int

func (*Font) GlyphMetrics

func (f *Font) GlyphMetrics(glyph rune) (minX, maxX, minY, maxY, advance int, err error)

func (*Font) Height

func (f *Font) Height() int

func (*Font) Hinting

func (f *Font) Hinting() FontHinting

func (*Font) Kerning

func (f *Font) Kerning() int

func (*Font) LineSkip

func (f *Font) LineSkip() int

func (*Font) Outline

func (f *Font) Outline() int

func (*Font) SizeText

func (f *Font) SizeText(text string) (w, h int, err error)

func (*Font) SizeUTF8

func (f *Font) SizeUTF8(text string) (w, h int, err error)

func (*Font) SizeUnicode

func (f *Font) SizeUnicode(text string) (w, h int, err error)

func (*Font) Style

func (f *Font) Style() FontStyle

func (*Font) WithHinting

func (f *Font) WithHinting(hinting FontHinting)

func (*Font) WithKerning

func (f *Font) WithKerning(kerning int)

func (*Font) WithOutline

func (f *Font) WithOutline(outline int)

func (*Font) WithStyle

func (f *Font) WithStyle(style FontStyle)

type FontHinting

type FontHinting int
const (
	HintingNormal FontHinting = C.TTF_HINTING_NORMAL
	HintingLight  FontHinting = C.TTF_HINTING_LIGHT
	HintingMono   FontHinting = C.TTF_HINTING_MONO
	HintingNone   FontHinting = C.TTF_HINTING_NONE
)

type FontStyle

type FontStyle int
const (
	StyleNormal        FontStyle = C.TTF_STYLE_NORMAL
	StyleBold          FontStyle = C.TTF_STYLE_BOLD
	StyleItalic        FontStyle = C.TTF_STYLE_ITALIC
	StyleUnderline     FontStyle = C.TTF_STYLE_UNDERLINE
	StyleStrikethrough FontStyle = C.TTF_STYLE_STRIKETHROUGH
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL