textlayout

module
v0.0.0-...-b7ff752 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT

README

Text layout library for Golang Go Reference

This module provides a chain of tools to layout text. It is mainly a port of the C libraries harfbuzz and graphite.

Project structure update

This repository is a shallow copy of https://github.com/benoitkugler/textlayout. All credits go to Benoit KUGLER and others (see the detailed history).

As of v0.1.0, the content of this repository has been split, with higher level, more experimental packages moved to textprocessing.

The remaining packages are the more stable, low level logic used by go-text.

As of v0.1.1, the font files only used for internal tests have been moved in a separate module, so that regular builds do not have to download these large files (this requires go1.17 for module lazy loading).

Overview

The package fonts provides the low level primitives to load and read font files. Once a font is selected, harfbuzz is responsible for laying out a line of text, that is transforming a sequence of unicode points (runes) to a sequence of positioned glyphs. Graphite fonts are supported via the graphite package. Some higher level library may wrap these tools to provide an interface capable of laying out an entire text.

Status of the project

This project is a work in progress. Some parts of it are already usable : fonts/truetype, harfbuzz and graphite, but breaking changes may be committed on the fly.

Licensing

This module is provided under the MIT license.

Directories

Path Synopsis
Package fonts provides supports for parsing several font formats (postscript, bitmap and truetype) and provides a common API, inspired by freetype.
Package fonts provides supports for parsing several font formats (postscript, bitmap and truetype) and provides a common API, inspired by freetype.
binaryreader
Package binaryreader provides a convenient reader to decode (big endian) binary content.
Package binaryreader provides a convenient reader to decode (big endian) binary content.
bitmap
Package bitmap provides support for bitmap fonts found in .pcf files.
Package bitmap provides support for bitmap fonts found in .pcf files.
glyphsnames
copied from https://git.maze.io/go/unipdf/src/branch/master/internal/textencoding
copied from https://git.maze.io/go/unipdf/src/branch/master/internal/textencoding
psinterpreter
Package psinterpreter implements a Postscript interpreter required to parse .CFF files, and Type1 and Type2 Charstrings.
Package psinterpreter implements a Postscript interpreter required to parse .CFF files, and Type1 and Type2 Charstrings.
simpleencodings
Simple encodings map a subset of the unicode characters (at most 256) to a set of single bytes.
Simple encodings map a subset of the unicode characters (at most 256) to a set of single bytes.
truetype
Package truetype provides support for OpenType and TrueType font formats, used in PDF.
Package truetype provides support for OpenType and TrueType font formats, used in PDF.
type1
Package type1 implements a parser for Adobe Type1 fonts, defined by .afm files (https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5004.AFM_Spec.pdf) and .pdf files (https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/T1_SPEC.pdf)
Package type1 implements a parser for Adobe Type1 fonts, defined by .afm files (https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5004.AFM_Spec.pdf) and .pdf files (https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/T1_SPEC.pdf)
Package graphite Graphite implements a "smart font" system developed specifically to handle the complexities of lesser-known languages of the world.
Package graphite Graphite implements a "smart font" system developed specifically to handle the complexities of lesser-known languages of the world.
Package harfbuzz provides advanced text layout for various scripts and languages, with font-aware substitutions and positioning.
Package harfbuzz provides advanced text layout for various scripts and languages, with font-aware substitutions and positioning.
langs
Generator of the mapping from OpenType tags to BCP 47 tags && vice versa.
Generator of the mapping from OpenType tags to BCP 47 tags && vice versa.
Package unicodedata provides additional lookup functions for unicode properties, not covered by the standard package unicode.
Package unicodedata provides additional lookup functions for unicode properties, not covered by the standard package unicode.
generate
Generate lookup function for Unicode properties not covered by the standard package unicode.
Generate lookup function for Unicode properties not covered by the standard package unicode.

Jump to

Keyboard shortcuts

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