cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate Arabic GSUB tables

LTimm.1
Associate III

Hi,

I have been experimenting with various languages including Arabic.

For the most part every thing is great, but we seem to be missing the GSUB table to handle Arabic ligatures correctly.

How do I enable the generation of this?

I tried the Arabic example project in the Designer also, but that doesn't seem to generate them either.

We are using version 4.13.0.

Thanks

4 REPLIES 4
Martin KJELDSEN
Chief III

The GSUB tables are in the font. If they're there, they should be generated. We just released a fix for a known issue that would generate additional glyph data for glyphs referenced in GSUB table even if those glyphs were not used in a text in the application.

https://touchgfx.zendesk.com/hc/en-us/articles/207507415-Known-Issues

There's nothing in the designer that configures GSUB. The font is an interface that we use to read data from - So you'd have to modify your font to _not_ get GSUB tables generated, for instance.

It could be that the font used in the example does not contain gsub rules - It could.

/Martin

LTimm.1
Associate III

Thanks for the answer Martin,

The font should have GSUB tables in it. At least I can see them in FontForge.

I will dig around a bit more, and some different fonts and also the newly released patch (Just to be sure).

Will let you know of my progress.

Martin KJELDSEN
Chief III

Thanks for that. Then we can be absolutely sure :)

/Martin

LTimm.1
Associate III

So I did some more trials, with different fonts.

I started a fresh simulator project and added my Arabic text in four different text areas.

The text comes from: https://www.omniglot.com/language/phrases/haveaniceday.htm

I assigned different fonts to each text area:

  • arabtype.ttf (From the Arabic example in TouchGFX)
  • Almarai-Regular.ttf (Found via https://fonts.google.com/, Can be downloaded here: https://github.com/JuergenWillrodt/Almarai)
  • DroidSansArabic.ttf (Used in Android)
  • DroidSansFull.ttf (This is a combined font based on DroidSansArabic and others... This was the font I originally discovered the issue)

I have attached if anybody wants to take a look.

Of the four text fields, only the one using arabtype.ttf actually works.

The others are missing glyphs.

Th simulator reports this:

WARNING: Skipping character 'ñ' (unicode 0xFCA4=64676)

WARNING: Skipping character 'Ä' (unicode 0xFC8E=64654)

And sure enough those characters are only present in arabtype.ttf and not the others.

So far so good :-)

I'm still puzzled by the gsub and ligature rules, because as far as I can see there are no GSUB generated for either of the fonts, not even arabtype.ttf.

But there must be some ligature substitution in place because my original strings does not contain 0xFCA4 or 0xFC8E:

KEEP extern const touchgfx::Unicode::UnicodeChar texts_all_languages[] TEXT_LOCATION_FLASH_ATTRIBUTE =
{
    0x627, 0x62a, 0x645, 0x646, 0x649, 0x20, 0x644, 0x643, 0x20, 0x64a, 0x648, 0x645, 0x627, 0x20, 0x637, 0x64a, 0x628, 0x627, 0x0 // @0 "????? ?? ???? ????"
};

So that kinda leaves me with the conclusion that TouchGFX has some build in rules for Arabic ligature substitution, that matches the arabtype.ttf but no the two others I have tried with. Can anyone confirm this?

I guess the ideal solution would be to use the substitution rules from the actual font used, to ensure they are compatible.

At least it could be nice to get an overview of the rules implemented in TouchGFX so we can try to ensure that our chosen font supports it.

Thanks.