core

package
v0.0.0-...-ddb0baf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2015 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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

func Round

func Round(value float64) int64

Types

type FontMaker

type FontMaker struct {
	// contains filtered or unexported fields
}

font maker

func NewFontMaker

func NewFontMaker() *FontMaker

func (*FontMaker) FileSize

func (f *FontMaker) FileSize(path string) (int64, error)

func (*FontMaker) GetInfoFromTrueType

func (f *FontMaker) GetInfoFromTrueType(fontpath string, fontmaps []FontMap) (TtfInfo, error)

func (*FontMaker) GetResults

func (f *FontMaker) GetResults() []string

func (*FontMaker) GoStructName

func (f *FontMaker) GoStructName(name string) string

func (*FontMaker) LoadMap

func (f *FontMaker) LoadMap(encodingpath string) ([]FontMap, error)

func (*FontMaker) MakeDefinitionFile

func (f *FontMaker) MakeDefinitionFile(gofontname string, mappath string, exportfile string, encode string, fontmaps []FontMap, info TtfInfo) (string, error)

func (*FontMaker) MakeFont

func (f *FontMaker) MakeFont(fontpath string, mappath string, encode string, outfolderpath string) error

func (*FontMaker) MakeFontDescriptor

func (f *FontMaker) MakeFontDescriptor(info TtfInfo) (string, error)

func (*FontMaker) MakeFontEncoding

func (f *FontMaker) MakeFontEncoding(mappath string, fontmaps []FontMap) (string, error)

func (*FontMaker) MakeWidthArray

func (f *FontMaker) MakeWidthArray(widths map[int]int64) (string, error)

func (*FontMaker) MultiplyAndRound

func (f *FontMaker) MultiplyAndRound(k float64, v int64) int64

func (*FontMaker) MultiplyAndRoundWithUInt64

func (f *FontMaker) MultiplyAndRoundWithUInt64(k float64, v uint64) int64

func (*FontMaker) Round

func (f *FontMaker) Round(value float64) int64

type FontMap

type FontMap struct {
	Uv   int
	Name string
}

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 (t *TTFParser) ArrayPadUint(arr []uint64, size uint64, val uint64) ([]uint64, error)

func (*TTFParser) Ascender

func (t *TTFParser) Ascender() int64

func (*TTFParser) BytesToString

func (t *TTFParser) BytesToString(b []byte) string

func (*TTFParser) CapHeight

func (t *TTFParser) CapHeight() int64

func (*TTFParser) Chars

func (t *TTFParser) Chars() map[int]uint64

func (*TTFParser) CompareBytes

func (t *TTFParser) CompareBytes(a []byte, b []byte) bool

func (*TTFParser) Descender

func (t *TTFParser) Descender() int64

func (*TTFParser) FTell

func (t *TTFParser) FTell(fd *os.File) (uint64, error)

func (*TTFParser) Flag

func (t *TTFParser) Flag() int

func (*TTFParser) FontData

func (t *TTFParser) FontData() []byte

func (*TTFParser) GetTables

func (t *TTFParser) GetTables() map[string]TableDirectoryEntry

func (*TTFParser) ItalicAngle

func (t *TTFParser) ItalicAngle() int64

func (*TTFParser) NumGlyphs

func (t *TTFParser) NumGlyphs() uint64

func (*TTFParser) NumberOfHMetrics

func (t *TTFParser) NumberOfHMetrics() uint64

func (*TTFParser) Parse

func (t *TTFParser) Parse(fontpath string) error

func (*TTFParser) ParseCmap

func (t *TTFParser) ParseCmap(fd *os.File) error

func (*TTFParser) ParseHead

func (t *TTFParser) ParseHead(fd *os.File) error

func (*TTFParser) ParseHhea

func (t *TTFParser) ParseHhea(fd *os.File) error

func (*TTFParser) ParseHmtx

func (t *TTFParser) ParseHmtx(fd *os.File) error

