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

Malayalam support #3

Open
jeesmon opened this issue Jan 9, 2013 · 3 comments
Open

Malayalam support #3

jeesmon opened this issue Jan 9, 2013 · 3 comments

Comments

@jeesmon
Copy link

jeesmon commented Jan 9, 2013

Hi,

Thanks a lot for this library. I'm trying to get Malayalam rendering using your code. But ligature substitution is not working. Could you please point me to the code where I should be looking? Here is the font that I use http://jeesmon.csoft.net/fonts/Kaumudi.ttf

ex: ത + ് + ത (\u0D24 + \u0D4D + \u0D24) should render ത്ത (glyphid: ml_t_ta (65581))

Thanks,
Jeesmon

@mta452
Copy link
Owner

mta452 commented Jan 10, 2013

First of all, you should understand open type font specifications for Malayalam script as described at: http://www.microsoft.com/typography/OpenTypeDev/malayalam/intro.htm

The problem is not ligature substitution. It only works for allowed scripts and features. You should change these for both substitution and positioning.

To change script for substitution, open SheenFigure/SFInternal/SFGSUBUtilization.c, locate line no. 88 and change variable gsubFeaturesTagOrder to have those tags as described in microsoft page's shaping features paragraph. Also locate line no. 604 and change script tag from "arab" to malayalam's tag. (I don't know that)

To change script for positioning, open SheenFigure/SFInternal/SFGPOSUtilization.c, locate line no. 28 and change variable gposFeaturesTagOrder to have those tags as described in microsoft page's positioning features paragraph. Also change script tag at line no. 622.

Please note that, I have not tested Context Substitution and Positioning tables and therefore they are not supported. So if your font uses these, you will have problems.

@jeesmon
Copy link
Author

jeesmon commented Jan 10, 2013

Thanks a lot for the quick reply. I made changes as you suggested. Now I can see the ligatures are formed correctly. Still some issues with re-ordering of glyphs. Please see the attachment. In the red box, those two chars should be reversed (should be തെ). Any hint to fix it?

Screen Shot 2013-01-10 at 12 16 35 PM

@mta452
Copy link
Owner

mta452 commented Jan 22, 2013

Hi,

Note that some processing is done manually; like in arabic there are four forms of an alphabet and the font does not provide information about which form should be used. If this is also the case in Malayalam, you'll have to include the code for initial processing of text.

Also note that, text is reversed before processing because Arabic/Urdu is a right-to-left language and SheenFigure focus on them.

I checked the font you provided. Almost all tables in it are ligature substitution and there is no positioning table. I don't think the problem is in the library.

I would have fixed the issue if I knew Malayalm :)

Hope you can fix it yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants