justinpenner / TalkingLeaves

A GlyphsApp plugin to help you explore the world’s languages and writing systems
MIT License
27 stars 2 forks source link

Shaperglot #7

Open davelab6 opened 2 months ago

davelab6 commented 2 months ago

Please consider making shaperglot an additional analysis engine, which will add opentype features needed to the plugins recommendations :)

Cc @simoncozens

justinpenner commented 2 months ago

Can you elaborate? Shaperglot doesn't define or recommend any specific opentype features or feature code for a given language, and I don't think I'd want to do that in TalkingLeaves since Glyphs already does a pretty good job of auto-generating features as long as the user follows the right naming conventions for their unencoded glyphs.

What I'm hoping I can do with Shaperglot is use the shaping checks to infer a list of unencoded glyph names that follow Glyphs naming conventions, so that the user can add those glyphs to their project. Then Glyphs can auto-generate the feature code. I've been poking around in Shaperglot and I'm not yet sure whether this is possible.

simoncozens commented 2 months ago

What I'm hoping I can do with Shaperglot is use the shaping checks to infer a list of unencoded glyph names that follow Glyphs naming conventions, so that the user can add those glyphs to their project.

I don't think that's possible. I'm not even sure it makes much sense.

Shaperglot tests that a font behaves correctly for the languages you're testing. It doesn't care about glyph names, encoded or unencoded. Its checks are more about the behaviour level. For example, to support Aghem, Hyperglot will tell you that you need a SMALL LETTER I WITH STROKE and also that you need a COMBINING MACRON ACCENT. But having those two codepoints covered in your font is not sufficient for support. To actually support the language properly you need to ensure that, when the input sequence is U+2068 U+0304, you either replace the SMALL LETTER I WITH STROKE with a dotless version and that your font has the correct anchors to make the combining macron accent combine, or replace the two glyphs a single precomposed glyph which does all that. That's what shaperglot tests for - but it doesn't necessarily care how you do it, or what your glyphs are called; it just makes sure that you do something to support that case.

And I believe that these somethings that you have to do - inserting anchors, handling soft-dotting, etc. - are beyond the scope of Glyphs' automatic feature code generation, so I'm not sure that generating a list of magic glyph names would help.

justinpenner commented 2 months ago

Shaperglot doesn't need to know or care about glyph names or feature code, because it's checking language support. TalkingLeaves is a tool that helps the user build a glyph set that supports their target languages. It's not a QA tool, and maybe I need to clarify this better in the documentation and the GUI.

In TalkingLeaves, if the user selects Aghem it currently looks like this, with only encoded glyphs in the "Missing" column:

image

Glyphs does automatically generate feature code to handle soft-dotting for Aghem, if you simply add an istroke.dotless glyph. So, in TalkingLeaves, I'd like to include such unencoded glyphs in another column, and add them to the user's current project when they click a button. I think that would be very useful in scenarios as straightforward as this one. It may not be possible to rely on Glyphs automatic feature code for everything.

I think to get this working, I won't be able to infer unencoded glyph names from Shaperglot alone, but the checks might be useful in learning what languages need unencoded glyphs, and some hints as to what they are. I'll probably have to somewhat-manually put that together with Glyphs' naming conventions, which aren't documented as far as I know.

justinpenner commented 2 months ago

What I'm hoping I can do with Shaperglot is use the shaping checks to infer a list of unencoded glyph names that follow Glyphs naming conventions, so that the user can add those glyphs to their project.

I don't think that's possible. I'm not even sure it makes much sense.

@simoncozens It makes sense to me, and it seems like it is indeed possible with Shaperglot, so now I'm wondering if I didn't explain the problem very well in the first place.

If you're interested, I expanded on the problem and how I can (probably) solve it via the Shaperglot API here: https://github.com/justinpenner/TalkingLeaves/issues/16#issuecomment-2080079079. I have only a minimal understanding of shaping and Arabic script, so any feedback you might have on #16 would be greatly appreciated.