<commit_before># Font Bakery Product Requirements Document

The Font Bakery project develops tools for font production.

This document sets out the product's requirements and design principles, what designers call a "brief."

**Note: The command examples below set out how tools ought to work, and are not examples for use, just yet.**

## 1. Purpose

The primary purpose of the project is to accelerate the on-boarding of font families into the Google Fonts library, both new families and updates to exisiting ones. 

To achieve this we develop tools to sanity-check and fix the files that comprise a single Google Fonts family: TTF fonts, an API metadata file, and a description file. 

These tools are used by @davelab6 to onboard both new families and updates to existing families. 
By making them available to all type designers and font engineers, we hope to empower everyone to get their font projects into a complete and tested state and ready to onboard into Google Fonts. 
The tools will act as an educational resource for type designers to learn about technical quality issues, because if font designers do the right early on that reduces the amount of work at project delivery time. 

The tools are command-line based to allow work on various platforms in a consistent and reproducible way.
They reflect the [Unix Philosophy](https://en.wikipedia.org/wiki/Unix_philosophy):

* Do one thing and do it well, 
* work together, and
* work in similar/uniform way.

A suite of small command-line tools is preferable to a large object oriented application with a graphical user interface.
The tools are individually simple, on the level of shell scripting, and written in Python. 
The use of Python allows direct access to internal font tables using the fonttools package, already popular with the professional font development community. 

Existing font checking tools from other projects and companies are integrated to avoid duplication, such as Apple's `ftxvalidator` tool and Microsoft's Font Validator.

While developing font bakery, we aim to avoid development distractions. 
For example, to access internet resources we may use our own native Python utility methods for simple cases, and [GNU wget](https://en.wikipedia.org/wiki/Wget) or other common system utilities for more complex cases (such as resuming large files.)

#### 1.1 terminology

An individual user-ready font file is normally referred to as a 'TTF' file, because it uses the `.ttf` extension and is in the TrueType flavour of the OpenType font standard.

A font family consists of 1 to 18 font files that belong together because they are designed to work together and share common visual traits. 
Familiar examples are Regular, Bold, Italic, and Bold Italic files.
The Google Fonts API presents these with the same family name, and some Font Bakery tools process the files as a single family group. 

Font Bakery tools provide two main actions:

1. 'check' operations
2. 'hotfix' operations

Check operations validate fonts with read-only processes and only output diagnostic information, which in verbose mode includes confirmations.
They do not modify the input font files in any way because they are intended to provide feedback to font designers and engineers to decide how to resolve them, such as making corrections to source files and rebuilding the fonts.

Hotfix operations create new font files, by appending `.fix` to the filename. 

## 2. Onboarding New and Updated Families
<commit_msg>Update BRIEF.md<commit_after># Font Bakery Product Requirements Document

The Font Bakery project develops tools for font production.

This document sets out the product's requirements and design principles, what designers call a "brief."

**Note: The command examples below set out how tools ought to work, and are not examples for use, just yet.**

## 1. Purpose

The primary purpose of the project is to accelerate the on-boarding of font families into the Google Fonts library, both new families and updates to exisiting ones. 

To achieve this we develop tools to sanity-check and fix the files that comprise a single Google Fonts family: TTF fonts, an API metadata file, and a description file. 

These tools are used by @davelab6 to onboard both new families and updates to existing families. 
By making them available to all type designers and font engineers, we hope to empower everyone to get their font projects into a complete and tested state and ready to onboard into Google Fonts. 
The tools will act as an educational resource for type designers to learn about technical quality issues, because if font designers do the right early on that reduces the amount of work at project delivery time. 

The tools are command-line based to allow work on various platforms in a consistent and reproducible way.
They reflect the [Unix Philosophy](https://en.wikipedia.org/wiki/Unix_philosophy):

* Do one thing and do it well, 
* work together, and
* work in similar/uniform way.

A suite of small command-line tools is preferable to a large object oriented application with a graphical user interface.
The tools are individually simple, on the level of shell scripting, and written in Python. 
The use of Python allows direct access to internal font tables using the fonttools package, already popular with the professional font development community. 

Existing font checking tools from other projects and companies are integrated to avoid duplication, such as Apple's `ftxvalidator` tool and Microsoft's Font Validator.

While developing font bakery, we aim to avoid development distractions. 
For example, to access internet resources we may use our own native Python utility methods for simple cases, and [GNU wget](https://en.wikipedia.org/wiki/Wget) or other common system utilities for more complex cases (such as resuming large files.)

#### 1.1 terminology

An individual user-ready font file is normally referred to as a 'TTF' file, because it uses the `.ttf` extension and is in the TrueType flavour of the OpenType font standard.

A font family consists of 1 to 18 font files that belong together because they are designed to work together and share common visual traits. 
Familiar examples are Regular, Bold, Italic, and Bold Italic files.
The Google Fonts API presents these with the same family name. 
Some typeface projects are developed with other platforms in mind (such as Adobe CC Suite tools) that support many more than 18 styles in a family, and in those cases we must adjust the files to work as a set of families of 1–18 styles. 
Some Font Bakery tools process a set of files that make up a family that include both font files as well as metadata files. 

Font Bakery tools provide two main actions:

1. 'check' operations
2. 'hotfix' operations

Check operations validate fonts with read-only processes and only output diagnostic information, which in verbose mode includes confirmations; without passing a verbose argument to a tool, if everything is correct then there will be no output. 

Check operations do not modify the input font files in any way, because they are intended to provide feedback to font designers and engineers to decide how to resolve them, such as making corrections to source files and rebuilding the fonts.
Hotfix operations do create new font files, by copying the file and modifying that copy, which is saved on disk with the same filename plus `.fix` appended. 

## 2. Onboarding New and Updated Families

{'fraction_non_alphanumeric': 0.035455278001611606, 'fraction_numerical': 0.0033575073865162505, 'mean_word_length': 4.549180327868853, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '27023', 'n_tokens_mistral': 1760, 'n_tokens_neox': 1655, 'n_words': 1161}