Copy link to clipboard
Copied
Hi everyone!
I need help for creating a script (or modifying existing script) that should replace every Cyrillic character from an old ASCII font with the same Cyrillic character but from new Unicode font.
For example: Capital letter 'A' GID=107 from old font (Lazurski) should be replaced with 'A' GID=630 from new one (Myriad Pro).
I can do this by using Indesign Find/Change - Glyphs, but this will take me too much time.
So, I need a scrip for this job.
My first attempt was to use the FindChangeByList script by modifying the FindChangelist.txt document, but without success.
Here is what I've used until now:
1) glyph {glyphID:107, appliedFont:"Lazurski"} {glyphID:630, appliedFont:"Myriad Pro"} {caseSensitive:false, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
2) glyph {findWhat:"u00C0", appliedFont:"Lazurski", fontStyle:"Bold"} {changeTo:"0410", appliedFont:"Myriad Pro", fontStyle:"Bold"} {caseSensitive:false, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find ASCII A replace with Unicode A.
Both lines didn't change anything. What is wrong?
Any help is welcome!
Regards,
Veselin
P.S. Indesign CS5
Copy link to clipboard
Copied
Possibly you don't need to mess around with that pesky buggy Replace Glyph ID function at all. Your first attempt shows glyph ids, but your second one shows Unicodes instead. If these codes are correct (*), you can use them in the regular Text find & change.
(*) If that font "Lazurski" is a non-Unicode font, I presume the code you show -- 00C0 -- is correct. U+0410 is the Cyrillic capital 'A', but it might not have worked for you because you were using a bad notation. The correct notation to get any Unicode character you want is "\u00C0" and "\u0410".
Copy link to clipboard
Copied
Thank you Jongware!
The codes (both ID and Unicode) are correct for sure, but even with correct notation (obviously my was wrong) the script don't change anything.
Here is the line in the FindChangeList:
text {findWhat:"\u00C0", appliedFont:"Lazurski", fontStyle:"Bold"} {changeTo:"\u0410", appliedFont:"Myriad Pro", fontStyle:"Bold"} {caseSensitive:false, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find ASCII A replace with Unicode A.
Update:
Finally, I found what is wrong with the script - the properties "caseSensitive:false".
By removing that properties the script works fine.
So, I successfully converted a book with old ASCII Cyrillic font to Unicode Opentype font.
Copy link to clipboard
Copied
try this:
text {findWhat:"<00C0>", appliedFont:"Lazurski", fontStyle:"Bold"} {changeTo:"<0410>", appliedFont:"Myriad Pro", fontStyle:"Bold"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all.
may be make a charactor style "Bold", that will be better.
if:
text {findWhat:"<00C0>", appliedCharactorStyle:"LazurskiBold"} {changeTo:"<0410>", appliedCharactorStyle:"MyriadProBold"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all.
and see what you got.
Copy link to clipboard
Copied
Here is the solution: