fonttypes

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CFF is a CFF font without CIDFont operators.
	CFF font.Font = cffEmbedder(0)

	// CFFCID is a CFF font with CIDFont operators.
	CFFCID font.Font = cffEmbedder(1)

	// CFFCID2 is a CFF font with CIDFont operators and multiple private
	// dictionaries.
	CFFCID2 font.Font = cffEmbedder(2)
)

CFF fonts

View Source
var (
	// OpenTypeGlyf is an OpenType font with glyph outlines.
	OpenTypeGlyf font.Font = openTypeEmbedder(0)

	// OpenTypeCFF is an OpenType font with CFF outlines and no CIDFont
	// operators.
	OpenTypeCFF font.Font = openTypeEmbedder(1)

	// OpenTypeCFFCID is an OpenType font with CFF outlines and CIDFont
	// operators.
	OpenTypeCFFCID font.Font = openTypeEmbedder(2)

	// OpenTypeCFFCID2 is an OpenType font with CFF outlines, CIDFont
	// operators, and multiple private dictionaries.
	OpenTypeCFFCID2 font.Font = openTypeEmbedder(3)
)

OpenType fonts

View Source
var All = []*Sample{
	{
		Label:       "CFFSimple1",
		Description: "a simple CFF font",
		Type:        font.CFFSimple,
		Font:        CFF,
	},
	{
		Label:       "CFFSimple2",
		Description: "a simple CFF font (with CIDFont operators)",
		Type:        font.CFFSimple,
		Font:        CFFCID,
	},
	{
		Label:       "OpenTypeCFFSimple1",
		Description: "a simple OpenType/CFF font",
		Type:        font.OpenTypeCFFSimple,
		Font:        OpenTypeCFF,
	},
	{
		Label:       "OpenTypeCFFSimple2",
		Description: "a simple OpenType/CFF font (with CIDFont operators)",
		Type:        font.OpenTypeCFFSimple,
		Font:        OpenTypeCFFCID,
	},
	{
		Label:       "TrueTypeSimple",
		Description: "a simple TrueType font",
		Type:        font.TrueTypeSimple,
		Font:        TrueType,
	},
	{
		Label:       "OpenTypeGlyfSimple",
		Description: "a simple OpenType/Glyf font",
		Type:        font.OpenTypeGlyfSimple,
		Font:        OpenTypeGlyf,
	},
	{
		Label:       "BuiltIn",
		Description: "a built-in Type 1 font",
		Type:        font.Type1,
		Font:        type1.Helvetica,
	},
	{
		Label:       "Type1",
		Description: "an embedded Type 1 font",
		Type:        font.Type1,
		Font:        Type1,
	},
	{
		Label:       "Type3",
		Description: "a Type 3 font",
		Type:        font.Type3,
		Font:        Type3,
	},

	{
		Label:       "CFFComposite1",
		Description: "a composite CFF font",
		Type:        font.CFFComposite,
		Font:        CFF,
	},
	{
		Label:       "CFFComposite2",
		Description: "a composite CFF font (with CIDFont operators)",
		Type:        font.CFFComposite,
		Font:        CFFCID,
	},
	{
		Label:       "CFFComposite3",
		Description: "a composite CFF font (CIDFont operators and 2 private dicts)",
		Type:        font.CFFComposite,
		Font:        CFFCID2,
	},
	{
		Label:       "OpenTypeCFFComposite1",
		Description: "a composite OpenType/CFF font",
		Type:        font.OpenTypeCFFComposite,
		Font:        OpenTypeCFF,
	},
	{
		Label:       "OpenTypeCFFComposite2",
		Description: "a composite OpenType/CFF font (with CIDFont operators)",
		Type:        font.OpenTypeCFFComposite,
		Font:        OpenTypeCFFCID,
	},
	{
		Label:       "OpenTypeCFFComposite3",
		Description: "a composite OpenType/CFF font (CIDFont operators and 2 private dicts)",
		Type:        font.OpenTypeCFFComposite,
		Font:        OpenTypeCFFCID2,
	},
	{
		Label:       "TrueTypeComposite",
		Description: "a composite TrueType font",
		Type:        font.TrueTypeComposite,
		Font:        TrueType,
	},
	{
		Label:       "OpenTypeGlyfComposite",
		Description: "a composite OpenType/Glyf font",
		Type:        font.OpenTypeGlyfComposite,
		Font:        OpenTypeGlyf,
	},
}

All is a list of example fonts, covering all supported font and embedding types.

View Source
var TrueType font.Font = trueTypeEmbedder{}

TrueType is a TrueType font.

View Source
var Type1 = &type1embedder{}

Type1 is a Type 1 PDF font.

View Source
var Type3 = &type3embedder{}

Functions

This section is empty.

Types

type Sample

type Sample struct {
	Label       string
	Description string
	Type        font.EmbeddingType
	Font        font.Font
}

Sample is an example of a font of the given [EmbeddingType].

func (*Sample) Embed

func (f *Sample) Embed(w pdf.Putter, opt *font.Options) (font.Layouter, error)

Embed implements the font.Font interface.

Jump to

Keyboard shortcuts

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