How to center the glyph within the bounding box

I want to center a glyph within the bounding box.
in Coreldraw, just press “P”, the any content will be centered. but in glyphs 3, i can not find it. no script installed either, i found some topics saying that some script will do this.
thanks

Please correct me if I am wrong but you probably mean: center the shapes horizontally within the width of the glyph.

(The bounding box is the combined width and height of all shapes. The glyph is the whole letter/figure/symbol within which you would center the shape.)

Assuming that this is what you mean, you can do it in two ways:

  • not preserving the current glyph width: type =| in the right sidebearing field (RSB). This is a metrics key that will make the RSB orient itself after the LSB. You can (batch) update metrics keys with Glyph > Update Metrics.
  • preserving the current glyph width:
    • install one of the script collections in Window > Plugin Manager > Scripts, I know by heart that ,y mekkablue scripts have a Center Glyph script, but some other collections have comparable scripts. If you need it very often, you can give it a keyboard shortcut in the app preferences.
    • or again with metrics keys: into the width, you write for example =500 (the number of the current width preceded by an equals sign), and in the RSB you write =| again.

In type design, usually it is the metrics that orient themselves after the shapes, not the other way around. Except in a monospaced typeface, which you would set up differently, so the widths stay in sync all the time.

It depends on what you are trying to do (agree with mekkablue)

Not sure if they are the same as his, but in my repo I also have scripts for this:

  • Vertically center in x-height
  • Vertically center in ascender height
  • Vertically center in capheight
  • Horizontally center

thank you for you reply. I want to move the whole glyphs to the center both horizontally and vertically. I installed your glugin manually (online installation failed due to GFW),but i can not find it anywhere in Glyphs and don’t know how to use it. Do you have Gif or video tutorials ? I am a beginner of this app, still learning. Thanks.

where to find your script?

Go to WindowPlugin ManagerScripts and search for “Jeremy Tribby”. Click Install next to Jeremy Tribby’s Scripts. Then, open the Scripts menu, hold down the Option key and choose Reload Scripts (or press Command-Shift-Option-Y).

Now you can find the scripts in ScriptsJeremy Tribby. Note that these scripts work with the selected paths, while the mekkablue scripts also work if no paths are selected.

God. So difficult to install so many scripts one by one (Great Fire Wall prevent me from installtion of files hosted under github). It’s highly appreciated that you would incorporate such useful function inside the core codes of the App Glyphs. Centering.
Just as Coreldraw does, one key “P” will do it or something like Inkscape’s Centering.

To manually install it do the folding.

  1. Find the git repo
  2. Click the green “Code” button and download the .zip.
  3. Unpack the .zip. You should get a folder called: “Glyphs-Scripts-master”
  4. Rename that folder to “Mekkablue”
  5. In Glyphs, select Script > Show Script Folder.
  6. Copy the “Mekkablue” folder into the “Scripts” folder.
  7. In Glyphs, Open the Scripts menu, press and hold the Option key, and click “Reload Scripts”. 8) Now you’ll find a “Mekkablue” item in the Scripts menu.

thank you very much, scripts installed easily.

installed, but not vertically centered.屏幕快照 2021-09-06 上午10.53.35
This is what i need.

installed, but not vertically centered.屏幕快照 2021-09-06 上午10.53.35
This is what i need.

By the way, i got a pop message " failed to clone from Github xxxxx, to " xxxx/repository", how to solve it? thanks屏幕快照 2021-09-06 下午10.31.36

What did you do when you got this error message?

And there is a way to center an outline manually. First draw a box as big as your metrics (or the size you like to center on). Select it. In the Info box, select the center in the transformation origin control. Write down the X and Y coordinates. Then remove the box and select your shape. Just type the two numbers you just got form the box into the X and Y fields.

I installed the scripts manully. Nothing else. When i was using the App, it popped up suddenly.
Second, i have thousands of words, if i center them one by one, that will be huge job. I designed them in Inkscape and saved as svg, If i import them into fontforge, every words will be centered as designed. While in Glyphs, it’s not.

Can you send me one of the .svg and the font you import it to (to know your vertical metrics). Maybe I can improve the default positioning of the imported shapes.

1.zip (10.7 KB)
In the zip files, there are two files of the same word. The bounding box is 50x50px and 1000x1000px respectively. It makes no difference when they are imported into fontforge, centered and auto scaled to the right size.

屏幕快照 2021-09-06 下午10.31.36

installed as guided: To manually install it do the folding.

  1. Find the git repo
  2. Click the green “Code” button and download the .zip.

  1. Unpack the .zip. You should get a folder called: “Glyphs-Scripts-master”
  2. Rename that folder to “Mekkablue”
  3. In Glyphs, select Script > Show Script Folder.
  4. Copy the “Mekkablue” folder into the “Scripts” folder.
  5. In Glyphs, Open the Scripts menu, press and hold the Option key, and click “Reload Scripts”. 8) Now you’ll find a “Mekkablue” item in the Scripts menu.