Converts fonts to TypeScript objects
Project description
TypeScript Font Converter
Converts fonts to TypeScript objects
This library:
- Imports OpenType and TrueType fonts
- Extracts metadata from the naming table
- Extracts a list of glyphs and their unicode character ID
Encodes the font file as a base64-encoded DataURI(will be implemented in #7)- Saves all this in Python objects
- Serializes the Python Objects in a JSON file
Exports TypeScript definitions of the objects(will be implemented in #9)
But Why?
This library exists to embed fonts into web pages using SSR-frameworks such as Next.js and to more easily gain information about the font.
It was initially part of the ThorType website where I use the TypeScript definition and the corresponding JSON-data to showcase my fonts and save all of that data as part of a static website.
It's released as a Python lib so that the tooling for the ThorType-website is separated and generalised to be reused in any TypeScript or JavaScript web framework.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tsfontconverter-0.24.tar.gz
(12.1 kB
view hashes)
Built Distribution
Close
Hashes for tsfontconverter-0.24-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba06f3f98e20aabd83a701cebbf53270c6c595060be72bee319e6e6be7d7505e |
|
MD5 | be042f65725fe7af356a180d08d833c4 |
|
BLAKE2b-256 | 03f4ce55a859175f32108c4c9768d23e6d7b04ba2e6e45391e676ee5524a4d79 |