tfm

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package tfm implements a decoder for TFM (TeX Font Metrics) files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Font

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

Font is a TeX Font metrics.

func Parse

func Parse(r io.Reader) (Font, error)

Parse parses a TFM file.

func (*Font) CodingScheme

func (fnt *Font) CodingScheme() string

func (*Font) DesignSize

func (fnt *Font) DesignSize() Int12_20

func (*Font) GlyphIndex

func (fnt *Font) GlyphIndex(x rune) GlyphIndex

GlyphIndex returns the GlyphIndex for the given rune.

GlyphIndex returns -1 if there is no such rune.

func (*Font) MarshalText

func (fnt *Font) MarshalText() ([]byte, error)

func (*Font) Name

func (fnt *Font) Name() string

func (*Font) NumGlyphs

func (fnt *Font) NumGlyphs() int

NumGlyphs returns the number of glyphs in this font.

type GlyphIndex

type GlyphIndex int

GlyphIndex is a glyph index in a Font.

type Int12_20

type Int12_20 uint32

Int12_20 is a signed 26.6 fixed-point number.

The integer part ranges from -2048 to 2047, inclusive. The fractional part has 20 bits of precision.

func (Int12_20) Float64

func (x Int12_20) Float64() float64

func (Int12_20) String

func (x Int12_20) String() string

String returns a human-readable representation of a 12.20 fixed-point number.

Jump to

Keyboard shortcuts

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