Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Nokia 9210, OPL and Font

4 replies · 4,407 views · Started 23 December 2003

Dear developer,

I wish to develop an application in OPL for Nokia 9210. That application should be display some component (such as Label of menu bar in my language "Khmer"😉. I have read some document related to the font, they said that we can use other font instead of the default font by using 'gLoadFont' and 'gUnLoadFont'. I am try to do that too but still getting the default font displayed.

I have used some tool that convert from TTF font to GDR file format and I place that file to the folder in which Font are stored. Then I write some OPL code to display that font but I got nothing beside the default font. I mean nothing change for the new font.

The code are :

PROC Test:
LOCAL fontid%
fontid% = gLoadFont("Z:\System\Fonts\lmns1.gdr"😉
PRINT "salaron"
gUnLoadFont(fontid%)
GET
ENDP

I have use this font as a TTF source file(lmns1.ttf). It can be download at http://www.khmer.p2pmessage.com/lmns1.ttf .

How can I do to display my font in Nokia 9210 by using OPL language?. Nowaday I just try it in Emulator Nokia 9210.

Best regards,

Which TTF-GDR conversion tool are you using? Take note that older tools, i.e. Symbian OS v5.0 and earlier, might have problems with Unicode fonts. You could check the output format in a hexeditor.

You need to set the font after loading it. Now, you only load the font. To set it as the active font, use the FONT command (for text output with PRINT) or gFONT (for graphics output, eg gPRINT).

HTH

Best regards

Arjen

Arjen Broeze wrote:You need to set the font after loading it. Now, you only load the font. To set it as the active font, use the FONT command (for text output with PRINT) or gFONT (for graphics output, eg gPRINT).

Yes! And this brings up another question; you also need to make sure you have UIDs defined, because FONT and gFONT works with font UIDs, not names.

These UIDs should be unique, so you should apply for them from Symbian Dev Net. If they are conflicting with built-in UIDs or other fonts you have loaded, it won't work.

If you check further throughout Alex Zavorine's pages, you will notice that he has assigned such UIDs to his own font creations: ArialNarrow, Math, Comic, Dingbats etc.

Furthermore, font UIDs are long integers (&😉 not short integers (%) as in your loading sequence above.

cheers
Martin