Bastardica is a browser-based font manipulation tool designed to create hybrid typefaces, often referred to as "cursed fonts." The project allows users to upload two separate font files—a base font and a mix-in font—and configure how they are combined. The tool uses contextual substitution, a feature of OpenType fonts, to automatically replace specific characters in the base font with glyphs from the mix-in font. Because this substitution is registered as a ligature, the resulting font functions in any environment that supports OpenType shaping, such as web browsers, design software, and word processors. The entire process occurs locally within the user's browser, utilizing Pyodide and the fontTools library to handle the underlying font data. FontTools is a widely used, open-source Python library capable of manipulating, converting, and analyzing various font formats, including TrueType and OpenType. Bastardica provides advanced controls for fine-tuning the output, such as adjusting the Y-offset and scale of the mix-in glyphs to ensure they align with the base font's x-height and baseline. Users can also set a "stride" to determine the frequency of the character swaps, with the developer recommending prime numbers to create more complex, less predictable patterns. As the resulting font is a derivative work, the creator notes that users should verify the licensing of the source fonts before commercial use.
The article highlights that Bastardica relies on the fontTools Python library to process and manipulate font data directly within the user's browser environment.