Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding support to more GSUB tags? #443

Open
blueset opened this issue Jul 23, 2020 · 7 comments
Open

Consider adding support to more GSUB tags? #443

blueset opened this issue Jul 23, 2020 · 7 comments
Labels
font features Spec Related to the implementation of the Opentype specification

Comments

@blueset
Copy link

blueset commented Jul 23, 2020

Expected Behavior

Support to more GSUB features than the current liga and hlig.

Current Behavior

Only supports [liga, hlig] for latn, and [init, medi, fina, rlig] for arab.

Possible Solution

Maybe we can start from the simple ones that doesn’t require additional params like calt, swsh, ccmp, fwid, hwid, pwid etc. Then move on to those that depends on languages and scripts, etc. like locl and vert.

If possible, it would be great to also have support to palt (which relies on GPOS table instead of GSUB).

Context

I was trying to make some Japanese text animations which relies on converting text into paths. The design style of my project strongly relies on the pwid and palt OpenType features, which are exceptionally well supported on the Source Han / Noto CJK font family. I therefore would like to seek possibilities of supporting these features.

@Connum
Copy link
Contributor

Connum commented Oct 14, 2020

+1 - especially for calt. There isn't much out there in terms of tooling with good support for contextual alternates, especially open-source wise. FontForge's implementation is not intuitive (and of course buggy) and in the realm of JS, there seems to exist nothing at all. Even many commercial solutions (Fontself, Glyphr) are relying on opentype.js under the hood and don't support contextual alternates for that reason. It's even in the "Planned" section of the README, so that's good. Let's hope that someone with the skill to do so can make it happen some time soon! 😉

@Connum
Copy link
Contributor

Connum commented Oct 18, 2020

Really wanting to see calt implemented in this library, I dug into the OpenType specs and played around with the code a little. I found that writing support for multiple substitution lookup tables (lookup type 2) needed to be implemented first, before we can write contextual lookup (because those can be referenced). And indeed I managed to do that in PR #449. You can use Substitution.add() and Substitution.getFeature() to add or get the two features ccmp and stch.

If I'm not totally wrong, we should be able to add all the features that are listed with the flags gsub_single_mask and/or gsub_multiple_mask (and only those) in this file from FontForge https://github.com/fontforge/fontforge/blob/8d961b97d76a424c4bec3c4fc6298c200a6ebcc4/fontforge/lookups.c by simply adding them to those two functions.

Testing of and feedback on my branch https://github.com/Connum/opentype.js/tree/add-gsub-lookup-type-2-multiple-sub is encouraged!

@Typogram
Copy link

+1 absolutely essential!

@Connum Connum added Spec Related to the implementation of the Opentype specification font features labels Feb 12, 2023
@GeneiusK
Copy link

@Connum have you managed to make any progress on the calt implementation? Really want to see that feature as well.

@Connum
Copy link
Contributor

Connum commented Feb 22, 2023

Let's wait for the outstanding feature PRs, one of them introduces the groundwork for correct handling of feature execution order.

@sam272
Copy link

sam272 commented Oct 5, 2023

Has there been any progress toward feature execution handling and/or calt implementation? +1 on that feature

@Connum
Copy link
Contributor

Connum commented Oct 5, 2023

It seems like most of the maintainers are currently busy with other projects and work. Also, the users who provided the PRs have often not yet replied to reviews and change requests. So it doesn't look like there will be any progress soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
font features Spec Related to the implementation of the Opentype specification
Projects
None yet
Development

No branches or pull requests

5 participants