Highlighting glyphs in the font window

RoboFont Forums Help / General Highlighting glyphs in the font window

This topic contains 1 reply, has 2 voices, and was last updated by  frederik 7 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5434

    Jens K.
    Participant

    I’m looking for a way to highlight or mark some glyphs in the font window via a script, but without changing the save state of the glyphs. At the moment I’m changing the RGlyph.mark attribute, but that makes the affected glyph being “unsaved”.

    An overlay graphic (like the small “L” for layers) would also be a solution, but I have no idea how to add something like that.

    Perhaps I should rather generate smart sets via script to group the glyphs I want …

    Any ideas or suggestions?

    #5435

    frederik
    Keymaster

    The mark color is saved in the lib and is actually changing the font data, so it makes sense that the save state of the document will update.

    There are some options:

    set the change count of the document to zero after changing the font data, just be careful with data loss, of unsaved fonts

    from AppKit import NSChangeCleared
    
    font = CurrentFont()
    
    for glyphName in font.selection + font.templateSelection:
        glyph = font[glyphName]
        glyph.mark = (1, 0, 0, 1)
    
    document = font.document()
    if document:
        # set the document change count to zero
        document.updateChangeCount_(NSChangeCleared)
    

    Adding an L or N (for glyph.note) is a bit more difficult cause you have to overwrite the defcon representation factory generating the glyph cell.
    Adding smart sets is probably the easiest.

    But I guess your proposed solutions are not the best options for the problem…

    however, good luck!

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.