name

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Overview

Package name reads and writes "name" tables. These tables contain localized strings associated with a font. https://docs.microsoft.com/en-us/typography/opentype/spec/name

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

type ID uint16

ID encodes the meaning of a given name string. https://learn.microsoft.com/en-us/typography/opentype/spec/name#name-ids

type Info

type Info struct {
	Mac     Tables
	Windows Tables
}

Info contains information from the "name" table.

func Decode

func Decode(data []byte) (*Info, error)

Decode extracts information from the "name" table.

func (*Info) Encode

func (info *Info) Encode(windowsEncodingID uint16) []byte

Encode converts a "name" table into its binary form.

type Table

type Table struct {
	Copyright                string
	Family                   string
	Subfamily                string
	Identifier               string
	FullName                 string
	Version                  string
	PostScriptName           string
	Trademark                string
	Manufacturer             string
	Designer                 string
	Description              string
	VendorURL                string
	DesignerURL              string
	License                  string
	LicenseURL               string
	TypographicFamily        string
	TypographicSubfamily     string
	MacFullName              string
	SampleText               string
	CIDFontName              string
	WWSFamily                string
	WWSSubfamily             string
	LightBackgroundPalette   string
	DarkBackgroundPalette    string
	VariationsPostScriptName string

	Extra map[ID]string
}

Table contains the name table data for a single language

func (*Table) String

func (t *Table) String() string

type Tables

type Tables map[string]*Table

Tables contains the information from a "name" table.

func (Tables) Choose

func (tt Tables) Choose(prefs ...language.Tag) (*Table, language.Confidence)

Choose select the table which best matches the given language preferences.

Jump to

Keyboard shortcuts

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