Find and replace multiple glyphs

In the edit menu there is a function “find and replace” which works perfectly if you want to change endings of glyph name but is there somehow the option to find for example: a, b, c, d, e and rename this characters to: uniF400, uniF401, uniF402, uniF403, uniF404 ? So that the unicode position is also changed.

is that somehow possible with “find and replace” or there is a need of new script?

Thanks :heart:

You can use regex if you like, but I do not now what you want to do. Rename uniF400 to… what?

so, there are many ASCII fonts in Georgia, they have “ა” on the latin “a” and so one…
If I want to make it as a normal font I need to copy and replace all characters those glyphs one by one.
With find and rename would be it easier. For example: a, b, c, d, > ა, ბ, ც, დ, or like this: a, b, c, d, > 10D0, 10D1, 10D2, 10D3,
there are some Fonts also, that have some Georgian letters in private area, for example: F400, F401, F402, F403, and if it would be possible to rename those multiple glyphs and change the unicode positions at the same time — would be really great :slight_smile:

Better first change the Unicode and then update glyph info.

But the unicode change one by one?

I have a script that can apply a range of Unicode values to a selection, but that only makes sense if the glyphs are actually already in the right order, and I doubt that is the case. How would you want to automate the changing of codes when there is no system to the order of glyphs?

If you need to apply that often, you can write a list of replacements and apply that with a script.

there is standard to the order of glyphs, I mean “ა” is always on the position of “a”
ბ↪b, ც↪c, დ↪d and so one.

Yes, I think it is the only solution. The script that changes the unicode: 0061 to 10D0, 0062 to 10D1, 0063 to 10EA, 0064 to 10D3, and so one.

Use this script as basis:

And adapt it to your needs, I suggest renaming to uniXXXX names and afterwards updating glyph infos.

Explanation is in the code.

1 Like

:heart:️ Thank you

in glyphs mini - my find and replace is greyed out… what am i doing wrong?

In Glyphs Mini:

  1. Select some glyphs in the Font tab
  2. Edit > Find > Search and Replace

sollte gehen aber tuts leider nicht…

Hast du Glyphen ausgewählt?
Welche Version von Mini verwendest du?

ja habe welche ausgewählt… Version 1.5.7 (49)

ich mach jetzt mal einen upgrade auf mini 2.0

I have a script that can apply a range of Unicode values to a selection, but that only makes sense if the glyphs are actually already in the right order

After having used GitHub - adobe-type-tools/box-drawing: Python script to draw all the box drawing characters and block elements based on parameters., this sounds precisely like what I am looking for. Could you point me in the right direction?
(It’s not the script mentioned above, I take it?)

Edit: sorry, it really wasn’t that hard to find: Glyphs-Scripts/Glyph Names, Notes and Unicode/Add PUA Unicode Values to Selected Glyphs.py at master · mekkablue/Glyphs-Scripts · GitHub

Thanks :slight_smile:

