Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why I get squares instead of text?

I tried to install and use a font in my WPF application, but all I get is like this: enter image description here

Here is the code I tried to use the font:

richtext1.FontFamily = "SH_Roq'a";

The expected result is: ( snap shot from MS Word ) enter image description here

If I try to add the font file to the project folder, and use it as a resource, like this:

richtext1.FontFamily = "./#SH_Roq'a";

I won't get the square results, but, I won't have the expected font either! What I get is Tahoma font:

enter image description here

which is not the targeted font, please download the targeted font file here for experiments

Any help is appreciated!

EDIT

The plain text for the above captured text is:

تفاح احمر

So for those who are experts with using fonts, they can experiment with.

like image 518
simo Avatar asked Jun 12 '12 14:06

simo


1 Answers

There are several problems with the font:

  1. it is not Unicode-encoded: it uses a Platform ID 3, Encoding ID 0 cmap subtable, also known as a "Symbol" table. These do not generally work well outside of old-style Windows desktop applications.

  2. there are no OpenType Layout features (GSUB, GPOS, etc.) which are essential for correct shaping (initial, medial, final, isolated forms; lam-alef ligatures, etc.) of Arabic/Urdu/Farsi writing.

  3. it uses a very, very old OS/2 table (version 0). Some Microsoft technologies require version 1 at minimum. There are also reserved bits set in the fsSelection field of this table and a number of other suspect settings.

I stopped looking there. This font appears to have been built with very old tools, using outdated knowledge of font construction. It needs significant updating in order to work correctly in modern environments.

like image 112
djangodude Avatar answered Nov 15 '22 10:11

djangodude