func (*TTFParser) ParseLoca

func (t *TTFParser) ParseLoca(fd *os.File) error

func (*TTFParser) ParseMaxp

func (t *TTFParser) ParseMaxp(fd *os.File) error

func (*TTFParser) ParseName

func (t *TTFParser) ParseName(fd *os.File) error

func (*TTFParser) ParseOS2

func (t *TTFParser) ParseOS2(fd *os.File) error

func (*TTFParser) ParsePost

func (t *TTFParser) ParsePost(fd *os.File) error

func (*TTFParser) PregReplace

func (t *TTFParser) PregReplace(pattern string, replacement string, subject string) (string, error)

func (*TTFParser) Read

func (t *TTFParser) Read(fd *os.File, length int) ([]byte, error)

func (*TTFParser) ReadShort

func (t *TTFParser) ReadShort(fd *os.File) (int64, error)

func (*TTFParser) ReadULong

func (t *TTFParser) ReadULong(fd *os.File) (uint64, error)

func (*TTFParser) ReadUShort

func (t *TTFParser) ReadUShort(fd *os.File) (uint64, error)

func (*TTFParser) Seek

func (t *TTFParser) Seek(fd *os.File, tag string) error

func (*TTFParser) Skip

func (t *TTFParser) Skip(fd *os.File, length int64) error

func (*TTFParser) TypoAscender

func (t *TTFParser) TypoAscender() int64

func (*TTFParser) TypoDescender

func (t *TTFParser) TypoDescender() int64

func (*TTFParser) UnderlinePosition

func (t *TTFParser) UnderlinePosition() int64

func (*TTFParser) UnderlineThickness

func (t *TTFParser) UnderlineThickness() int64

func (*TTFParser) UnitsPerEm

func (t *TTFParser) UnitsPerEm() uint64

func (*TTFParser) Widths

func (t *TTFParser) Widths() []uint64

func (*TTFParser) XHeight

func (t *TTFParser) XHeight() int64

func (*TTFParser) XMax

func (t *TTFParser) XMax() int64

func (*TTFParser) XMin

func (t *TTFParser) XMin() int64

func (*TTFParser) YMax

func (t *TTFParser) YMax() int64

func (*TTFParser) YMin

func (t *TTFParser) YMin() int64

type TableDirectoryEntry

type TableDirectoryEntry struct {
	CheckSum uint64
	Offset   uint64
	Length   uint64
}

func (TableDirectoryEntry) PaddedLength

func (t TableDirectoryEntry) PaddedLength() int

type TtfInfo

type TtfInfo map[string]interface{}

func NewTtfInfo

func NewTtfInfo() TtfInfo

func (TtfInfo) GetBool

func (me TtfInfo) GetBool(key string) (bool, error)

func (TtfInfo) GetInt64

func (me TtfInfo) GetInt64(key string) (int64, error)

func (TtfInfo) GetInt64s

func (me TtfInfo) GetInt64s(key string) ([]int64, error)

func (TtfInfo) GetMapIntInt64

func (me TtfInfo) GetMapIntInt64(key string) (map[int]int64, error)

func (TtfInfo) GetString

func (me TtfInfo) GetString(key string) (string, error)

func (TtfInfo) PushBool

func (me TtfInfo) PushBool(key string, val bool)

func (TtfInfo) PushBytes

func (me TtfInfo) PushBytes(key string, val []byte)

func (TtfInfo) PushInt64

func (me TtfInfo) PushInt64(key string, val int64)

func (TtfInfo) PushInt64s

func (me TtfInfo) PushInt64s(key string, val []int64)

func (TtfInfo) PushMapIntInt64

func (me TtfInfo) PushMapIntInt64(key string, val map[int]int64)

func (TtfInfo) PushString

func (me TtfInfo) PushString(key string, val string)

func (TtfInfo) PushUInt64

func (me TtfInfo) PushUInt64(key string, val uint64)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL