Documentation ¶
Index ¶
- Variables
- type ColorPair
- type ColorPair4
- type ColorPairGroup
- type ColorPairRGB
- type FontInfo
- type TheDrawFont
- func (tdf *TheDrawFont) Chars(inclMissing bool) string
- func (tdf *TheDrawFont) FillCharContent(d *TheDrawFontCharacter) error
- func (tdf *TheDrawFont) HasChar(char rune) (*TheDrawFontCharacter, bool)
- func (tdf *TheDrawFont) HasChars(chars string) (string, bool)
- func (tdf *TheDrawFont) InfoString() string
- func (tdf *TheDrawFont) NullTerminatedString(r binstruct.Reader, d *TheDrawFontCharacter) error
- func (tdf *TheDrawFont) Print(s string)
- func (tdf *TheDrawFont) ReadCharacters(r binstruct.Reader) error
- func (tdf *TheDrawFont) Render(s string) string
- func (tdf *TheDrawFont) SetOptions(o func(*TheDrawFontStringOptions))
- func (tdf *TheDrawFont) Supported() bool
- type TheDrawFontAlignment
- type TheDrawFontCell
- type TheDrawFontCharacter
- type TheDrawFontColoring
- type TheDrawFontFile
- func (tdff *TheDrawFontFile) GetAllFonts() []string
- func (tdff *TheDrawFontFile) GetFont(f string) *TheDrawFont
- func (tdff *TheDrawFontFile) ParseFont(r binstruct.Reader, tdf *TheDrawFont) error
- func (tdff *TheDrawFontFile) ReadFonts(r binstruct.Reader) error
- func (tdff *TheDrawFontFile) String() string
- type TheDrawFontHeader
- type TheDrawFontMetaData
- type TheDrawFontString
- func (tdfs *TheDrawFontString) GetPadding() uint8
- func (tdfs *TheDrawFontString) LoadFont(s string)
- func (tdfs *TheDrawFontString) LoadFontFontInfo(fi *FontInfo)
- func (tdfs *TheDrawFontString) PrintRow(row int)
- func (tdfs *TheDrawFontString) PrintString(s string)
- func (tdfs *TheDrawFontString) RenderString(s string) string
- type TheDrawFontStringOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Alignments []TheDrawFontAlignment = []TheDrawFontAlignment{AlignLeft, AlignCenter, AlignRight} AlignmentStrings []string = []string{"left", "center", "right"} )
View Source
var (
BuiltInFonts []*FontInfo
)
View Source
var BuiltinFontsFiles embed.FS
View Source
var TheDrawFontNotSupported = errors.New("Font type not supported. Only support Color types.")
Functions ¶
This section is empty.
Types ¶
type ColorPairGroup ¶
func (*ColorPairGroup) AddPair ¶
func (cpg *ColorPairGroup) AddPair(cp *ColorPair)
func (*ColorPairGroup) Detail ¶
func (cpg *ColorPairGroup) Detail() string
func (*ColorPairGroup) String ¶
func (cpg *ColorPairGroup) String() string
type ColorPairRGB ¶
type ColorPairRGB struct {
// contains filtered or unexported fields
}
type TheDrawFont ¶
type TheDrawFont struct { Offset int `bin:"-"` CharOffsets int `bin:"-"` MetaData TheDrawFontMetaData // `bin:"len:233"` Glyphs []TheDrawFontCharacter `bin:"-"` // `bin:"len:fontBlockSize"` // Space TheDrawFontCharacter `bin:"-"` // `bin:"len:fontBlockSize"` // Colors *ColorPairGroup `bin:"-"` Options *TheDrawFontStringOptions `bin:"-"` }
type TheDrawFontGlyphs []TheDrawFontCharacter
func (*TheDrawFont) Chars ¶
func (tdf *TheDrawFont) Chars(inclMissing bool) string
func (*TheDrawFont) FillCharContent ¶
func (tdf *TheDrawFont) FillCharContent(d *TheDrawFontCharacter) error
func (*TheDrawFont) HasChar ¶
func (tdf *TheDrawFont) HasChar(char rune) (*TheDrawFontCharacter, bool)
func (*TheDrawFont) InfoString ¶
func (tdf *TheDrawFont) InfoString() string
func (*TheDrawFont) NullTerminatedString ¶
func (tdf *TheDrawFont) NullTerminatedString(r binstruct.Reader, d *TheDrawFontCharacter) error
func (*TheDrawFont) Print ¶
func (tdf *TheDrawFont) Print(s string)
func (*TheDrawFont) ReadCharacters ¶
func (tdf *TheDrawFont) ReadCharacters(r binstruct.Reader) error
func (*TheDrawFont) Render ¶
func (tdf *TheDrawFont) Render(s string) string
func (*TheDrawFont) SetOptions ¶
func (tdf *TheDrawFont) SetOptions(o func(*TheDrawFontStringOptions))
func (*TheDrawFont) Supported ¶
func (tdf *TheDrawFont) Supported() bool
type TheDrawFontAlignment ¶
type TheDrawFontAlignment int
const ( AlignLeft TheDrawFontAlignment = iota + 1 AlignCenter AlignRight )
func (TheDrawFontAlignment) String ¶
func (a TheDrawFontAlignment) String() string
type TheDrawFontCell ¶
type TheDrawFontCell struct { Char byte `bin:"len:1"` Character string `bin:"-"` Coloring TheDrawFontColoring `bin:"-"` }
func (*TheDrawFontCell) FixEncoding ¶
func (tdfc *TheDrawFontCell) FixEncoding(b byte) rune
func (*TheDrawFontCell) GetCharacter ¶
func (tdfc *TheDrawFontCell) GetCharacter(readByte byte, second bool)
type TheDrawFontCharacter ¶
type TheDrawFontCharacter struct { Offset uint32 `bin:"-"` Width uint8 `bin:"len:1"` Height uint8 `bin:"len:1"` Content []TheDrawFontCell `bin:"-"` Colors []string `bin:"-"` }
type TheDrawFontColoring ¶
type TheDrawFontColoring struct { BgFg uint8 `bin:"len:1,ParseColor"` Bg uint8 `bin:"-"` Fg uint8 `bin:"-"` Pair *ColorPair `bin:"-"` }
func (*TheDrawFontColoring) MakeColorPair ¶
func (tdfc *TheDrawFontColoring) MakeColorPair(tdf *TheDrawFont) error
func (*TheDrawFontColoring) ParseColor ¶
func (tdfc *TheDrawFontColoring) ParseColor(col uint8, tdf *TheDrawFont) error
type TheDrawFontFile ¶
type TheDrawFontFile struct { FontInfo *FontInfo `bin:"-"` FileSize int `bin:"-"` Fonts []TheDrawFont `bin:"ReadFonts"` }
func LoadBuiltinFont ¶
func LoadBuiltinFont(name string, efs *embed.FS) (*TheDrawFontFile, error)
func LoadFont ¶
func LoadFont(fi *FontInfo) (*TheDrawFontFile, error)
func NewTheDrawFontFile ¶
func NewTheDrawFontFile(fi *FontInfo) *TheDrawFontFile
func (*TheDrawFontFile) GetAllFonts ¶
func (tdff *TheDrawFontFile) GetAllFonts() []string
func (*TheDrawFontFile) GetFont ¶
func (tdff *TheDrawFontFile) GetFont(f string) *TheDrawFont
func (*TheDrawFontFile) ParseFont ¶
func (tdff *TheDrawFontFile) ParseFont(r binstruct.Reader, tdf *TheDrawFont) error
func (*TheDrawFontFile) ReadFonts ¶
func (tdff *TheDrawFontFile) ReadFonts(r binstruct.Reader) error
func (*TheDrawFontFile) String ¶
func (tdff *TheDrawFontFile) String() string
type TheDrawFontHeader ¶
type TheDrawFontHeader struct { }
type TheDrawFontMetaData ¶
type TheDrawFontMetaData struct { Namelen uint8 `bin:"len:1"` FontName string `bin:"len:12"` FontType uint8 `bin:"len:1"` //outl block color FontSpacing uint8 `bin:"len:1"` FontBlockSize uint16 `bin:"len:2"` CharList []uint16 `bin:"len:94,[len:2]"` FontMaxHeight uint8 `bin:"-"` FontMaxWidth uint8 `bin:"-"` // contains filtered or unexported fields }
type TheDrawFontString ¶
type TheDrawFontString struct { Text string Font *TheDrawFont Chars []*TheDrawFontCharacter Output strings.Builder Options *TheDrawFontStringOptions }
func NewTheDrawFontString ¶
func NewTheDrawFontString(font string) *TheDrawFontString
func NewTheDrawFontStringFont ¶
func NewTheDrawFontStringFont(font *TheDrawFont) *TheDrawFontString
func NewTheDrawFontStringFontInfo ¶
func NewTheDrawFontStringFontInfo(fontInfo *FontInfo) *TheDrawFontString
func (*TheDrawFontString) GetPadding ¶
func (tdfs *TheDrawFontString) GetPadding() uint8
func (*TheDrawFontString) LoadFont ¶
func (tdfs *TheDrawFontString) LoadFont(s string)
func (*TheDrawFontString) LoadFontFontInfo ¶
func (tdfs *TheDrawFontString) LoadFontFontInfo(fi *FontInfo)
func (*TheDrawFontString) PrintRow ¶
func (tdfs *TheDrawFontString) PrintRow(row int)
func (*TheDrawFontString) PrintString ¶
func (tdfs *TheDrawFontString) PrintString(s string)
func (*TheDrawFontString) RenderString ¶
func (tdfs *TheDrawFontString) RenderString(s string) string
type TheDrawFontStringOptions ¶
type TheDrawFontStringOptions struct { Justify TheDrawFontAlignment Width, LineWidth uint16 SpaceWidth, Padding, Height, Spacing uint8 NoColor bool }
func NewTheDrawFontStringOptions ¶
func NewTheDrawFontStringOptions(font *TheDrawFont) *TheDrawFontStringOptions
Click to show internal directories.
Click to hide internal directories.