New Plugin: Guten Tag

The plugin is now in the Plugin Manager:

:bookmark: Install Guten Tag in Glyphs


Yesterday I learned about tags in Glyphs. When you select one or more glyphs in the font view you can tag the selected glyphs with the Tags field in the lower left.

Tags can then be used in feature code like so:

# class of all glyphs with some tag
[$[tags contains "sometag"]]
# class of all glyphs without some tag
[$[not tags contains "sometag"]]

They are immensely useful to my workflow so I also want to see and edit them from the edit view. That is what Guten Tag does:

Screenshot

You can view, add, remove, and overwrite tags. Clicking on the little triangle to the right shows a list of all glyphs with the selected tag.

That’s it! Guten Tag is my first attempt at a Glyphs plugin so I expect there still to be many rough edges; do let me know if anything does not work or look like it should.

You can get the plugin from GitHub:
https://github.com/florianpircher/GutenTag


Some notes:

I did try to translate the few words that are required for the UI, but I did not hire a professional (the project is just too small in scope). If you speak a language you can check whether my translations are incorrect/missing by looking at the translation tables.

I tried to implement autocomplete, such that tags that exist on other glyphs are suggested when typing a new tag but tokenField:completionsForSubstring:indexOfToken:indexOfSelectedItem: crashes the entire application regardless of what value I return. Maybe an experienced plugin developer can tell me what I am doing wrong.

8 Likes

Two questions for the Glyphs team:

  1. Is there an API to get an image for a glyph? I would like to add a template image thumbnail to each menu-item when viewing the list of tagged glyphs:

1

  1. What is the legal character set for tags? Are spaces allowed? Currently I split on spaces and commas, but I could also revert to only using commas.

No separate API. You would need to build the NSMenu item yourself in PyObjC.

I do build the NSMenuItem in PyObjC:

1 Like

Generating a general purpose layer to image API wasn’t something I needed. The requirements are too different: Do you need it centered on the bounding box (would draw in different scales and positions) or better center on the metrics box (would keep scale and position but will cut off stuff). And in the size needed for a menu to work it would not show much anyway. Have a look at the context popups in the feature code editor (Option+click on a class name).
you could add a custom view for each item. Then you can get bigger lines and draw the images in place. (GSLayerDrawHelper).

I’ll add some comments to the code in GitHub.

That’s understandable. I don’t need the thumbnail, they would just be a nice addition.

I was planing on sizing the images approximately as large as in the feature code popover. I am almost certain NSMenuItem won’t complain about images of larger sizes.

Thanks, I’ll have a look.

Where would I find documentation on this symbol?

Glyphs 3.app/Contents/Frameworks/GlyphsCore.framework/Versions/A/Headers/GSLayerDrawHelper.h

1 Like

I have made some changes that are now on GitHub.

  1. Autocomplete works now thanks to @GeorgSeifert’s pointer:

  1. Spaces are now allows in tag names.
  2. The tag menu now shows a thumbnail for the glyphs with that tag:

  1. Also, menu items are now selectable; clicking on a glyph opens it in a new tab.
  2. Performance improvements and bug fixes.
4 Likes

I tried it and it looks very good.
some tiny things:

  • I would increase the corner radius of the color labels (to 3 or 4).
  • don’t open a new tab but show the glyph in the current tab, like the kerning panel
    def openGlyph_(self, sender):
         if font := self.currentFont():
            glyph = font.glyphs[sender.title()]
            self.windowController().graphicView().replaceActiveLayersWithGlyphs_([glyph])
  • you can use methods direction as actions, no need to use objc.selector: item.setAction_(self.openGlyph_)
1 Like

I use a 1pt radius — directly emulating the corner radius of the font feature preview. Even got xScope involved to copy your design! But, OK, I’ll try 3pt/4pt.

Bildschirmfoto 2021-02-01 um 01.24.19

That works if the user is already in the edit view but crashes in the font view. The idea is good, so I will add a conditional and open a new tab only from the font view.

Good to know, will change. That’s what happens when I copy code I found online. Thanks for the updated code snippet.

Guten Tag

The plugin is finally out of beta and available from the Plugin Manager.

Install it by clicking the link below or search for “Guten Tag” in the Plugin Manager.

:bookmark: Install Guten Tag in Glyphs

If you want to learn more have a look at the Guten Tag Handbook.

5 Likes

Thank you for the plugin Florian. I haven’t used it yet, but the documentation is really well written!

Hi Florian, I like Guten Tag and I have a new request. In my Chinese type design flow, I need to tag 7000+ character before I start to draw any glyph seriously. Each character will have few tags. Is it possible for you to change your interface like Reporters from which I can review all my tags and tick some for a specific character.

2 Likes

So you would want a list of checkboxes in the palette, each checkbox for a tag?

1 Like

Exactly!

I’ll think about it.

Thanks in advance!

I have just discovered this plugin, what incredible work, congrats!

I think, one thing could be useful :
In Font View, if no glyph is selected, allow searching in the Tags bar a specific tag to access to access its time.

Thanks! I think it’s best to combine the tag search with the idea by @colourphilosophy. I’m currently working on another plugin, so this will have to wait. In the meantime, use Smart Filters in the sidebar of Font view to show all glyphs with a specific set of tags:

3 Likes