Giter Site home page Giter Site logo

Comments (8)

skef avatar skef commented on August 16, 2024 1

Yes, I looked at the code and this is treated the same as if there was an explicit "by NULL", so I think it's OK.

from afdko.

skef avatar skef commented on August 16, 2024

I think that syntax just amounts to an implicit "by NULL".

from afdko.

frankrolf avatar frankrolf commented on August 16, 2024

This whole scenario was encountered by a student in a FDK workshop – they reminded me of what the effect was. Basically, this substitution kills the a in the target font (nothing else):

image

Still expected?

from afdko.

skef avatar skef commented on August 16, 2024

I guess the first question is whether putting in an explicit "by NULL" changes the outcome. If it doesn't, then it's more or less expected. If it does change the outcome then there's a discrepancy.

The other question is whether "by NULL" is implemented correctly for this case.

from afdko.

frankrolf avatar frankrolf commented on August 16, 2024

more verbose, as suggested:

sub @letters_lowercase by NULL;

same result, only a is affected


try to affect more glyphs than the a

sub @letters_lowercase by NULL NULL;

fails


different feature tag

feature smcp {
	sub @letters_lowercase;
} smcp;

no difference


different logic

@letters_lowercase = [ a b c d e f g h i j k l m n o p q r s t u v w x y z ];
@null_group = [ NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL ];

feature ccmp {
	sub @letters_lowercase by @null_group;
} ccmp;

fails


deliberate

feature ccmp {
	sub a by NULL;
	sub b by NULL;
	sub c by NULL;
	sub d by NULL;
	sub e by NULL;
	sub f by NULL;
	sub g by NULL;
	sub h by NULL;
	sub i by NULL;
	sub j by NULL;
	sub k by NULL;
	sub l by NULL;
	sub m by NULL;
	sub n by NULL;
	sub o by NULL;
	sub p by NULL;
	sub q by NULL;
	sub r by NULL;
	sub s by NULL;
	sub t by NULL;
	sub u by NULL;
	sub v by NULL;
	sub w by NULL;
	sub x by NULL;
	sub y by NULL;
	sub z by NULL;
} ccmp;

works


sneaky NULL

@letters_lowercase = [ a b c d e f g h i j k l m n o p q r s t u v w x y z ];
@null_group = [ a b c d NULL f g h i j k l m n o p q r s t u v w x y z ];

feature ccmp {
	sub @letters_lowercase by @null_group;
} ccmp;

fails

from afdko.

anthrotype avatar anthrotype commented on August 16, 2024

this is documented here: https://adobe-type-tools.github.io/afdko/OpenTypeFeatureFileSpecification.html#5a-gsub-lookuptype-1-single-substitution

If the replacement glyph is the reserved word NULL, then the substitution has no replacement, removing the input glyph from the glyph sequence:
substitute a by NULL;
Omitting the by clause is equivalent to adding by NULL.

from afdko.

frankrolf avatar frankrolf commented on August 16, 2024

Thank you Cosimo. I guess my original question is answered there, however some of the results (only the first item of a group is replaced) are surprising.

from afdko.

skef avatar skef commented on August 16, 2024

however some of the results (only the first item of a group is replaced) are surprising.

Yes, this seems like it's a bug (assuming it's something we can fix, which seems likely)

from afdko.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.