package opentype
Import Path
github.com/go-text/typesetting/font/opentype (on go.dev)
Dependency Relation
imports 7 packages, and imported by 6 packages
Involved Source Files
Package opentype provides the low level routines
required to read and write Opentype font files, including collections.
This package is designed to provide an efficient, lazy, reading API.
For the parsing of the various tables, see package [tables].
reader.go
reader_otf.go
reader_woff.go
writer.go
Package-Level Type Names (total 9)
func github.com/go-text/typesetting/font/cff.(*CFF).GlyphName(glyph GID) string
const github.com/go-text/typesetting/font.EmptyGlyph
// Distance from top to bottom side
// Distance from left to right side
// Left side of glyph from origin
// Top side of glyph from origin
func github.com/go-text/typesetting/font/cff/interpreter.(*PathBounds).ToExtents() GlyphExtents
Loader is the low level font reader, providing
full control over table loading.
Type represents the kind of this font being loaded.
It is one of TrueType, TrueTypeApple, PostScript1, OpenType
HasTable returns true if [table] is present.
RawTable returns the binary content of the given table,
or an error if not found.
RawTable writes the binary content of the given table to [dst], returning it,
or an error if not found.
Tables returns all the tables found in the file,
as a sorted slice.
func NewLoader(file Resource) (*Loader, error)
func NewLoaders(file Resource) ([]*Loader, error)
func github.com/go-text/typesetting/font.Describe(ld *Loader, buffer []byte) (font.Description, []byte)
func github.com/go-text/typesetting/font.LoadHeadTable(ld *Loader, buffer []byte) (tables.Head, []byte, error)
func github.com/go-text/typesetting/font.NewFont(ld *Loader) (*font.Font, error)
( Resource) Read([]byte) (int, error)
( Resource) ReadAt([]byte, int64) (int, error)
( Resource) Seek(int64, int) (int64, error)
github.com/apache/arrow-go/v18/arrow/ipc.ReadAtSeeker (interface)
github.com/apache/arrow-go/v18/internal/utils.Reader (interface)
github.com/coreos/etcd/pkg/fileutil.LockedFile
*github.com/klauspost/compress/s2.ReadSeeker
*github.com/polarsignals/wal/fs.File
*bytes.Reader
*io.SectionReader
mime/multipart.File (interface)
*os.File
*strings.Reader
Resource : github.com/apache/arrow-go/v18/arrow/ipc.ReadAtSeeker
Resource : github.com/apache/arrow-go/v18/internal/utils.Reader
Resource : github.com/apache/arrow-go/v18/parquet.ReaderAtSeeker
Resource : io.Reader
Resource : io.ReaderAt
Resource : io.ReadSeeker
Resource : io.Seeker
func NewLoader(file Resource) (*Loader, error)
func NewLoaders(file Resource) ([]*Loader, error)
Args is up to three (x, y) coordinates, depending on the
operation.
The Y axis increases up.
Op SegmentOp
ArgsSlice returns the effective slice of points
used (whose length is between 1 and 3).
func github.com/go-text/typesetting/font/cff.(*CFF).LoadGlyph(glyph tables.GlyphID) ([]Segment, ps.PathBounds, error)
func github.com/go-text/typesetting/font/cff.(*CFF2).LoadGlyph(glyph tables.GlyphID, coords []tables.Coord) ([]Segment, ps.PathBounds, error)
const SegmentOpCubeTo
const SegmentOpLineTo
const SegmentOpMoveTo
const SegmentOpQuadTo
// expressed in fonts units
// expressed in fonts units
Move translates the point.
func (*Segment).ArgsSlice() []SegmentPoint
Table is one opentype binary table and its tag.
Content []byte
Tag Tag
func WriteTTF(tables []Table) []byte
String return the ASCII form of the tag.
Tag : expvar.Var
Tag : fmt.Stringer
func MustNewTag(str string) Tag
func NewTag(a, b, c, d byte) Tag
func (*Loader).Tables() []Tag
func (*Loader).HasTable(table Tag) bool
func (*Loader).RawTable(tag Tag) ([]byte, error)
func (*Loader).RawTableTo(tag Tag, dst []byte) ([]byte, error)
var AppleTrueType
var OpenType
var PostScript1
var TrueType
Package-Level Functions (total 5)
MustNewTag gives you the Tag corresponding to the acronym.
This function will panic if the string passed in is not 4 bytes long.
NewLoader reads the `file` header and returns
a new lazy ot.
`file` will be used to parse tables, and should not be close.
NewLoaders is the same as `NewLoader`, but supports collections.
NewTag returns the tag for <abcd>.
WriteTTF creates a single Truetype font file (.ttf) from the given [tables] slice,
which must be sorted by Tag
Package-Level Variables (total 4)
AppleTrueType is the first four bytes of an OpenType file containing a TrueType font
(specifically one designed for Apple products, it's recommended to use TrueType instead)
OpenType is the first four bytes of an OpenType file containing a PostScript Type 2 font
as specified by OpenType
PostScript1 is the first four bytes of an OpenType file containing a PostScript 1 font
TrueType is the first four bytes of an OpenType file containing a TrueType font
Package-Level Constants (total 4)
const SegmentOpCubeTo SegmentOp = 3 const SegmentOpLineTo SegmentOp = 1 const SegmentOpMoveTo SegmentOp = 0 const SegmentOpQuadTo SegmentOp = 2
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |