Copy/Mirror element?

A noob question - I want to create an element and then mirror a copy of it across a center line - either the default of the alignment zone or an user created guide.

Can I??

You can using the two mirror buttons in the transformations palette:

Select a path or component and press one of the mirror buttons to mirror with respect to the transformation origin. The transformation origin is defined at the top of the transformations palette. Pick one of the nine points on the top-left control to mirror with respect to that point of the selection (e.g. the center of the selection in the screenshot above). Pick one of the points in the top-right control to mirror with respect to a metric such as x-height or baseline.

Lastly, pick the point in the crosshair in the top-center of the transformations palette to mirror with respect to the manual transformations origin. You can place the manual transformations origin anywhere on a glyph layer by choosing the Rotate or Scale tool to the toolbar and clicking anywhere on the glyph layer. This point, marked by a gray crosshair in a read ring is used to mirror the selection.

Thanks - I get the mirror tools, but what I’d like to happen is for a copy of the selected element to be mirrored, so for instance with H - I’d create the left stem and serifs and then created a mirrored copy on the right. What I get now is just a flipping of the select element. I can copy/paste the element and then flip but even then it will have to be moved further to mirror the position.

So you would want to copy, paste, and mirror in one step? That is not build into Glyphs as a single action, but you could write a Python script if you need to do this action frequently.

How to define where to mirror the path? Getting that right would be slower than just moving it manually. And the H is one of the few glyphs were this might be of some help? Or can you give more examples?

I was thinking along those lines. It seems it would be a welcome function for others. I keep dabbling with Python as it’s also a means of increasing functionality in Rhino3D. But I start getting lost and frustrated. Is there a python library for Glyphs? It seems this task would be relatively simple.

Oh, I just saw yours after florian’s. I would think the default center line (vertical) in the edit guide/thing. I can’t think of it’s name.
Shared with CloudApp

But it would also be extra kewl if one could select an user guideline. Which makes me think of another request . . .

It would be useful if user created guidelines could be assigned different colors.

I am wondering where outside of the H and maybe a handful of other glyphs this might be useful. If it’s just a few glyphs, doing it by hand is probably faster than writing a custom feature or Python script.

In the case of the H you posted above, consider using corner components for the serifs. Then stems are then just simple rectangular paths that can be easily copied and reused.

But, if you do need such a feature frequently, a script is the best solution since this is a fairly specialized workflow. There is a tutorial series for getting started with scripting Glyphs.

There is also a reference documentation for scripting Glyphs with Python.

You make a good point. There’s likely not all that many instances one could make use of such. I’ll still take a peek at the library. Thanks!

And if your building your H, the width of the glyph is almost certainly not right, so using it to position the copy is not useful.

You will move that second stem several times over the next few days/weeks to determine the exact proportions. So moving it once in the beginning is only a very small part of the process.

And you can move stuff very quickly if you Command+left arrow it. That means you need to press the arrow key 3 or 4 times to get it roughly to the right position. Every other tool or function will be slower.

So I’ve a coding app called Atom. I’ve installed the Python IDE and I’m opening some of the scripts downloaded into the Glyphs App. I’m trying to get an idea what the first line of code would be to create my little gem.

Get started in the Macro panel of Glyphs. Editors like Atom are useful once you have working code in the Macro panel. Consider the precise steps of what should be done by the script step by step and search the reference documentation for methods for doing those steps. Feel free to ask on this forum if you are stuck.

For this task, I don’t exactly know what you are trying to do and as Georg points out, doing it by hand is most likely much quicker anyway. But, if you want to use this opportunity as a scripting learning exercise, first start by duplicating the selected path. If you are new to Python, first read a general introduction like first parts of the Glyphs tutorial liked above.

There is a script that does something very similar in the freemix scripts by @TimAhrens. They’re available through Window > Plug-in Manager > Scripts.

Thanks, this looks like a good place to start!

1 Like