Is there a python approach to find & replace multi srings in text (either in e.g. textmate or in fontinfo features settings.

I mean like

find and replace in feature text codes each string before - > and replace each with its corresponding string after - > replace

find → replace:

beh → beh-ar
marbuta → tehMarbuta-ar
teh → teh-ar
theh → theh-ar
jeem → jeem-ar
hah → hah-ar
khah → khah-ar
dal → dal-ar
zal → thal-ar
reh → reh-ar
zain → zain-ar
seen → seen-ar
sheen → sheen-ar
sad → sad-ar
dad → dad-ar
tah → tah-ar
zah → zah-ar
ain → ain-ar
ghain → ghain-ar
tatweel → kashida-ar
feh → feh-ar
qaf → qaf-ar
kaf → kaf-ar
lam → lam-ar
meem → meem-ar
noon → noon-ar
heh → heh-ar

?

  1. Select the glyphs
  2. Cmd shift F
  3. Leave the Find field empty
  4. Add -ar in Replace field

Thank mr @mekkablue
for your note
it’s always informative and upto the point

but actually the replaced strings are more complicated
I only put previous simple list as example

what if the list like this: old naming varies

uni060C → comma-ar
uni0615 → tahabove-ar
uni061B → semicolon-ar
aalef → alef-ar
beh → beh-ar
marbuta → tehMarbuta-ar
teh → teh-ar
theh → theh-ar
uni0654 → hamzaabove-ar
uni0655 → hamzabelow-ar
uni0656 → alefbelow-ar
wasl → alefWasla-ar
uni0674 → highhamza-ar
tteh → tteh-ar
peh → peh-ar
cha → tcheh-ar
uni0688 → ddal-ar

I would like to replace all old glyphs & OT classes naming inside feature code text with nice naming or names i issigned after - > (e.g my own classes naming)

imagine you want to replace all names in next code with nice names and also you want to rename classes as you would like through your prepared list (find target - > replacement)

example code:

lookup calt_arab_11 {

GSUB lookup 17, type 16 (Chaining Context)

lookupflag IgnoreMarks RightToLeft;
ignore sub @calt' @calt9 [yehhmzf maksuraf yehf fyehf];
ignore sub @calt' @calt9 [rehf zainf uni0691.fina uni0698.fina];
ignore sub @calt' @calt9 [noonf noongf];
sub @calt10 @calt' @calt9 by [hmzm2 behn2 behm2 tehn2 tehm2 thehn2 thehm2 noonn2 noonm2 yehn2 yehm2 sennan2 sennam2 ttehm2 pehn2 pehm2];
sub [sadn dadn] @calt' @calt9 by [hmzm2 behn2 behm2 tehn2 tehm2 thehn2 thehm2 noonn2 noonm2 yehn2 yehm2 sennan2 sennam2 ttehm2 pehn2 pehm2];
sub [sadm dadm] @calt' @calt9 by [hmzm2 behn2 behm2 tehn2 tehm2 thehn2 thehm2 noonn2 noonm2 yehn2 yehm2 sennan2 sennam2 ttehm2 pehn2 pehm2];
sub [seenn sheenn sheen2n] @calt' @calt9 by [hmzm2 behn2 behm2 tehn2 tehm2 thehn2 thehm2 noonn2 noonm2 yehn2 yehm2 sennan2 sennam2 ttehm2 pehn2 pehm2];
sub [seenm sheenm sheen2m] @calt' @calt9 by [hmzm2 behn2 behm2 tehn2 tehm2 thehn2 thehm2 noonn2 noonm2 yehn2 yehm2 sennan2 sennam2 ttehm2 pehn2 pehm2];
sub @calt9 @calt' @calt9 by [hmzm2 behn2 behm2 tehn2 tehm2 thehn2 thehm2 noonn2 noonm2 yehn2 yehm2 sennan2 sennam2 ttehm2 pehn2 pehm2];
sub @calt9 @calt' @calt11 by [hmzm2 behn2 behm2 tehn2 tehm2 thehn2 thehm2 noonn2 noonm2 yehn2 yehm2 sennan2 sennam2 ttehm2 pehn2 pehm2];
sub @calt10 @calt' @calt11 by [hmzm2 behn2 behm2 tehn2 tehm2 thehn2 thehm2 noonn2 noonm2 yehn2 yehm2 sennan2 sennam2 ttehm2 pehn2 pehm2];
sub [seenn sheenn sheen2n] @calt' @calt11 by [hmzm2 behn2 behm2 tehn2 tehm2 thehn2 thehm2 noonn2 noonm2 yehn2 yehm2 sennan2 sennam2 ttehm2 pehn2 pehm2];
sub [seenm sheenm sheen2m] @calt' @calt11 by [hmzm2 behn2 behm2 tehn2 tehm2 thehn2 thehm2 noonn2 noonm2 yehn2 yehm2 sennan2 sennam2 ttehm2 pehn2 pehm2];
sub @calt' [seenf seenm sheenf sheenm sheen2f sheen2m] by [hmzm2 behn2 behm2 tehn2 tehm2 thehn2 thehm2 noonn2 noonm2 yehn2 yehm2 sennan2 sennam2 ttehm2 pehn2 pehm2];

} calt_arab_11;

can that be acheived via python applied either inside glyphs or outside (applied on textfile)?
or can that be applied via any other tools or apps?