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
Issue with application of OpenType features #88
Comments
It would be nice if you could reduce the failing code to something as small as possible. |
I know, but that’s where it gets complicated. |
For me it is currently just too much and too complex to deal with. Try to change/remove small things at a time and try to zoom into the moment when it goes from "not working" to "working". |
Right, I just understood myself what you meant by that. I'll do that and get back. |
Okay, I found it. Just not really sure what to make of it. This code works:
With the Thanks for pointing out how to find the problem and sorry for bothering. So here’s another insider question: One could use |
Thanks, that's a great reduction. There's indeed something fishy here, and it may well be a DB bug. |
Okay, if you put it that way, here’s another one that I didn’t mention yet: A second sample that didn’t work for me was the
|
Btw. |
There seems to be a weird interaction between these features. @typemytype, can you have a look when you have time? |
weird interaction!! will have a look |
setting somehow the off attribute in coreText is not correct https://github.com/typemytype/drawbot/blob/master/drawBot/context/tools/openType.py#L438 (if got this map from @behdad 's harfbuzz see https://github.com/behdad/harfbuzz/blob/master/src/hb-coretext.cc#L445) |
Indeed, the Right, the I’ll leave the issue open in case you want to get back to changing the attributes. |
Anything I need to fix? I got the table from Apple... |
@behdad this is a drawBot issue, I guess The order of features toggled on and off are taken from a dict and it happens when the openTypeFeature dict is something like as dict keys are not ordered drawBot could first set the feature tag for Im hoping sorting the openTypeFeature dict by value |
should be fixed here: 853d42f |
I can confirm that the features get applied correctly now without resetting them using |
well the fix should apply the features correctly by disabling the feature with |
Yes, it does. |
thanks! oef |
Hi,
I’m having issues applying OpenType features to text in a PDF.
I’ve rewritten my own renderer to write original drawBot code so I can test it in the main DrawBot.app to rule out problems with my own code.
For instance, the
sups
feature doesn’t apply.I’ve collected the files to test here.
The example with the
sups
feature is in line 408 (result shows on page 3 in the PDF).The feature gets turned on beforehand and turned off afterwards. I found this to cause less confusion in the rendering than explicitly setting all available features at once.
What puzzles me:
If I reduce the code to just the necessary lines to render that text with the
sups
feature, it renders fine (never mind that the feature isn’t written professionally yet, as in all the glyphs in the example would get replaced at the moment, not contextually...).That means that somewhere along the way someone got confused with the commands to the point where features don’t get applied properly anymore.
So this works, which is exactly the same code, only much less:
The text was updated successfully, but these errors were encountered: