×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    187

    Question custom font problem

    i create a font and use it in my app. it's work fine on emluator. i install the app on my device(OS 6.1), and copy the font to c:\system\fonts. after restart my device, i found sth. strange.
    1. some app i had installed before display with my font, not the default font.
    2. In my app, i use CRichText, and also draw text with my font, except i had specified the font format.

    how can i solve these problem?
    is it my font mistake?

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    187
    can anybody help me?

  3. #3
    Registered User
    Join Date
    Jun 2003
    Posts
    4
    If some other applications use your font it's probably because the call
    GetNearestFontInTwips()
    returns your font.

    The reason for this is the font specification (size, name) of your font probably closer matches to the spec requested by the application than the spec of the system font.
    Plus your font is loaded first (since it on C: drive) and if application simply picks up the first font in font collection, it will use your font.

  4. #4
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    187
    i solved it.
    it's my font's mistake.

  5. #5
    Regular Contributor
    Join Date
    Oct 2004
    Location
    india
    Posts
    306

    gr8 !!!!

    hi,

    i think u have solved problem urself...its gr8..
    if possible could u tell me how to make custom font(its better if u pass piece of code) as im damm in need of making my own font....

    i'll be very very thankfull to u if u could pass me a code how to make my own font...


    thanks in advance..

    bye bye

  6. #6
    Registered User
    Join Date
    Jan 2005
    Posts
    391
    HI,How did u solve your problem and how to make your own fonts, thx!

  7. #7
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    187
    i use fnttran.exe to build my font
    Code:
    cl /P /EP myfont.gd
    fnttran myfont.i myfont.gdr
    here is an example of myfont.gd

    Code:
    #include "myfont12.bdf"
    
    Typeface myfont
       	Name "MyFont" Proportional Symbol Serif
       	FontBitmaps
    		myfont12
       	EndFontBitmaps
    EndTypeface
    
    FontStoreFile
       	CollectionUid 131094171
       	KPixelAspectRatio 1000
       	CopyrightInfo
          	    "Copyright ..."
       	EndCopyrightInfo
       	Typefaces
          	    myfont
       	EndTypefaces
    EndFontStoreFile
    and here is an example of myfont12.bdf
    Code:
    STARTFONT 2.1
    COMMENT myfont 6x12
    FONT myfont12
    SIZE 12 72 72
    FONTBOUNDINGBOX 9 11 0 -1
    STARTPROPERTIES 8
    Uid 141227935
    MaxNormalCharWidth 9
    MaxConsecutiveFillChars 5
    Bold 1
    Italic 0
    FONTASCENT 11
    FONTDESCENT 1
    COPYRIGHT "Copyright ..."
    ENDPROPERTIES
    CHARS 2
    STARTCHAR a
    ENCODING 97
    SWIDTH 266 0
    DWIDTH 6 0
    BBX 5 7 1 0
    BITMAP
    70
    D8
    18
    78
    D8
    D8
    68
    ENDCHAR
    STARTCHAR m
    ENCODING 109
    SWIDTH 399 0
    DWIDTH 9 0
    BBX 8 7 1 0
    BITMAP
    B6
    DB
    DB
    DB
    DB
    DB
    DB
    ENDCHAR
    ENDFONT
    in my old file: myfont12.bdf, i use "SWIDTH 1000 0" for all character, so it case mistake. now i change the value of
    SWIDTH to scale with character width each.

    i hope it's helpful.

  8. #8
    Regular Contributor
    Join Date
    Oct 2004
    Location
    india
    Posts
    306

    when i use myfont its not displaying text

    hello...

    thx a lot for ur code...

    But when i use create and use same thing (myfont) in my program ..it displaying "aa aaa mam" like this instead of the passed text..

    text is displayed normally when i use other fonts..its bahaving abnormally when i use myfont its not displaying text given ...

    if help me how to use my customised font...


    thx in advance

    bye bye

  9. #9
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    187
    yes, this is only an example. There is only two characters("a" and "m") in "myfont", u can replace it or add others with your own fonts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •