msaktype

Limitations in Generating Font Source Files via Coding Agents

While Large Language Models (LLMs) and coding agents such as Claude Code have demonstrated remarkable proficiency in generating structured software code, they encounter a unique set of challenges when tasked with producing font source files like .ufo or .glyphspackage. These difficulties are not merely a matter of aesthetic refinement but represent a fundamental misalignment between the architecture of current transformer models and the geometric requirements of typeface design. The failure to generate functional glyphs through direct data manipulation can be attributed to several structural and semantic factors.

1. Data Scarcity and Format Specificity

One primary obstacle is the disparity in training data availability. Standard coding agents are optimized using trillions of tokens from mainstream programming languages like Python, TypeScript, and Go.

In contrast, font source files - especially specialized or proprietary formats - are sparsely represented in public repositories. Consequently, while a model may recognize the high-level JSON structure of a file, it often lacks the deep, domain-specific semantics required to interpret the significance of the underlying data points. This lack of exposure prevents the model from understanding how individual values contribute to the overall integrity of a typeface.

2. The Tokenization of Continuous Coordinates

Furthermore, the way LLMs process numerical data hinders their ability to manage continuous coordinates. These models treat numbers as discrete tokens rather than quantitative values, meaning they do not perceive the geometric proximity between values such as 124 and 125. Because the potential values for an anchor point in a coordinate system are nearly infinite, the resulting probability distribution is "heavy-tailed." This makes it exceedingly difficult for a model to predict the precise next digit with any degree of accuracy, frequently leading to jittery paths or structurally broken coordinates that render the font file unusable.

3. Lack of Spatial and Topological Awareness

The linear and sequential nature of text generation also contrasts sharply with the spatial and cyclical nature of font design. Maintaining geometric integrity requires precise relationships within closed Bézier paths, where even a single-unit error or a slight misalignment of an off-curve handle can cause a path to intersect or invert.

Because LLMs lack a global spatial buffer, they often suffer from a loss of consistency; the model may fail to reconcile the tension and thickness established on one side of a glyph with the coordinates it generates for the opposite side, resulting in a loss of optical balance and symmetry.

4. Optical Logic vs. Mathematical Arithmetic

Finally, the transition from a Regular weight to a Bold Italic is not a purely mathematical endeavor but a visual-perceptual one. Applying the mathematical delta between weights is a non-linear operation that necessitates optical logic rather than simple arithmetic. Simply increasing stroke width often chokes internal counters and distorts terminals in ways that defy linear calculation.

Type design relies on optical corrections to ensure legibility and aesthetic harmony—a domain where mathematical prediction consistently falls short of human perception.

Conclusion: The Scripting Alternative

In light of these limitations, the optimal role for a coding agent in typography is that of a toolmaker rather than a direct creator.

Rather than attempting to generate source files directly, a more effective workflow involves utilizing the agent to write Python scripts—leveraging APIs like Glyphs or FontParts—to perform necessary transformations. This approach allows the LLM to handle the overarching logic of the process while delegating precision-critical numerical calculations to the deterministic processing power of the computer, ensuring both structural integrity and mathematical accuracy.