Versions in this module Expand all Collapse all v0 v0.2.3 Apr 3, 2026 v0.2.2 Mar 24, 2026 v0.2.1 Mar 24, 2026 Changes in this version + const AsciiGlyphCount + var AllocPageFn func() int + var NextPageFn func() int + var RegisterPageFn func(pageIndex int, img *ebiten.Image) + func GenerateSDFFromBitmaps(glyphs []GlyphBitmap, opts SDFGenOptions) (*image.NRGBA, []byte, error) + func LoadDistanceFieldFontFromTTF(ttfData []byte, opts SDFGenOptions) (*distanceFieldFont, *ebiten.Image, *image.NRGBA, []byte, error) + func LoadDistanceFieldFontFromTTFMSDF(ttfData []byte, opts SDFGenOptions) (*distanceFieldFont, *ebiten.Image, *image.NRGBA, error) + func LoadFontFromPath(path string) ([]byte, error) + func LoadFontFromSystem(name string) ([]byte, error) + type AtlasEntry struct + BakeSize float64 + JSON []byte + PNG []byte + Style FontStyle + type FontFamily struct + func NewFontFamilyFromFontBundle(data []byte) (*FontFamily, error) + func NewFontFamilyFromPixelFont(img *ebiten.Image, cellW, cellH int, chars string) *FontFamily + func NewFontFamilyFromTTF(cfg FontFamilyConfig) (*FontFamily, error) + func (ff *FontFamily) Atlases() []AtlasEntry + func (ff *FontFamily) IsPixelMode() bool + func (ff *FontFamily) LineHeight(displaySize float64, bold, italic bool) float64 + func (ff *FontFamily) MeasureString(text string, displaySize float64, bold, italic bool) (w, h float64) + func (ff *FontFamily) PixelCellSize() (int, int) + func (ff *FontFamily) PixelPage() uint16 + func (ff *FontFamily) SDFDistanceRange(displaySize float64, bold, italic bool) float64 + func (ff *FontFamily) SDFFontSize(displaySize float64, bold, italic bool) float64 + func (ff *FontFamily) SDFIsMultiChannel(displaySize float64, bold, italic bool) bool + func (ff *FontFamily) SDFLineHeight(displaySize float64, bold, italic bool) float64 + func (ff *FontFamily) SDFPage(displaySize float64, bold, italic bool) uint16 + func (ff *FontFamily) TTFData(bold, italic bool) []byte + func (ff *FontFamily) TrimCell(top, right, bottom, left int) + type FontFamilyConfig struct + BakeSizes []float64 + Bold []byte + BoldItalic []byte + Italic []byte + Regular []byte + type FontStyle int + const FontStyleBold + const FontStyleBoldItalic + const FontStyleItalic + const FontStyleRegular + type Glyph struct + Height uint16 + ID rune + Page uint16 + Width uint16 + X uint16 + XAdvance int16 + XOffset int16 + Y uint16 + YOffset int16 + type GlyphBitmap struct + ID rune + Img *image.Alpha + XAdvance int + XOffset int + YOffset int + type GlyphPos struct + Page uint16 + Region types.TextureRegion + X float64 + Y float64 + type SDFGenOptions struct + AtlasWidth int + Chars string + DistanceRange float64 + MSDF bool + PageIndex uint16 + Size float64 + func (o *SDFGenOptions) Defaults() + type TextBlock struct + Align types.TextAlign + Bold bool + Color types.Color + Content string + Font *FontFamily + FontSize float64 + Italic bool + LayoutDirty bool + LineHeight float64 + Lines []TextLine + MeasuredH float64 + MeasuredW float64 + SdfIndCount int + SdfInds []uint16 + SdfShader *ebiten.Shader + SdfUniforms map[string]any + SdfVertCount int + SdfVerts []ebiten.Vertex + Sharpness float64 + TextEffects *TextEffects + UniformsDirty bool + WrapWidth float64 + func (tb *TextBlock) EffectiveLineHeight() float64 + func (tb *TextBlock) FontScale() float64 + func (tb *TextBlock) Invalidate() + func (tb *TextBlock) Layout() []TextLine + func (tb *TextBlock) LayoutPixel(glyphLookup func(r rune) (x, y uint16, found bool), page uint16, ...) + func (tb *TextBlock) LayoutSDF(glyphLookup func(r rune) *Glyph, kernLookup func(first, second rune) int16, ...) + func (tb *TextBlock) MeasureDisplay(text string) (width, height float64) + func (tb *TextBlock) RebuildLocalVerts(lineHeight float64) + type TextEffects struct + GlowColor types.Color + GlowWidth float64 + OutlineColor types.Color + OutlineWidth float64 + ShadowColor types.Color + ShadowOffset types.Vec2 + ShadowSoftness float64 + type TextLine struct + Glyphs []GlyphPos + Width float64