| # GetFont Utility for GrLCM Library

Home : Products | Applications | Technical Support | 2002/07/16

# What's GetFont

GetFont is a utility to help programmer to get font used by his program. It will only collect font used into one file to save user's disk space. GrLCM support a lot of language display. All European characters are built-in. Some language (Trad. Chinese, Simp. Chinese and Japanese) should use GetFont to get font needed. For easily use, we provide three batch files to do that: big5.bat, gb.bat and sjis.bat.

# Get Font Step by Step

You can get usage form help screen of GetFont:

    C:\GrLCM\font>getfont

    DM&P GetFont Utility for GrLCM Library. (Jul 16 2002 10:46:16)

    GETFONT:Read double byte coded text file and generate indexed font file
    Usage:
    GETFONT encode_type input_text_file output_font_file bdf_font_file
    encode_type : sjis/gbk/big5/ksc
    input_text_file : double byte coded text file
    output_font_file : output index font file
    bdf_font_file : BDF font file

    C:\GrLCM\font>

For easily use, we will show you how to get font with our batch files. You can find big5.c, gb.c and sjis.c at \GRLCM\LIB. They are language message files of MT_LANG project to demo milti-language function. Run big5.bat to get Trad. Chinese font and you will get a big5.fnt:

    C:\GrLCM\FONT>big5 ..\lib\big5.c

    DM&P GetFont Utility for GrLCM Library. (Jul 16 2002 10:46:16)

    double byte char in file=4
    used char number=4

    C:\GrLCM\FONT>

Get Simp. Chinese font:

    C:\GrLCM\FONT>gb ..\lib\gb.c

    DM&P GetFont Utility for GrLCM Library. (Jul 16 2002 10:46:16)

    double byte char in file=4
    used char number=4

    C:\GrLCM\FONT>

Get Japanese font:

    C:\GrLCM\FONT>sjis ..\lib\sjis.c

    DM&P GetFont Utility for GrLCM Library. (Jul 16 2002 10:46:16)

    double byte char in file=3
    used char number=3

    C:\GrLCM\FONT>

Now, get will get three .FNT files:

    C:\GrLCM\FONT>dir *.fnt
     Volume in drive C is DMP
     Volume Serial Number is 3560-14E1

     Directory of C:\GrLCM\FONT

    2002/07/16  AM 11:31               138 BIG5.FNT
    2002/07/16  AM 11:31               138 GB.FNT
    2002/07/16  AM 11:31               104 SJIS.FNT
                   3 File(s)            380 bytes
                   0 Dir(s)   3,510,304,768 bytes free

    C:\GrLCM\FONT>

Copy *.FNT to directory where MT_LANG.EXE is. MT_LANG.EXE will automatically load it when show Chinese or Japanese.

# Multi-Language Example

You can get a MT_LANG project at \GrLCM\LIB that will demo multi-language function. There are two way to display non-English characters:

- GrLcm_SetLanguage()
After you use GrLcm_SetLanguage() to select language, GrLCM will treat all display message as language you selected.(besides GrLcm_printf3()).
- GrLcm_printf3()
GrLcm_printf3() should assign language type for each call. It is useful to show some different languages at the same time. For example, you need GrLcm_printf3() to display "Select Language" menu that will show languages you supported at the same screen.

For more example code, see MT_LANG project please.

Note: You should set font size to 8 X 16 when display non-English characters.

# Technical Support

If you have any problem, feel free to mail to tech@dmp.com.tw please.

Jan Yin Chan Electronics Co., LTD. All rights reserved. | Email us: info@dmp.com.tw