builtin

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package builtin implements support for the 14 built-in PDF fonts.

Index

Constants

View Source
const (
	Courier              = "Courier"
	CourierBold          = "Courier-Bold"
	CourierBoldOblique   = "Courier-BoldOblique"
	CourierOblique       = "Courier-Oblique"
	Helvetica            = "Helvetica"
	HelveticaBold        = "Helvetica-Bold"
	HelveticaBoldOblique = "Helvetica-BoldOblique"
	HelveticaOblique     = "Helvetica-Oblique"
	TimesRoman           = "Times-Roman"
	TimesBold            = "Times-Bold"
	TimesBoldItalic      = "Times-BoldItalic"
	TimesItalic          = "Times-Italic"
	Symbol               = "Symbol"
	ZapfDingbats         = "ZapfDingbats"
)

The names of the 14 built-in PDF fonts. These are the valid arguments for the Afm() function.

Variables

FontNames contains the names of the 14 built-in PDF fonts.

Functions

func Afm

func Afm(fontName string) (*afm.Info, error)

Afm returns the font metrics for one of the built-in pdf fonts. FontName must be one of the names listed in FontNames.

func Embed

func Embed(w pdf.Putter, fontName string, resName pdf.Name) (font.Embedded, error)

Embed loads one of the 14 builtin fonts and embeds it into a PDF file. The valid font names are given in FontNames.

func EmbedAfm

func EmbedAfm(w pdf.Putter, afm *afm.Info, resName pdf.Name) (font.Embedded, error)

EmbedAfm loads a simple Type 1 font described by `afm` and embeds it into a PDF file.

func Font added in v0.2.0

func Font(fontName string) (font.Font, error)

Font returns a Font structure representing one of the 14 builtin fonts. The valid font names are given in FontNames.

func FontAfm added in v0.2.0

func FontAfm(afm *afm.Info) (font.Font, error)

FontAfm returns a Font structure representing a simple Type 1 font, described by `afm`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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