fonts

package
v3.0.0-...-55e877b Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HelveticaName            = StdFontName("\u0048e\u006c\u0076\u0065\u0074\u0069\u0063a")
	HelveticaBoldName        = StdFontName("\u0048\u0065\u006c\u0076\u0065\u0074\u0069\u0063\u0061-\u0042\u006f\u006c\u0064")
	HelveticaObliqueName     = StdFontName("\u0048\u0065\u006c\u0076\u0065\u0074\u0069\u0063\u0061\u002d\u004f\u0062l\u0069\u0071\u0075\u0065")
	HelveticaBoldObliqueName = StdFontName("H\u0065\u006c\u0076\u0065ti\u0063a\u002d\u0042\u006f\u006c\u0064O\u0062\u006c\u0069\u0071\u0075\u0065")
)
View Source
const (
	CourierName            = StdFontName("\u0043o\u0075\u0072\u0069\u0065\u0072")
	CourierBoldName        = StdFontName("\u0043\u006f\u0075r\u0069\u0065\u0072\u002d\u0042\u006f\u006c\u0064")
	CourierObliqueName     = StdFontName("\u0043o\u0075r\u0069\u0065\u0072\u002d\u004f\u0062\u006c\u0069\u0071\u0075\u0065")
	CourierBoldObliqueName = StdFontName("\u0043\u006f\u0075\u0072ie\u0072\u002d\u0042\u006f\u006c\u0064\u004f\u0062\u006c\u0069\u0071\u0075\u0065")
)
View Source
const (
	SymbolName       = StdFontName("\u0053\u0079\u006d\u0062\u006f\u006c")
	ZapfDingbatsName = StdFontName("\u005a\u0061\u0070f\u0044\u0069\u006e\u0067\u0062\u0061\u0074\u0073")
)
View Source
const (
	TimesRomanName      = StdFontName("T\u0069\u006d\u0065\u0073\u002d\u0052\u006f\u006d\u0061\u006e")
	TimesBoldName       = StdFontName("\u0054\u0069\u006d\u0065\u0073\u002d\u0042\u006f\u006c\u0064")
	TimesItalicName     = StdFontName("\u0054\u0069\u006de\u0073\u002d\u0049\u0074\u0061\u006c\u0069\u0063")
	TimesBoldItalicName = StdFontName("\u0054\u0069m\u0065\u0073\u002dB\u006f\u006c\u0064\u0049\u0074\u0061\u006c\u0069\u0063")
)

Variables

This section is empty.

Functions

func IsStdFont

func IsStdFont(name StdFontName) bool

func RegisterStdFont

func RegisterStdFont(name StdFontName, fnc func() StdFont, aliases ...StdFontName)

Types

type CharMetrics

type CharMetrics struct {
	Wx float64
	Wy float64
}

func (CharMetrics) String

func (_cd CharMetrics) String() string

type Descriptor

type Descriptor struct {
	Name        StdFontName
	Family      string
	Weight      FontWeight
	Flags       uint
	BBox        [4]float64
	ItalicAngle float64
	Ascent      float64
	Descent     float64
	CapHeight   float64
	XHeight     float64
	StemV       float64
	StemH       float64
}

type Font

type Font interface {
	Encoder() _f.TextEncoder
	GetRuneMetrics(_ddd rune) (CharMetrics, bool)
}

type FontWeight

type FontWeight int
const (
	FontWeightMedium FontWeight = iota
	FontWeightBold
	FontWeightRoman
)

type GID

type GID = _f.GID

type GlyphName

type GlyphName = _f.GlyphName

type RuneCharSafeMap

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

func MakeRuneCharSafeMap

func MakeRuneCharSafeMap(length int) *RuneCharSafeMap

func (*RuneCharSafeMap) Copy

func (_ag *RuneCharSafeMap) Copy() *RuneCharSafeMap

func (*RuneCharSafeMap) Length

func (_ec *RuneCharSafeMap) Length() int

func (*RuneCharSafeMap) Range

func (_dg *RuneCharSafeMap) Range(f func(_af rune, _cdaa CharMetrics) (_dgf bool))

func (*RuneCharSafeMap) Read

func (_eg *RuneCharSafeMap) Read(b rune) (CharMetrics, bool)

func (*RuneCharSafeMap) Write

func (_gd *RuneCharSafeMap) Write(b rune, r CharMetrics)

type StdFont

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

func NewStdFont

func NewStdFont(desc Descriptor, metrics *RuneCharSafeMap) StdFont

func NewStdFontByName

func NewStdFontByName(name StdFontName) (StdFont, bool)

func NewStdFontWithEncoding

func NewStdFontWithEncoding(desc Descriptor, metrics *RuneCharSafeMap, encoder _f.TextEncoder) StdFont

func (StdFont) Descriptor

func (_gde StdFont) Descriptor() Descriptor

func (StdFont) Encoder

func (_egb StdFont) Encoder() _f.TextEncoder

func (StdFont) GetMetricsTable

func (_cef StdFont) GetMetricsTable() *RuneCharSafeMap

func (StdFont) GetRuneMetrics

func (_gc StdFont) GetRuneMetrics(r rune) (CharMetrics, bool)

func (StdFont) Name

func (_dfcg StdFont) Name() string

func (StdFont) ToPdfObject

func (_gb StdFont) ToPdfObject() _bg.PdfObject

type StdFontName

type StdFontName string

type TtfType

type TtfType struct {
	UnitsPerEm             uint16
	PostScriptName         string
	Bold                   bool
	ItalicAngle            float64
	IsFixedPitch           bool
	TypoAscender           int16
	TypoDescender          int16
	UnderlinePosition      int16
	UnderlineThickness     int16
	Xmin, Ymin, Xmax, Ymax int16
	CapHeight              int16
	Widths                 []uint16
	Chars                  map[rune]GID
	GlyphNames             []GlyphName
}

func NewFontFile2FromPdfObject

func NewFontFile2FromPdfObject(obj _bg.PdfObject) (TtfType, error)

func TtfParse

func TtfParse(r _ef.ReadSeeker) (TtfType, error)

func TtfParseFile

func TtfParseFile(fileStr string) (TtfType, error)

func (*TtfType) MakeEncoder

func (_gaec *TtfType) MakeEncoder() (_f.SimpleEncoder, error)

func (*TtfType) MakeToUnicode

func (_baa *TtfType) MakeToUnicode() *_a.CMap

func (*TtfType) NewEncoder

func (_ccc *TtfType) NewEncoder() _f.TextEncoder

func (*TtfType) String

func (_dbc *TtfType) String() string

Jump to

Keyboard shortcuts

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