Align to italic center

Hey there Glyphs users,

I’m struggling through corrections on an italic design and I was wondering if there’s a way (probably a script) that centers paths, components and/or anchors in a italic center of a glyph box.

Thank you.

If you set an italic angle, then most calculations respect the italic angle. If you want to center a glyph, you can set the RSB to =| and update metrics.

Keep in mind that the slant origin is half the x-height. If you place a guideline there and keep it in the italic angle, you have a center line for snapping. This little snippet adds a center guide:

newGuide = GSGuideLine()
newGuide.position = NSPoint( Layer.width//2, Layer.master.xHeight/2 )
newGuide.angle = 90 - Layer.master.italicAngle
Layer.guides.append(newGuide)

Paste it in the Macro Window and press the Run button.

Thank you for being so fast with the response.

This snippet works fine but I don’t know if I explained the problem correctly. The attached image is what I have (with a guideline in the center of the box) and I would like to know about some code that helps me centering both components and anchors through this guideline.

Something like this:

20

Since aligning of components works with anchors, you simply align the anchor in the base glyph to a node. To do this, select the anchor and one or more reference nodes, then choose Align Selection (Cmd-Shift-A). The anchor will be moved to the average x coordinate of all selected nodes. It respects the Italic angle.

Btw you don’t need the anchors in a compound if the base glyphs of the components have anchors. They are reproduced automatically in the compound, or “shine through” as we say.

You can also use the »Smart Plumblines« Plugin. It will show you centered guidelines with italic angle, and you don’t need to add actual guides everywhere. They move along with your nodes/components/anchors/paths.

1 Like

Oh, thanks Rainer! I will try this it this way!

And thank you too for the help with anchors. We are working on vietnamese characters and, since is uses this kind of combinations, we thought they should use anchors.

Thank you Mark!

I’m using it all the time while doing an italic! However, I was wondering about something that centers directly the components through the italic center like “center” button does in a non-italic master.

Btw, thank you for Skedge! I was at Robothon and I thought it was a very interesting plugin. I’m starting coding and I was looking for something like this! If I have some suggestions can I type them to you?

Thanks, I’m glad that you can find it usefull. Yes, I am always open for requests, bug reports, improvement ideas, so let me know. So long: enjoy!