Skip to main content

vfbLib

Converter and deserializer for FontLab Studio 5 VFB files.

FontLab’s own vfb2ufo converter is from 2015, only outputs UFO v2, and contains serious bugs that are never going to be fixed. Its support on macOS is subject to Apple’s mercy (no native support for Apple Silicon).

That’s why in 2022 a single determined programmer, me, Jens Kutílek, armed with nothing but a hex editor set out to rectify this situation. In late 2025, Yuri Yarmola let me have a look at the original VFB code from FontLab. I am very grateful for his kindness. Without Yuri’s help, I would probably never have figured out some parts of the format.

The VFB file format is described in FILEFORMAT.

Improvements Over vfb2ufo

  • Outputs normalized UFO v3
  • Outputs FontLab user data (font and glyph level)
  • Mark colors are written to the official UFO v3 lib key
  • Guideline data is written to the official UFO v3 elements
  • Anchors are preserved in composite glyphs
  • PostScript hinting is written correctly, but to the Adobe lib key
  • TrueType hinting is supported in composite glyphs
  • Supports more UFO font info attributes

Command Line Script Usage

vfb3ufo

Convert a VFB to one UFO per master. Command line options are compatible to FontLab’s vfb2ufo, but not all of them are implemented yet.

$ vfb3ufo MyFile.vfb

will convert the file to MyFile.ufo in the same directory. Existing files will not be overwritten unless you specify the -fo option.

vfb3ufo -h
usage: vfb3ufo [-h] [-p PATH] [-fo] [-g] [-j] [-k] [-ttx] [-64] [-s] [-n] [-nops] [-v] [-z] [-m]
               inputpath [outputpath]

vfb3ufo Converter Copyright (c) 2026 by LucasFonts

positional arguments:
  inputpath             input file path (.vfb)
  outputpath            output file path (.ufo[z])

options:
  -h, --help            show this help message and exit
  -p, --path PATH       output folder
  -fo, --force-overwrite
                        force overwrite
  -g, --keep-groups     don't move non-kerning groups from groups.plist to feature code
  -j, --json            serialize UFO as JSON; combine with -z to write JSON without line breaks/indentation
  -k, --add-kerning-groups
                        add kerning groups to feature code
  -64, --base64         write GLIF lib 'data' section using base64
  -s, --silent          no display (silent mode)
  -n, --no-normalize    don't normalize the UFOs (faster)
  -nops, --no-postscript-hints
                        Don't output PostScript hinting
  -v, --verbose         Log debugging output
  -z, --zip             write UFOZ (compressed UFO)
  -m, --minimal         parse only minimal amount of data, drop missing glyphs from groups, etc.

Options not implemented here, but present in the original vfb2ufo:

  -ttx, --ttx           convert binary OpenType Layout data using TTX-like format

vfb2json

Generate a representation that closely adheres to the VFB structure.

$ vfb2json MyFile.vfb

will convert the file to MyFile.vfb.json in the same directory. Existing files will be overwritten. This is probably mostly useful for debugging purposes.

vfb2json -h
usage: vfb2json [-h] [-d] [--header] [-m] [-p PATH] [-r] [-v] inputpath

vfb2json Converter Copyright (c) 2026 by LucasFonts

positional arguments:
  inputpath           input file path (.vfb)

options:
  -h, --help          show this help message and exit
  -d, --no-decompile  don't decompile data, output binary in JSON
  --header            only read the VFB header, not the actual data
  -m, --minimal       parse only minimal amount of data
  -p, --path PATH     output folder
  -r, --roundtrip     roundtrip data by decompiling and compiling again before saving
  -v, --verbose       Log debugging output

vfb2tth

Export the TrueType hinting from a VFB in a custom format, either as JSON (default), TOML, or YAML.

$ vfb2tth MyFile.vfb

To make the TOML and YAML output options available, you must install with extras vfblib[toml] or vfblib[yaml], respectively.

usage: vfb2tth [-h] [-f FORMAT] [-p PATH] inputpath

vfb2tth Converter Copyright (c) 2024 by LucasFonts

positional arguments:
  inputpath            input file path (.vfb)

