Documentation ¶
Overview ¶
pack implements packing using maxrects algorithm
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SupportedFonts = []string{
".ttf",
}
View Source
var SupportedImages = []string{
".gif",
".jpg", ".jpeg",
".png",
".bmp",
".tif",
".tiff",
".webp",
}
Functions ¶
func BoxesToSizes ¶
func PlaceBoxes ¶
Types ¶
type Font ¶
type Font struct { Name string Font *truetype.Font Face font.Face Padding int MaxBounds fixed.Rectangle26_6 Glyphs map[rune]*Glyph Kern map[[2]rune]fixed.Int26_6 }
func (*Font) IncludeAscii ¶
func (font *Font) IncludeAscii()
func (*Font) IncludeExtendedAscii ¶
func (font *Font) IncludeExtendedAscii()
func (*Font) IncludeString ¶
type Glyph ¶
type Glyph struct { Rune rune Size image.Point // destination size in pixels Bounds fixed.Rectangle26_6 // such that point + bounds, gives image bounds Advance fixed.Int26_6 Place image.Rectangle // without padding }
advance ---- maxAscent
|-------| |
■■■ ---- bounds.Max.Y ■ ■ | ■ | ■■■■ ■■■■ |
■ ■ ■ | ■ ■ ■ | •■■■■■ •■■■■ • ---- point.Y
■ |
■ ■ |
■■■■ ---- bounds.Min.Y | ---- maxDescent
Click to show internal directories.
Click to hide internal directories.