I create a lot of online ads where I create the texts as graphics (PNG) before I load them into HYPE. Now I would like to load a custom font into HYPE, which is no problem. Since the font file is saved with a complete set of glyphs when exported, I thought there might be a way to include "subsetting for fonts" in an export script? The fonts used should only contain the letters that actually appear in the banner. I was thinking of "Glyphhanger" or the Fontsquirrel API. Does anyone have any ideas on how to implement this?
Thank you very much.
Here's a starting point to do this in Python which could be run via a Hype Export Script if anyone want to run with this.
# start by installing fontforge with brew install fontforge
# Open the TTF font
font = fontforge.open('/path/to/your/font.ttf')
# Clear current selection
# Select glyphs for "My Headline"
for char in "My Headline":
# Invert the selection to select everything but "My Headline"
# Delete the selected glyphs
# Save the font as a new file
# Close the font
Thank you very much for your answers. I know I could reduce the font characters manually using various tools. Since I will be creating over 100 banners, this is a big (time) effort. I therefore thought that this could be included in the export script.
I will follow Daniel's approach and adapt the export script. In addition, the query for the text used should be made in the index.html so that the letters used do not have to be entered manually each time.