Generate Trial Fonts



  • Hi guys,

    I hope this isn’t a silly / naive question, but I was wondering if there was an easy way to generate trial fonts (A-Z, a-z) in Robofont. I couldn’t find any robofont related documentation about this, but I may be missing something obvious.

    Does anybody on here generate trial fonts from Robofont, if so it would be much appreciated if you could give me a few pointers.

    Thanks!


  • admin

    hello @bobby,

    you can use the FontTools subsetter to subset an existing OpenType font:

    from fontTools import subset
    
    srcPath = 'myFolder/MyFont.ttf'
    dstPath = srcPath.replace('.ttf', '-Trial.ttf')
    
    options = subset.Options()
    # print(dir(options))
    font = subset.load_font(srcPath, options)
    subsetter = subset.Subsetter(options)
    subsetter.populate(text='ABCD abcd')
    subsetter.subset(font)
    subset.save_font(font, dstPath, options)
    

    I’ll add an example to the docs — thanks for your feedback!


  • admin

    added as a new How-To: Generating trial fonts


Log in to reply