Versions in this module Expand all Collapse all v0 v0.4.2 Nov 3, 2020 v0.2.0 Aug 28, 2018 Changes in this version + var ERROR_INCORRECT_MAGIC_NUMBER = errors.New("Incorrect magic number") + var ERROR_NO_GET_WRONG_TYPE = errors.New("get wrong type") + var ERROR_NO_KEY_FOUND = errors.New("no key found") + var ERROR_NO_UNICODE_ENCODING_FOUND = errors.New("No Unicode encoding found") + var ERROR_POSTSCRIPT_NAME_NOT_FOUND = errors.New("PostScript name not found") + var ERROR_UNEXPECTED_SUBTABLE_FORMAT = errors.New("Unexpected subtable format") + var ErrFontLicenseDoesNotAllowEmbedding = errors.New("Font license does not allow embedding") + var ErrTableNotFound = errors.New("table not found") + var Nonsymbolic = (1 << 5) + var Symbolic = 1 << 2 + func Round(value float64) int + type CmapFormat12GroupingTable struct + EndCharCode uint + GlyphID uint + StartCharCode uint + type FontMaker struct + func NewFontMaker() *FontMaker + func (f *FontMaker) FileSize(path string) (int64, error) + func (f *FontMaker) GetInfoFromTrueType(fontpath string, fontmaps []FontMap) (TtfInfo, error) + func (f *FontMaker) GetResults() []string + func (f *FontMaker) GoStructName(name string) string + func (f *FontMaker) LoadMap(encodingpath string) ([]FontMap, error) + func (f *FontMaker) MakeDefinitionFile(gofontname string, mappath string, exportfile string, encode string, ...) (string, error) + func (f *FontMaker) MakeFont(fontpath string, mappath string, encode string, outfolderpath string) error + func (f *FontMaker) MakeFontDescriptor(info TtfInfo) (string, error) + func (f *FontMaker) MakeFontEncoding(mappath string, fontmaps []FontMap) (string, error) + func (f *FontMaker) MakeWidthArray(widths map[int]int) (string, error) + func (f *FontMaker) MultiplyAndRound(k float64, v int) int + func (f *FontMaker) MultiplyAndRoundWithUInt64(k float64, v uint) int + func (f *FontMaker) Round(value float64) int + type FontMap struct + Name string + Uv int + type KernMap map[uint]KernValue + type KernTable struct + Kerning KernMap + NTables uint + Version uint + type KernValue map[uint]int16 + func (k KernValue) ValueByRight(right uint) (bool, int16) + type TTFParser struct + Bold bool + Embeddable bool + EndCount []uint + GlyphIdArray []uint + IdDelta []uint + IdRangeOffset []uint + IsShortIndex bool + LocaTable []uint + SegCount uint + StartCount []uint + func (t *TTFParser) ArrayPadUint(arr []uint, size uint, val uint) ([]uint, error) + func (t *TTFParser) Ascender() int + func (t *TTFParser) BytesToString(b []byte) string + func (t *TTFParser) CapHeight() int + func (t *TTFParser) Chars() map[int]uint + func (t *TTFParser) CompareBytes(a []byte, b []byte) bool + func (t *TTFParser) Descender() int + func (t *TTFParser) FTell(fd *bytes.Reader) (uint, error) + func (t *TTFParser) Flag() int + func (t *TTFParser) FontData() []byte + func (t *TTFParser) GetTables() map[string]TableDirectoryEntry + func (t *TTFParser) GroupingTables() []CmapFormat12GroupingTable + func (t *TTFParser) ItalicAngle() int + func (t *TTFParser) Kern() *KernTable + func (t *TTFParser) NumGlyphs() uint + func (t *TTFParser) NumberOfHMetrics() uint + func (t *TTFParser) Parse(filepath string) error + func (t *TTFParser) ParseByReader(rd io.Reader) error + func (t *TTFParser) ParseCmap(fd *bytes.Reader) error + func (t *TTFParser) ParseCmapFormat12(fd *bytes.Reader) (bool, error) + func (t *TTFParser) ParseHead(fd *bytes.Reader) error + func (t *TTFParser) ParseHhea(fd *bytes.Reader) error + func (t *TTFParser) ParseHmtx(fd *bytes.Reader) error + func (t *TTFParser) ParseLoca(fd *bytes.Reader) error + func (t *TTFParser) ParseMaxp(fd *bytes.Reader) error + func (t *TTFParser) ParseName(fd *bytes.Reader) error + func (t *TTFParser) ParseOS2(fd *bytes.Reader) error + func (t *TTFParser) ParsePost(fd *bytes.Reader) error + func (t *TTFParser) Parsekern(fd *bytes.Reader) error + func (t *TTFParser) PregReplace(pattern string, replacement string, subject string) (string, error) + func (t *TTFParser) Read(fd *bytes.Reader, length int) ([]byte, error) + func (t *TTFParser) ReadShort(fd *bytes.Reader) (int, error) + func (t *TTFParser) ReadShortInt16(fd *bytes.Reader) (int16, error) + func (t *TTFParser) ReadULong(fd *bytes.Reader) (uint, error) + func (t *TTFParser) ReadUShort(fd *bytes.Reader) (uint, error) + func (t *TTFParser) Seek(fd *bytes.Reader, tag string) error + func (t *TTFParser) SetUseKerning(use bool) + func (t *TTFParser) Skip(fd *bytes.Reader, length int) error + func (t *TTFParser) TypoAscender() int + func (t *TTFParser) TypoDescender() int + func (t *TTFParser) UnderlinePosition() int + func (t *TTFParser) UnderlineThickness() int + func (t *TTFParser) UnitsPerEm() uint + func (t *TTFParser) Widths() []uint + func (t *TTFParser) XHeight() int + func (t *TTFParser) XMax() int + func (t *TTFParser) XMin() int + func (t *TTFParser) YMax() int + func (t *TTFParser) YMin() int + type TableDirectoryEntry struct + CheckSum uint + Length uint + Offset uint + func (t TableDirectoryEntry) PaddedLength() int + type TtfInfo map[string]interface + func (me TtfInfo) GetBool(key string) (bool, error) + func (me TtfInfo) GetInt64(key string) (int, error) + func (me TtfInfo) GetInt64s(key string) ([]int, error) + func (me TtfInfo) GetMapIntInt64(key string) (map[int]int, error) + func (me TtfInfo) GetString(key string) (string, error) + func (me TtfInfo) PushBool(key string, val bool) + func (me TtfInfo) PushBytes(key string, val []byte) + func (me TtfInfo) PushInt(key string, val int) + func (me TtfInfo) PushInt64(key string, val int64) + func (me TtfInfo) PushInt64s(key string, val []int) + func (me TtfInfo) PushMapIntInt64(key string, val map[int]int) + func (me TtfInfo) PushString(key string, val string) + func (me TtfInfo) PushUInt64(key string, val uint) + func NewTtfInfo() TtfInfo