Jump to content
You must now use your email address to sign in [click for more info] ×

Glyph- and feature-based find and replace


Recommended Posts

I just started playing with the beta today, and I was stoked to find that Publisher already provides support for glyphs with no Unicode code point that aren't accessible via OpenType. I often use this specialized typeface, which has lots of alternates and specialty characters, but no OpenType features for accessing them. While I can select and insert them easily from the Glyph Browser, using them in a longer document is tedious, since there's no obvious way to replace every instance of a character with one of these alternate glyphs. The fastest way I've found is to replace them all with "G+[glyph code]" and then manually convert each one with Text > Toggle Unicode.

What would be useful here is a way to perform replacements using Unicode values and glyph numbers; e.g., "replace every instance of character X with glyph A". If memory serves, InDesign even allows you to combine this type of replacement with regular expressions. This is helpful for certain contextual alternates, like the R rotunda used in historical texts: "replace every instance of a lowercase R following a lowercase B, O, or P with this glyph". For OpenType-aware fonts, a feature-based "replacement" works as well ("find [a character in some environment] and enable stylistic set 2 for it").

Link to comment
Share on other sites

Welcome to the Serif Affinity forums, @CmdrSpock.

Have you tried:

  1. Pasting one copy of your glyph into the text from the Glyph Browser.
  2. Using your approach of G+something for all other occurrences.
  3. Using Text > Find... or View > Studio > Find and Replace to open the Find panel.
  4. Putting G+something into the Find box.
  5. Copying the glyph from step 1 into the Replace box.
  6. Press Find, then Replace All.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

Hey, thank you for the welcome. I have tried copying and pasting the glyph into the Replace box. Nothing appears there. If I try to replace something anyway, it gets deleted (replaced with nothing, technically), confirming that there's nothing in the box.

Link to comment
Share on other sites

11 hours ago, CmdrSpock said:

Hey, thank you for the welcome. I have tried copying and pasting the glyph into the Replace box. Nothing appears there. If I try to replace something anyway, it gets deleted (replaced with nothing, technically), confirming that there's nothing in the box.

Interesting. Can you provide a sample .afpub file with some text and that glyph?

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

Sure. Here are both a sample file and a screenshot, so you can see what it should look like. The first lowercase Ж (in the word международный) is an alternate glyph with no Unicode code point, and the second (in the word женский) is U+0436 ("Cyrillic small letter zhe"). The default appearance of Ж here is the Bulgarian style, with a tall vertical stroke in the middle; the alternate glyph is the Russian style.

As an aside, you'll run into the "foreign characters displayed as Unicode values in the find panel" issue when trying to make replacements in Cyrillic text, but that issue has already been reported.

Sample file.afpub

Sample file screenshot.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.