Documentation ¶
Index ¶
- Variables
- func Round(value float64) int64
- type 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]int64) (string, error)
- func (f *FontMaker) MultiplyAndRound(k float64, v int64) int64
- func (f *FontMaker) MultiplyAndRoundWithUInt64(k float64, v uint64) int64
- func (f *FontMaker) Round(value float64) int64
- type FontMap
- type TTFParser
- func (t *TTFParser) ArrayPadUint(arr []uint64, size uint64, val uint64) ([]uint64, error)
- func (t *TTFParser) Ascender() int64
- func (t *TTFParser) BytesToString(b []byte) string
- func (t *TTFParser) CapHeight() int64
- func (t *TTFParser) Chars() map[int]uint64
- func (t *TTFParser) CompareBytes(a []byte, b []byte) bool
- func (t *TTFParser) Descender() int64
- func (t *TTFParser) FTell(fd *os.File) (uint64, error)
- func (t *TTFParser) Flag() int
- func (t *TTFParser) FontData() []byte
- func (t *TTFParser) GetTables() map[string]TableDirectoryEntry
- func (t *TTFParser) ItalicAngle() int64
- func (t *TTFParser) NumGlyphs() uint64
- func (t *TTFParser) NumberOfHMetrics() uint64
- func (t *TTFParser) Parse(fontpath string) error
- func (t *TTFParser) ParseCmap(fd *os.File) error
- func (t *TTFParser) ParseHead(fd *os.File) error
- func (t *TTFParser) ParseHhea(fd *os.File) error
- func (t *TTFParser) ParseHmtx(fd *os.File) error
- func (t *TTFParser) ParseLoca(fd *os.File) error
- func (t *TTFParser) ParseMaxp(fd *os.File) error
- func (t *TTFParser) ParseName(fd *os.File) error
- func (t *TTFParser) ParseOS2(fd *os.File) error
- func (t *TTFParser) ParsePost(fd *os.File) error
- func (t *TTFParser) PregReplace(pattern string, replacement string, subject string) (string, error)
- func (t *TTFParser) Read(fd *os.File, length int) ([]byte, error)
- func (t *TTFParser) ReadShort(fd *os.File) (int64, error)
- func (t *TTFParser) ReadULong(fd *os.File) (uint64, error)
- func (t *TTFParser) ReadUShort(fd *os.File) (uint64, error)
- func (t *TTFParser) Seek(fd *os.File, tag string) error
- func (t *TTFParser) Skip(fd *os.File, length int64) error
- func (t *TTFParser) TypoAscender() int64
- func (t *TTFParser) TypoDescender() int64
- func (t *TTFParser) UnderlinePosition() int64
- func (t *TTFParser) UnderlineThickness() int64
- func (t *TTFParser) UnitsPerEm() uint64
- func (t *TTFParser) Widths() []uint64
- func (t *TTFParser) XHeight() int64
- func (t *TTFParser) XMax() int64
- func (t *TTFParser) XMin() int64
- func (t *TTFParser) YMax() int64
- func (t *TTFParser) YMin() int64
- type TableDirectoryEntry
- type TtfInfo
- func (me TtfInfo) GetBool(key string) (bool, error)
- func (me TtfInfo) GetInt64(key string) (int64, error)
- func (me TtfInfo) GetInt64s(key string) ([]int64, error)
- func (me TtfInfo) GetMapIntInt64(key string) (map[int]int64, 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) PushInt64(key string, val int64)
- func (me TtfInfo) PushInt64s(key string, val []int64)
- func (me TtfInfo) PushMapIntInt64(key string, val map[int]int64)
- func (me TtfInfo) PushString(key string, val string)
- func (me TtfInfo) PushUInt64(key string, val uint64)
Constants ¶
This section is empty.
Variables ¶
View Source
var ERROR_INCORRECT_MAGIC_NUMBER = errors.New("Incorrect magic number")
View Source
var ERROR_NO_GET_WRONG_TYPE = errors.New("get wrong type")
View Source
var ERROR_NO_KEY_FOUND = errors.New("no key found")
View Source
var ERROR_NO_UNICODE_ENCODING_FOUND = errors.New("No Unicode encoding found")
View Source
var ERROR_POSTSCRIPT_NAME_NOT_FOUND = errors.New("PostScript name not found")
View Source
var ERROR_UNEXPECTED_SUBTABLE_FORMAT = errors.New("Unexpected subtable format")
View Source
var ErrFontLicenseDoesNotAllowEmbedding = errors.New("Font license does not allow embedding")
Font license does not allow embedding
View Source
var Nonsymbolic = (1 << 5)
View Source
var Symbolic = 1 << 2
Functions ¶
Types ¶
type FontMaker ¶
type FontMaker struct {
// contains filtered or unexported fields
}
font maker
func NewFontMaker ¶
func NewFontMaker() *FontMaker
func (*FontMaker) GetInfoFromTrueType ¶
func (*FontMaker) GetResults ¶
func (*FontMaker) GoStructName ¶
func (*FontMaker) MakeDefinitionFile ¶
func (*FontMaker) MakeFontDescriptor ¶
func (*FontMaker) MakeFontEncoding ¶
func (*FontMaker) MakeWidthArray ¶
func (*FontMaker) MultiplyAndRoundWithUInt64 ¶
type TTFParser ¶
type TTFParser struct { Embeddable bool Bold bool //cmap IsShortIndex bool LocaTable []uint64 SegCount uint64 StartCount []uint64 EndCount []uint64 IdRangeOffset []uint64 IdDelta []uint64 GlyphIdArray []uint64 // contains filtered or unexported fields }
func (*TTFParser) ArrayPadUint ¶
func (*TTFParser) BytesToString ¶
func (*TTFParser) GetTables ¶
func (t *TTFParser) GetTables() map[string]TableDirectoryEntry
func (*TTFParser) ItalicAngle ¶
func (*TTFParser) NumberOfHMetrics ¶
func (*TTFParser) PregReplace ¶
func (*TTFParser) TypoAscender ¶
func (*TTFParser) TypoDescender ¶
func (*TTFParser) UnderlinePosition ¶
func (*TTFParser) UnderlineThickness ¶
func (*TTFParser) UnitsPerEm ¶
type TableDirectoryEntry ¶
func (TableDirectoryEntry) PaddedLength ¶
func (t TableDirectoryEntry) PaddedLength() int
type TtfInfo ¶
type TtfInfo map[string]interface{}
func NewTtfInfo ¶
func NewTtfInfo() TtfInfo
func (TtfInfo) PushInt64s ¶
func (TtfInfo) PushString ¶
func (TtfInfo) PushUInt64 ¶
Click to show internal directories.
Click to hide internal directories.