Documentation ¶
Index ¶
- Constants
- type Atlas
- type AtlasNode
- type FONSAlign
- type Font
- type FontStash
- func (stash *FontStash) AddFont(name, path string) int
- func (stash *FontStash) AddFontFromMemory(name string, data []byte, freeData uint8) int
- func (stash *FontStash) GetFontByName(name string) int
- func (stash *FontStash) GetFontName() string
- func (stash *FontStash) GetTextureData() ([]byte, int, int)
- func (stash *FontStash) LineBounds(y float32) (minY, maxY float32)
- func (stash *FontStash) ResetAtlas(width, height int)
- func (stash *FontStash) SetAlign(align FONSAlign)
- func (stash *FontStash) SetBlur(blur float32)
- func (stash *FontStash) SetFont(font int)
- func (stash *FontStash) SetSize(size float32)
- func (stash *FontStash) SetSpacing(spacing float32)
- func (stash *FontStash) TextBounds(x, y float32, str string) (float32, []float32)
- func (stash *FontStash) TextBoundsOfRunes(x, y float32, runes []rune) (float32, []float32)
- func (stash *FontStash) TextIter(x, y float32, str string) *TextIterator
- func (stash *FontStash) TextIterForRunes(x, y float32, runes []rune) *TextIterator
- func (stash *FontStash) ValidateTexture() []int
- func (stash *FontStash) VerticalMetrics() (float32, float32, float32)
- type Glyph
- type GlyphKey
- type Params
- type Quad
- type State
- type TextIterator
Constants ¶
View Source
const ( FONS_VERTEX_COUNT = 1024 FONS_SCRATCH_BUF_SIZE = 16000 FONS_INIT_FONTS = 4 FONS_INIT_GLYPHS = 256 FONS_INIT_ATLAS_NODES = 256 INVALID = -1 )
View Source
const ( // Horizontal Align ALIGN_LEFT FONSAlign = 1 << 0 // Default ALIGN_CENTER = 1 << 1 ALIGN_RIGHT = 1 << 2 // Vertical Align ALIGN_TOP = 1 << 3 ALIGN_MIDDLE = 1 << 4 ALIGN_BOTTOM = 1 << 5 ALIGN_BASELINE = 1 << 6 // Default )
View Source
const ( APREC = 16 ZPREC = 7 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FontStash ¶
type FontStash struct {
// contains filtered or unexported fields
}
func (*FontStash) AddFontFromMemory ¶
func (*FontStash) GetFontByName ¶
func (*FontStash) GetFontName ¶
func (*FontStash) LineBounds ¶
func (*FontStash) ResetAtlas ¶
func (*FontStash) SetSpacing ¶
func (*FontStash) TextBounds ¶
func (*FontStash) TextBoundsOfRunes ¶
func (*FontStash) TextIter ¶
func (stash *FontStash) TextIter(x, y float32, str string) *TextIterator
func (*FontStash) TextIterForRunes ¶
func (stash *FontStash) TextIterForRunes(x, y float32, runes []rune) *TextIterator
func (*FontStash) ValidateTexture ¶
type TextIterator ¶
type TextIterator struct {
X, Y, NextX, NextY, Scale, Spacing float32
CodePoint rune
Size, Blur int
PrevGlyph *Glyph
CurrentIndex int
NextIndex int
End int
Runes []rune
// contains filtered or unexported fields
}
func (*TextIterator) Next ¶
func (iter *TextIterator) Next() (quad Quad, ok bool)
Directories ¶
Path | Synopsis |
---|---|
This library processes TrueType files: - parse files - extract glyph metrics - extract glyph shapes - render glyphs to one-channel bitmaps with antialiasing (box filter)
|
This library processes TrueType files: - parse files - extract glyph metrics - extract glyph shapes - render glyphs to one-channel bitmaps with antialiasing (box filter) |
Click to show internal directories.
Click to hide internal directories.