Custom auto unicodes?



  • I'm wondering if is that possible to set my own custom unicode to name converter, that will work with RF's default auto naming? (And if yes, how to do it? ;) ) I hope this question is clear.


  • admin

    hi. not sure what you mean… can you provide some context or give an example of where and how you would use this? thanks.



  • Example:
    when I'm using "add Glyphs", from "Font" top menu, and checking "Add Unicode" checkbox, is it possible to provide my own name-to-unicode scheme or dictionary to do this?

    So for example, by default, to have a glyph with unicode 00DF I need to write down germandbls to "add Glyphs". But I'm looking for possibility of making my own naming-standard, where , for example if I'll write down germandoubles in add Glyphs, it will automatically assign 00DF unicode.

    Advantage:
    If I could define the path (in preferences) to the file that contains pairs name-to-unicode, I could easily manage my naming system for non-latin scripts.

    (I hope it is clear, somehow it is hard for me to explain it in an easy way)

    Of course, I could write down my own extension for it, but before I do that, I would like to know if it is possible to set it in RF.


  • admin

    ok, thanks for explaining.

    the Add Glyphs sheet allows you to set custom unicodes when adding a new glyph. for example:

    germandoubles|00DF
    

    I find it more practical to set unicodes using a script, so each project can have its own custom mappings. something like this:

    def autoUnicodes(glyph, customUnicodes={}):
        if glyph.name in customUnicodes:
            glyph.unicodes = [customUnicodes[glyph.name]]
        else:
            glyph.autoUnicodes()
    
    customUni = {'germandoubles' : '00DF'}
            
    g = CurrentGlyph()
    autoUnicodes(g)
    

    there are probably other ways to do it…

    hope this helps!


  • admin

    here’s another option, which I think is the one you’re looking for:

    you can create your own custom GNFUL list…

    # GNFUL
    germandoubles 00DF
    

    …and then add it in Preferences > Character Set, so it will be used for all fonts:

    Screen Shot 2019-03-07 at 19.25.22.png

    these custom unicodes are also picked up by glyph.autoUnicodes(), which is quite nice.

    (thanks @frederik for clarifying it via chat :)


  • admin

    A full GNFUL list is preferable... as it will have no fallback for other entries.

    Generate your GNFUL list with a glyphNameFormatter generator: see https://github.com/LettError/glyphNameFormatter (embedded in RoboFont)

    good luck!



  • Thanks! That is the exactly what I was looking for