Results 1 to 4 of 4

Thread: TDXFont

  1. #1

    TDXFont

    Hi Everybody,

    I'm programming a new version of game Simon.

    I would like to use special fonts in my program. As far I know, I must to use PowerFont with bmp image file with all the characters. Since here no problem.

    My question is: It is possible to use a bitmap image file with all the characters and that each character have diferent size?

    Now, in the ImageList I select the correct image file and give the dimension of every box. But I would like to use a image file that no all the characters have the same size...

    I don't know if I explain well my problem... I hope yes!!!

    Thanks a lot for your time!

    David

  2. #2

    TDXFont

    If i remember well, you load a single image file into the TDXImageList and set it on the TDXFont. To achive what you want i think you should set the tile size (pattern width, pattern height) to the biggest char on your image.

    For example, you create an image with tiles of 48x48 and then you can have a character of 10 pixel, 12, 16, 20, 24, 32, 40, whatever.
    The problem is that spacing between character would be different depending on the char size. To solve this i'm afraid you should create your own TDXFont component that inherits from it and handles the space between characters.

    Let's see if someone else has another solution
    <center>
    <br />Federico &quot;FNX&quot; Nisoli
    <br />Lead Programmer - FNX Games
    <br />http://www.fnxgames.com
    <br /><img src="http://www.fnxgames.com/imgs/banners/fnxban.gif">
    <br /></center>

  3. #3

    Thanks

    Really Thanks!!

    One more question... do you know how use font in tga file?

  4. #4
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    TDXFont

    You could also write your own font generator. This is easy of you use just a default TBitmap and render the font with TextOut or something like that. You could also use a TGA for that. This way its your decision of how big each character will be. The coordinates you can save in an array, dump it to a file so you can also load it later on and don't have to generate it.
    NecroSOFT - End of line -

Bookmarks

Posting Permissions

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