embed

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: 9 Imported by: 0

Documentation

Overview

Package embed provides convenience functions to embed fonts into a PDF file.

The package supports the following font types:

  • OpenType fonts (.otf files)
  • TrueType fonts (.ttf files)
  • Type 1 fonts (.pfa or .pfb files, optionally with the corresponding .afm files)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenTypeFile

func OpenTypeFile(w pdf.Putter, fname string, opt *font.Options) (font.Layouter, error)

OpenTypeFile loads and embeds an OpenType/TrueType font.

func OpenTypeFont

func OpenTypeFont(w pdf.Putter, info *sfnt.Font, opt *font.Options) (font.Layouter, error)

OpenTypeFont embeds an OpenType/TrueType font.

func Type1File

func Type1File(w pdf.Putter, psname, afmname string, opt *font.Options) (font.Layouter, error)

Type1File loads and embeds a Type 1 font. The file `psname` can be either an .pfb or .pfa file. The file `afmname` is the corresponding .afm file. Both `psname` and `afmname` are optional, but at least one of them must be given.

func Type1Font

func Type1Font(w pdf.Putter, psFont *pst1.Font, metrics *afm.Metrics, opt *font.Options) (font.Layouter, error)

Type1Font embeds a Type 1 font. The `psFont` and `metrics` parameters are optional, but at least one of them must be given.

Types

This section is empty.

Jump to

Keyboard shortcuts

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