options:
  -h, --help           show this help message and exit
  -f, --format FORMAT  The output format: json (default), toml, or yaml
  -p, --path PATH      output folder

vfbcu2qu

Convert a VFB file to quadratic using the cu2qu library.

$ vfbcu2qu MyFile.vfb

will convert the file and save it with the suffix .qu.vfb in the same directory.

vfbcu2qu -h
usage: vfbcu2qu [-h] [-p PATH] [-fo] [-m MAX_ERR_EM] inputpath [outputpath]

VFB Cubic to Quadratic Converter Copyright (c) 2023 by LucasFonts

positional arguments:
  inputpath             input file path (.vfb)
  outputpath            output file path (.vfb)

options:
  -h, --help            show this help message and exit
  -p, --path PATH       output folder
  -fo, --force-overwrite
                        force overwrite
  -m, --max-err-em MAX_ERR_EM
                        Maximum allowed error, relative to the font's units per em. Default is 0.001.

vfbdiff

Generate a diff of two VFB files, either in unified diff or HTML format (extremely slow!).

vfbdiff -h
usage: vfbdiff [-h] [--html HTML] file1 file2

vfbdiff Copyright (c) 2024 by LucasFonts

positional arguments:
  file1        First input file path (.vfb)
  file2        Second input file path (.vfb)

options:
  -h, --help   show this help message and exit
  --html HTML  Output diff in HTML format to file path

yuri

A helper tool to decode from/encode to the "encoded value" format used throughout the VFB binary data.

$ yuri -e 1 23
8ca2
yuri -h
usage: yuri [-h] [-e] [-l] [-s] hexstring [hexstring ...]

Decode and encode VFB/Type1 'encoded values'

positional arguments:
  hexstring     Input hex string

options:
  -h, --help    show this help message and exit
  -e, --encode  Encode value instead of decoding
  -l, --long    Output longest notation when encoding
  -s, --signed  Treat value as signed

Python Support Policy

We like to drop unsupported Python versions early. Python 3.11 support remains for now, because it is the standard version of Python supported out of the box in Glyphs 3. Other than that, vfbLib is tested in Python 3.13 to 3.15.

History

FontLab’s own vfb2ufo converter is from 2015, only outputs UFO v2, and contains serious bugs that are never going to be fixed. Its support on macOS is subject to Apple’s mercy (no native support for Apple Silicon).

That’s why in 2022 a single determined programmer, me, Jens Kutílek, armed with nothing but a hex editor set out to rectify this situation. In late 2025, Yuri Yarmola let me have a look at the original VFB code from FontLab. I am very grateful for his kindness. Without Yuri’s help, I would probably never have figured out some parts of the format.

© 2022-2026 by LucasFonts GmbH, Berlin

Metadata

Release files for vfbLib 0.12.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vfbLib 0.12.1
File Size Uploaded
vfblib-0.12.1.tar.gz 100.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vfbLib 0.12.1
File Interpreter ABI Platform
vfblib-0.12.1-py3-none-any.whl Python 3 none any Details

Total release size: 224.9 kB

Release files / vfblib-0.12.1.tar.gz

Download URL vfblib-0.12.1.tar.gz
Size 100.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b7f81fecd159407d7d941b2a80eef6e8cede1fad303c7930ef7d20e0f51a09b2
BLAKE2b-256 checksum
How to use checksums
79afee3e16ba1df303ff51f52f862739195e9fa6655cf825bcd576119bbd868b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / vfblib-0.12.1-py3-none-any.whl

Download URL vfblib-0.12.1-py3-none-any.whl
Size 124.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d3251574b6ebdd4ed09fa249d0d168a41b5a6396e85543862f6997069e3ca80
BLAKE2b-256 checksum
How to use checksums
2f58054031b57816d724b113cb59874e28968132814b93a7fba422631b35da4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.12.1 This release

2 release files

0.12.0

2 release files

0.11.7

2 release files

0.11.5

2 release files

0.11.4

2 release files

0.11.3

2 release files

0.11.2

2 release files

0.11.0

2 release files

0.10.4

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page