Skip to content

Allow glyph sets to define a custom string for placeholders #2005

Closed

Description

@khaledhosny

Some glyph sets contain many glyphs without code points (for example, in scripts like Arabic, most of the glyph sets has no code points), and currently the placeholders for such glyphs is an empty cell which makes it hard to navigate.

It is sometimes possible to have a usable placeholder using a string without necessarily wanting to set a code point for the glyph.

For example, in GF Arabic Plus, jeh-ar.fina does not have a code point, but for placeholder one can use the (legacy) Arabic Presentation Form character U+FB8B ARABIC LETTER JEH FINAL FORM. On the other hand, rehFourdots-ar.fina has no code point or even a Presentation Forms code point, but final form can be forced by using ZWJ + the base glyph code point i.e. the string U+200D U+0699.

I think allowing for an optional column for the placeholder string in the CSV format should allow having usable placeholders for many glyphs without code points.

Activity

  1. khaledhosny commented on Feb 2, 2025

    @khaledhosny
    ContributorAuthor

    I tried working on this, but it seems to require too many changes, so instead I tried something simpler: when getting the placeholder character, if the glyph has no code point and the name has ".init", ".medi", etc. extension, use get the code point for the base glyph name and ZWNJ to force the desired positional form. This is less flexible but the required changes are isolated and seems to work well enough for my use case.

    I can open a PR if a change like this can be considered.

  2. khaledhosny commented on Feb 4, 2025

    @khaledhosny
    ContributorAuthor

    Current:
    Image

    After proposed change:
    Image

  3. justvanrossum commented on Feb 5, 2025

    @justvanrossum
    Member

    (There also is the concept of "associatedCodePoints", which is used to guess the script of unencoded glyphs. Not sure how useful that is for this use case.)

    I like the idea of having an optional third column to explicitly specify a placeholder character (or char sequence?).

    I am also not opposed to do some guessing based on glyph name extension, for well established common cases like these, so I'm curious about your changes.

  4. justvanrossum commented on Apr 11, 2025

    @justvanrossum
    Member
  5. khaledhosny commented on Apr 11, 2025

    @khaledhosny
    ContributorAuthor

    Yes, that covers my needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions