Metadata-Version: 2.3
Name: ft-converter
Version: 1.0.1
Summary: A free and open-source font converter GUI application written in Python.
Author: Cesare Gilento
Author-email: Cesare Gilento <ftCLI@proton.me>
Requires-Dist: cffsubr>=0.4.0
Requires-Dist: fonttools[pathops,woff]==4.68.0
Requires-Dist: pathvalidate>=3.3.1
Requires-Dist: pyside6>=6.8
Requires-Dist: ttfautohint-py>=0.6.1
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# Font Converter

<img width="150" height="150" alt="FT-Logo-Black-B" src="https://github.com/user-attachments/assets/501a3254-9d16-4811-bca0-62f42d84d213" />

Font Converter is a native desktop application for converting font files. It provides a graphical
interface for selecting fonts, choosing conversion options, and monitoring  batch conversions.

<img width="1481" height="1014" alt="image" src="https://github.com/user-attachments/assets/a90972c3-cc36-4496-962d-19329d4c56e7" />

## Features

- Convert TrueType flavored fonts to PostScript (TTF → OTF), with optional autohinting.
- Convert PostScript flavored fonts to TrueType (OTF → TTF), with optional subroutinization.
- Convert SFNT fonts (TTF/OTF) to WOFF/WOFF2.
- Convert WOFF/WOFF2 fonts to SFNT (TTF/OTF).
- Extract individual fonts from TrueType Collections (TTC).
- Export instances of variable fonts as static fonts.
- Scan files and folders, with optional recursive scanning and drag-and-drop input.
- Filter incompatible fonts, organize output, pause or cancel conversions, and export logs.

## Requirements

- Python 3.11 or newer.
- A desktop environment supported by Qt for the graphical interface.

## Installation

