https://github.com/benoitkugler/textlayout
Fonts and text layout for Golang
https://github.com/benoitkugler/textlayout
fonts golang text-layout
Last synced: 4 months ago
JSON representation
Fonts and text layout for Golang
- Host: GitHub
- URL: https://github.com/benoitkugler/textlayout
- Owner: benoitkugler
- License: mit
- Created: 2021-01-16T14:13:44.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-11-26T10:17:56.000Z (over 1 year ago)
- Last Synced: 2025-10-26T19:59:58.498Z (8 months ago)
- Topics: fonts, golang, text-layout
- Language: Go
- Homepage:
- Size: 118 MB
- Stars: 53
- Watchers: 7
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Text layout library for Golang [](https://pkg.go.dev/github.com/benoitkugler/textlayout)
This module provides a chain of tools to layout text. It is mainly a port of the C libraries harfbuzz and graphite.
## Project superseded
This project has been merged into [go-text/typesetting](https://github.com/go-text/typesetting) and this repository will not be maintained anymore : developpement will happen in the go-text repo. All users should use go-text instead, unless they require support for old Type1 or Linux Bitmap fonts.
## Project structure update
As of v0.1.0, the content of this repository has been split, with higher level, more experimental packages moved to [textprocessing](https://github.com/benoitkugler/textprocessing).
The remaining packages are the more stable, low level logic used by [go-text](https://github.com/go-text/typesetting).
As of v0.1.1, the font files only used for internal tests have been moved in a [separate module](https://github.com/benoitkugler/textlayout-testdata), so that regular builds do not have to download these large files (this requires go1.17 for module lazy loading).
## Overview
The package [fonts](fonts) provides the low level primitives to load and read font files. Once a font is selected, [harfbuzz](harfbuzz) is responsible for laying out a line of text, that is transforming a sequence of unicode points (runes) to a sequence of positionned glyphs. Graphite fonts are supported via the [graphite](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](fonts/truetype), [harfbuzz](harfbuzz) and [graphite](graphite), but breaking changes may be committed on the fly.
## Licensing
This module is provided under the MIT license.