Questions tagged [ttx-fonttools]

TTX is a tool to convert OpenType and TrueType fonts to and from XML. FontTools is the Python library which implements TTX as well as some other font manipulation tools. It supports TrueType, OpenType, AFM and to an extent Type 1 and some Mac-specific formats. Use this tag for questions about manipulating fonts with these tools.

TTX/FontTools

TTX/FontTools is a suite of tools written in Python for manipulating fonts.

The flagship is TTX, a tool to convert OpenType and TrueType font files to an XML-based format (also called TTX), and back. This lets you edit TTF or OTF files with any text editor.

The FontTools library currently reads and writes TrueType font files, and reads font files of several other types, including PostScript Type 1.

The project uses the MIT License, as published by the Open Source Initiative.

Table of Contents

27 questions
6
votes
3 answers

fonttools convert ttf to woff2

Currenly, I'm using fonttools(https://github.com/fonttools/fonttools) to convert font file ttf to woff2 by ttx command with 2 steps convert ttf to ttx then convert ttx to woff2 But it's too slow and ttx file to big, is there any way to convert ttf…
Quan Vo
  • 1,639
  • 2
  • 13
  • 28
6
votes
1 answer

Rename ttf/woff/woff2 file to PostScript Font Name with Script

I am a typographer working with many fonts that have incorrect or incomplete filenames. I am on a Mac and have been using Hazel, AppleScript, and Automator workflows, attempting to automate renaming these files*. I require a script to replace the…
Moscarda
  • 373
  • 4
  • 14
4
votes
2 answers

How to compare OpenType fonts with different weight to see if they are the same?

I have a bunch of OpenType font files with different weights and style (For example, ComicSans100.otf, ComicSans200.otf, ComicSans300.otf and TimeNewRoman.otf and TimesNewRomanItalic.otf). The person who provided me these files wasn't sure if the…
Thierry Roy
  • 8,452
  • 10
  • 60
  • 84
4
votes
2 answers

How to read and print the contents of a ttf file?

Is there any way that I can open, read and write a ttf file? Example: with open('xyz.ttf') as f: content = f.readline() print(content) A bit more: If I open a .ttf (font) file with windows font viewer we see the following image From this…
Md. Zakir Hossan
  • 517
  • 2
  • 6
  • 17
3
votes
1 answer

Creating a lightweight fallback font with fontforge and fonttools

For a webapp I need a way to prevent that a browser falls back to another font if my web font doesn't include a character. It seems the only way to do this is to add another font to the fontstack which includes "all" possible characters 1. There…
tobltobs
  • 2,782
  • 1
  • 27
  • 33
2
votes
1 answer

FontTools: extracting useful UTF information provided by it

FontTools is producing some XML with all sorts of details in this structure