Android does not support the Urdu Nastaliq
font properly (the word is broken up and the exact shape (Nastaliq) of the word is not made).
I have used Typeface for this as
TextView tx=(TextView)this.findViewById(R.id.tt);
tx.setTypeface(Typeface.createFromAsset(getAssets(),"TTF font Path"));
I am able to get the exact formating of the Nastaliq Font in java using the AWT package like
Font font = Font.createFont(Font.TRUETYPE_FONT, new File("Path for ttf file"));
Font dynamicFont32Pt = font.deriveFont (32f);
JLabel textLabel = new JLabel(textMessage);
textLabel.setFont(dynamicFont32Pt);
But Android also does not support the AWT Package Properly (java.awt.Font.createFont()
and deriveFont()
), So we decided to make a render engine for the .ttf file for Urdu.
Now my question is-
- Can we get the urdu Font (properly) rendering in Android without needing a Rendering Engine? If not, then
- How can I read the .ttf file (All tables like 'glyp', 'head') in Android?
- How can I draw a TTF font, that is, a vector font that does not require a PNG?