FT Converter is published on [PyPI](https://pypi.org/project/ft-converter/).

### Install with uv

Install [uv](https://docs.astral.sh/uv/getting-started/installation/) if it is not already
available, then run:

```console
uv tool install ft-converter
ft-converter
```

To run it without installing it permanently, use `uvx ft-converter`. To upgrade, run
`uv tool upgrade ft-converter`.

### Install with pip

Create and activate a virtual environment, then install the package from PyPI.

**Windows (PowerShell):**

```powershell
py -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install ft-converter
ft-converter
```

If PowerShell prevents virtual-environment activation, see Microsoft's documentation on
[PowerShell execution policies](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_execution_policies).

**macOS and Linux:**

```console
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install ft-converter
ft-converter
```

### Install from source

To work on the project, clone the repository and use uv:

```console
git clone https://github.com/ftCLI/ft-converter.git
cd ft-converter
uv sync
uv run ft-converter
```

## Getting started

A typical conversion takes four steps: choose a profile, add fonts, review the profile-specific
options, and choose where to save the results. The options panel updates automatically when you
change profiles.

### 1. Choose a conversion profile

Select the profile that matches the formats you want to convert:

| Profile                               | Input → output                            | Profile-specific options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
|---------------------------------------|-------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **TrueType → PostScript (TTF → OTF)** | TrueType outlines → PostScript outlines   | **Tolerance** (0.1–3; default 1): controls the accuracy of curve conversion. Lower values allow less deviation. **Set target UPM**: optionally scale the output to a chosen units-per-em value. **Optimize contours** (0–3; default 0 = off, experimental): merges adjacent smooth curves to reduce the number of nodes; the value is the maximum deviation of a merge as a multiple of the Tolerance. **Subroutinize** (on by default): compresses PostScript outlines using shared subroutines.                                                                                                                                                                                                       |
| **PostScript → TrueType (OTF → TTF)** | PostScript outlines → TrueType outlines   | **Tolerance** (0–3; default 1): controls the accuracy of curve conversion. Lower values allow less deviation. **Set target UPM**: optionally scale the output to a chosen units-per-em value. **Autohint** (on by default): adds TrueType hinting instructions.                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **SFNT → WOFF / WOFF2**               | TTF or OTF → WOFF and/or WOFF2            | Choose **WOFF**, **WOFF2**, or both (both by default). **Obfuscate names** replaces the family, full and PostScript names with hashes, also in the file name. **Remove unused glyphs** drops the glyphs not reachable from the character map or the OpenType features. **Remove non-Windows names** removes the `name` records whose platform ID is not 3 (e.g. Macintosh records). **Remove DSIG table** (WOFF only, shown when WOFF is selected) deletes the digital signature table; WOFF2 does not support it, so nothing is needed there. **Create CSS** writes a `fonts.css` file in each output folder with `@font-face` rules and a class for each detected OpenType feature (e.g. `.ft-liga`). |
| **WOFF → SFNT**                       | WOFF → TTF or OTF                         | No additional profile options. The output keeps the font's outline type.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **WOFF2 → SFNT**                      | WOFF2 → TTF or OTF                        | No additional profile options. The output keeps the font's outline type.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **TrueType Collection → SFNT**        | TTC → individual SFNT fonts               | No additional profile options. Each font in the collection is extracted as a separate font.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Variable → Static (instances)**     | Variable font → selected static instances | Choose the instances to export. Select a font or instance and choose **Add custom instance** to enter your own axis values. **Set target UPM** optionally scales the output. **Autohint** applies to TrueType outlines and **Subroutinize** to PostScript outlines; both are on by default when applicable.                                                                                                                                                                                                                                                                                                                                                                                             |

UPM means units per em, the font's design-grid size. When setting a target UPM, the application scales
the font to that value. A non-standard value is allowed, but the application will show a warning.

### 2. Add and select fonts

Choose **Add files…** or **Add folder…**, or drag files and folders onto the input list. When adding a
folder, enable **Recurse subfolders** to scan its subfolders too.

The scanner identifies fonts by their contents, not their file extensions. It can detect fonts with
any extension or no extension; invalid or unreadable files are ignored. Large scans run in the
background. Choose **Stop** to end a scan while keeping the fonts found so far.

The input table shows each font's name, format, outline type, and units per em (UPM). Click a column
header to sort the list. Uncheck any fonts you do not want to convert, or use **Select compatible
fonts** to select or clear all visible compatible entries. Fonts that do not work with the selected
profile are disabled; their tooltip explains why. Choose **Hide incompatible** to remove them from
the list.

For **Variable → Static**, the input area shows variable fonts and their instances. Check the
instances you want to export. Use **Expand all** or **Collapse all** to navigate the list, and the
filter to find fonts or instances. Select a font or instance to add a custom instance; double-click a
custom instance to edit it.

### 3. Choose where to save the results

By default, output files are saved alongside their source files. Choose **Folder** in the **Output**
panel to save them in a different location.

- **Overwrite existing files** controls whether existing output files may be replaced.
- **Organize by profile** creates subfolders for conversion profiles.
- **Organize by family** groups output in folders named for each font family. You can combine this
  with profile organization.

### 4. Review general options and convert

Choose **Advanced settings** to adjust options shared by conversion profiles:

- **Recalculate bounding boxes** rebuilds glyph bounds before saving; enabled by default.
- **Recalculate modified timestamp** sets a fresh font modification timestamp; disabled by default.
- **Reorder tables on save** uses a standard table order for compatibility; enabled by default.

Choose **Convert** to start. The conversion window shows progress and logs. You can pause and resume
the run, or choose **Cancel** to stop after the font currently being processed. Files already saved
remain in place.

When the run finishes, the status reports how many fonts were converted, skipped, or failed. Choose
**Open output folder** to view the results, or **Last run** to review the previous conversion. Logs
are kept in memory for the session and can be exported as JSON Lines with **Save logs**.

Use the theme buttons in the header to switch between light and dark themes. The selected theme is
remembered between launches.

## Development

To install the development dependencies with uv and run the test suite:

```console
uv sync --group dev
uv run pytest
```
