Page 5 of 5 FirstFirst ... 345
Results 41 to 46 of 46

Thread: Bitmap Font Generator

  1. #41

    Bitmap Font Generator

    Quote Originally Posted by chronozphere
    @Nitrogen. I have a question about the format you save your data in.

    In the font4.pas unit i found this datastructure??

    [pascal]
    type FontInfo = record
    A, C: integer;
    Wid, Hgt: cardinal;
    char: WideChar;
    x1,y1,x2,y2: double;
    end;
    [/pascal]

    Can you explain what the different fields mean??
    I get the (x1,y1,x2,y2) Rectangle on the texture but e.g i can't figure out what A and C contain?
    Can you explain that please??

    Thanx!
    From one of Nitrogen's posts above:

    "Yes. it generates a set of texture coordinates for each character as well as their ABC widths (A being leading space, B being total width, C being trailing space) as defined inside the font file, so you can render them *exactly* how windows renders it!"

    cheers,
    Paul.

  2. #42

    Bitmap Font Generator

    But how about the kerning?
    Does anybody calculate it or retrieve it from the text rendering function?

    Because I now make what could be called a built-in analog of this stuff for my engine, developing also the kerning calculation algorithm. It's raw and untested yet, but once it's done I'll post the code.

    P.S. I did it before, for my now dead manga scanlation tool.

    P.P.S. Kerning is the inter-character distance that considers the shape of characters. Each character have one value for each other character, so generally, kerning is a N * N numeric array. Being the smartass I am, my prog caches it in the grayscale PNGs to avoid repeating the lenghty re-calculation each time program starts up.

    P.P.P.S. For anyone interested, the algorithm is this: the text as a single line, with wide spaces between characters, created in GIMP or Photoshop, resulting in an grayscale bitmap, usually somewhere around 6000x20. Al the characters are stored parallelly as a single-line text file (which is also used in GIMP to render the text consistently). When the program starts, it checks if one of these files is newer than the texture file, in this case rebuilding the texture and kerning data by automatically bisecting the single strip source image according the charset text file. The first two characters are always "0"s, for the calibration purpose.

    Allows you to use the hand-drawn and hand-retouched fonts (I, actually, have one, I drew it back in 2000).

  3. #43

    Bitmap Font Generator

    Nice tool
    From brazil (:

    Pascal pownz!

  4. #44

    Bitmap Font Generator

    Quote Originally Posted by arthurprs
    Nice tool
    only too hard to use inside my app ;/
    From brazil (:

    Pascal pownz!

  5. #45

    Bitmap Font Generator

    Is there any example of how to use fonts generated by FontTool 4?

  6. #46

    Bitmap Font Generator

    http://www.nitrogen.za.org/projectinfo.asp?id=13

    Should work with version 3.0. I assume it also works with 4.0 and up but not sure. You should try that.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

Page 5 of 5 FirstFirst ... 345

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
  •