googlefonts / googlefonts/fontations
Variable Font PostScript instance name construction
- Dominant language
- Rust
- Stars
- 826
- Forks
- 75
- Avg merge
- 22h 33m
- Merged PRs (30d)
- 75
Description
A variable OpenType font's PostScript name is [supposed to vary](https://adobe-type-tools.github.io/font-tech-notes/pdfs/5902.AdobePSNameGeneration.pdf). This is documented in FreeType by [FT_Get_Postscript_Name](https://gitlab.freedesktop.org/freetype/freetype/-/blob/f42ce25563b73fed0123d18a2556b9ba01d2c76b/include/freetype/freetype.h?page=5#L4555) and implemented in [sfnt_get_var_ps_name](https://gitlab.freedesktop.org/freetype/freetype/-/blob/f42ce25563b73fed0123d18a2556b9ba01d2c76b/src/sfnt/sfdriver.c#L804).
It would be quite useful to provide a means to combine a base PostScript name (from `FontRef::localized_strings(POSTSCRIPT_NAME)`) and a variation position (from `FontRef::axes()`) to create the PostScript instance name. Because of the PostScript name length limit and the non-trivial nature of creating the PostScript instance name it would be best to have this in the library instead of expecting users to re-implement this.
The most specific version of this would be to add a `FontRef::postscript_name() -> Option` like call, or perhaps a more general utility like `postscript_instance_name(LocalizedString, AxisCollection) -> String`. Because there is a length limit on the PostScript name it would be quite awkward to be any more general than this.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.