Tarobish / Jomhuria

http://tarobish.github.io/Jomhuria/
SIL Open Font License 1.1
23 stars 6 forks source link

Kerning issues #32

Closed graphicore closed 9 years ago

graphicore commented 9 years ago

@Tarobish sent me some screenshots with glyph collisions/confluences and asked me to check out what's going on.

I'm posting the screenshots here and my own findings.

screen shot 2015-09-10 at 8 39 26 pm

That's taken from https://github.com/Tarobish/Jomhuria/blob/master/generated/documents/jaafari_jomhuria.pdf the second green row.

screen shot 2015-09-10 at 8 57 25 pm

It's allright here, without the marks.

graphicore commented 9 years ago

@Tarobish this looks to me like it is related to: http://tarobish.github.io/Jomhuria/#tests/collision-above-1

And in this example we can see the first row working just fine and the second row colliding:

http://tarobish.github.io/Jomhuria/#live?eyJ2YWx1ZSI6IiMg2YPZkNiq2KXigIwg2YPZkNiq2KfigIwg2YPZkNiq3bTigIwg2YPZkNiq3bPigIwg2YPZkNiq2KPigIwg2YPZkNiq2KLigIwg2KrYqtm14oCMINmD2ZDYqtmy4oCMINmD2ZDYqtmz4oCMINmD2ZDYqtmx4oCMIFxuXG4jINmD2ZDYqtmO2KXigIwg2YPZkNiq2Y7Yp+KAjCDZg9mQ2KrZjt204oCMINmD2ZDYqtmO3bPigIwg2YPZkNiq2Y7Yo+KAjCDZg9mQ2KrZjtii4oCMINmD2ZDYqtmO2bXigIwg2YPZkNiq2Y7ZsuKAjCDZg9mQ2KrZjtmz4oCMINmD2ZDYqtmO2bHigIxcblxuIyDZg9mQ2KrZjtij2Y4iLCJiaWRpIjoicnRsIiwibGFuZyI6ImVuIn0=

selection_071

Funky enough this is related to an issue that I was about to file! When I change to lang="ar" The first row also fails!:

http://tarobish.github.io/Jomhuria/#live?eyJ2YWx1ZSI6IiMg2YPZkNiq2KXigIwg2YPZkNiq2KfigIwg2YPZkNiq3bTigIwg2YPZkNiq3bPigIwg2YPZkNiq2KPigIwg2YPZkNiq2KLigIwg2KrYqtm14oCMINmD2ZDYqtmy4oCMINmD2ZDYqtmz4oCMINmD2ZDYqtmx4oCMIFxuXG4jINmD2ZDYqtmO2KXigIwg2YPZkNiq2Y7Yp+KAjCDZg9mQ2KrZjt204oCMINmD2ZDYqtmO3bPigIwg2YPZkNiq2Y7Yo+KAjCDZg9mQ2KrZjtii4oCMINmD2ZDYqtmO2bXigIwg2YPZkNiq2Y7ZsuKAjCDZg9mQ2KrZjtmz4oCMINmD2ZDYqtmO2bHigIxcblxuIyDZg9mQ2KrZjtij2Y4iLCJiaWRpIjoicnRsIiwibGFuZyI6ImFyIn0=

selection_072

davelab6 commented 9 years ago

GUESS: maybe your DFLT otl features are working but the AR ones are not...

graphicore commented 9 years ago

The collisions in the English case are now gone after adding lookupflag ignoreMarks; to the kerning lookups. I'm still trying to find a hint how to tackle the breaking lang="ar" case.

graphicore commented 9 years ago

@davelab6 I think you where right. I'm just wondering, I thought the languages would fallback to language dflt if I don't specify them explicitly, so I did the following. Thinking that script arab; would activate the lookups for all languages of that script.

feature kern {
    script latn;
    lookup kernMixedLTR;
    script arab;
    lookup kernPureRTL;
    lookup kernMixedRTL;
} kern;

But I was wrong, the language dflt is, as it seems, a fallback for all languages with that script, that I don't register in the font. I think this is quite annoying.

What I do now is the following, for all languages that we define in the features and it works. I wonder if there is a shortcut, however.

feature kern {
    script latn;
    language dflt;
    lookup kernMixedLTR;
    language TRK ;
    lookup kernMixedLTR;
    script arab;
    language dflt;
    lookup kernPureRTL;
    lookup kernMixedRTL;
    language ARA ;
    lookup kernPureRTL;
    lookup kernMixedRTL;
    language URD ;
    lookup kernPureRTL;
    lookup kernMixedRTL;
    language SND ;
    lookup kernPureRTL;
    lookup kernMixedRTL;
} kern;
graphicore commented 9 years ago

selection_004

Tarobish commented 9 years ago

Awesome :)

On Sep 21, 2015, at 1:36 PM, Lasse Fister notifications@github.com wrote:

https://cloud.githubusercontent.com/assets/393132/10004273/291c707e-60b1-11e5-8948-4199de0cdbdb.png — Reply to this email directly or view it on GitHub https://github.com/Tarobish/Jomhuria/issues/32#issuecomment-142101272.

graphicore commented 9 years ago

I'll commit this in a second.

khaledhosny commented 9 years ago

You should just have the language system declarations on top of your file:

languagesystem DFLT dflt;
languagesystem arab dflt;
languagesystem arab TRK;
etc…

And yes, if any language is explicitly specified anywhere else in the font, it needs to be explicitly specified where ever it should be applied, otherwise it will be ignored where it is not specified.

graphicore commented 9 years ago

they are there, same as in Amiri, I think:

languagesystem DFLT dflt;
languagesystem arab dflt;
languagesystem arab ARA;
languagesystem arab URD;
languagesystem arab SND;
languagesystem latn dflt;
languagesystem latn TRK;
khaledhosny commented 9 years ago

Yes, but you already had script latn; and script arab; inside the feature block, which override the globals. You can just get rid of them and register all kerning for all scripts, it shouldn’t harm unless you have conflicting kerning pairs (it can possibly make the layout slower, but I doubt it will be anything measurable, but you can test this of course).

graphicore commented 9 years ago

unless you have conflicting kerning pairs

That's exactly what I have after implementing https://github.com/unified-font-object/ufo-spec/issues/16#issuecomment-120036174

davelab6 commented 9 years ago

I think this is quite annoying.

LOL welcome to opentype. Please add something about this to http://meta.wikimedia.org/wiki/Future_Global_Font_Format_Requirements