Documentation ¶
Overview ¶
Package font9 implements the subfont format where characters are stored as a single image with the glyphs placed side-by-side on a common baseline.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Fixed ¶
type Fixed struct { Left int8 Adv uint8 // distance between two successive glyph origins when drawing Width uint8 // width of the glyph subimage Bits Image // image holding the glyphs, the baseline is at y = 0 }
Fixed can hold data of a monospace font where all character subimages has the same width.
type Image ¶
Image is an image.Image with a SubImage method to obtain the portion of the image visible through r.
type Variable ¶
type Variable struct { // Info stores information about N character subimagas in the N*4 + 2 bytes: // xlo0, xhi0, left0, advance0, ... , xloN, xhiN. The difference to the // original Plan 9 subfont is the lack of the top and bottom information. // Info is stored in a string to avoid being copied to RAM in the case of // systems that can leave read-only data in Flash. Use strings.Builder to // efficiently load/build it at runtime. Info string // Bits is an image holding the glyphs. The baseline is at y = 0. Bits Image }
Variable can hold data of a monospace or proportional fonts. The character images can have different widths and origins.
Click to show internal directories.
Click to hide internal directories.