otquery

package
v0.1.0-experimental.3 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package otquery queries metrics and other information from OpenType fonts.

Package otquery provides functions to query layout information from a font. It knows about the various tables contained in OpenType fonts and which ones to address for queries. Clients of this package will, amongst other, be:

▪︎ text shapers, such as HarfBuzz (https://harfbuzz.github.io/what-does-harfbuzz-do.html)

▪︎ glyph rasterizers, such as FreeType (https://github.com/golang/freetype)

Status

Work in progress. Handling fonts is fiddly and fonts have become complex software applications in their own right. I often need a break from the vast desert of bytes (without any sign posts), which is what font data files are at their core. Breaks, where I talk to myself and ask, this is what you do in your spare time? Really?

No font collections nor variable fonts are supported yet.

License

Governed by a 3-Clause BSD license. License file may be found in the root folder of this module.

Copyright © 2017–2021 Norbert Pillmayer <norbert@pillmayer.com>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FontType

func FontType(otf *ot.Font) string

FontType returns the font type, encoded in the font header, as a string.

func LayoutTables

func LayoutTables(otf *ot.Font) []string

LayoutTables returns a list of tag strings, one for each layout-table a font includes.

From the spec: OpenType Layout makes use of five tables: GSUB, GPOS, BASE, JSTF, and GDEF.

func NameInfo

func NameInfo(otf *ot.Font, lang language.Tag) map[string]string

NameInfo returns a map with selected fields from OpenType table `name`. Will include (if available in the font) "family", "subfamily", "version".

Parameter `lang` is currently unused.

func SupportsScript

func SupportsScript(otf *ot.Font, scr language.Script) (string, string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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