Results 1 to 10 of 10

Thread: FontStudio exporter TCharacterData question

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

    FontStudio exporter TCharacterData question

    Hi All,

    I was building a plugin for font studio to export the data to my engine-readable-format when I bumped upon the TCharacterData struct:
    Code:
         TCharacterData = packed record    //This is how plugins version 3 and above will recieve FontData - an array of TCharacterData
          Wid,Hgt, X,Y: cardinal;          //Unsigned 32bit
           Ox, Oy, A, B, C: integer;       //Signed 32bit
          char: cardinal;                  //The actual unicode character number
    And a question arises: what does the A, B and C mean?
    NecroSOFT - End of line -

  2. #2
    Sorry, guess I should have documented it a bit better (I thought I did explain it somewhere in that file )

    From this page: http://msdn.microsoft.com/en-us/libr...=VS.85%29.aspx

    • The A spacing is the distance to add to the current position before drawing the character glyph.
    • The B spacing is the width of the drawn portion of the character glyph.
    • The C spacing is the distance to add to the current position to provide white space to the right of the character glyph.
    Last edited by Nitrogen; 10-10-2010 at 08:51 PM.
    My site: DelphiTuts.com (coming soon)...

    Download Font Studio 4.21 here.

  3. #3
    Nitrogen!

    Your download link to Font Studio really don't works here to me! I don't know what happens, but your domain http://labs.delphituts.com/ is not acessible here, I'm trying for months already. Is there some alternative download link?

    Thanks!

  4. #4
    Hmm.. I just found this record definition in Font4.pas:

    Code:
      FontInfo = record
        A, C: integer;
        Wid, Hgt: cardinal;
        char: WideChar;
        x1,y1,x2,y2: double;
      end;
    Why is B missing? By looking at your source, my guess is that it's added to C.

    Code:
    procedure TFontObj.Draw(const X, Y: single; const Txt: widestring; Lev: single);
    var CurX: single;
        Ch: Widechar;
        Chaar, I, Ind: integer;
    begin
       CurX := X;
    
       for I := 1 to length(Txt) do
       begin
           Ch := Txt[I];
           Chaar := integer(ch);
    
           if Chaar = 32 then
           begin
             Ind := -1;
             CurX := CurX + SpaceWidth;
           end
           else
           begin
             Ind := CharLookup[Chaar];
           end;
    
           if ind > -1 then
           begin
             CurX := CurX + F[Ind].A;
    
             DrawQuadRT(CurX, Y, F[ind].Wid, F[ind].Hgt, lev, F[ind].x1,F[ind].x2,F[ind].y1,F[ind].y2);
    
             CurX := CurX + F[Ind].C;
           end;
       end;
    
    end;
    Would be nice if you added some comments to make these things clear.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  5. #5
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059
    Thnx, that realy helps a lot
    NecroSOFT - End of line -

  6. #6
    Quote Originally Posted by wagenheimer View Post
    Nitrogen!

    Your download link to Font Studio really don't works here to me! I don't know what happens, but your domain http://labs.delphituts.com/ is not acessible here, I'm trying for months already. Is there some alternative download link?

    Thanks!
    Strange... How about http://www.delphituts.com/labs/FontStudio421.zip
    My site: DelphiTuts.com (coming soon)...

    Download Font Studio 4.21 here.

  7. #7
    Quote Originally Posted by chronozphere View Post
    Would be nice if you added some comments to make these things clear.

    Oops! The separate B and C values are actually something I did recently and I dont think I updated any of the .fnt file reading sources so they still have only A and C... The old .fnt file exporter plugin still uses the old method (Font Studio 4.21 is backward compatible with the old plugins) so if you want *all* the A,B and C values, I'll have to update the .fnt exporter and corresponding Font4.pas file (with comments of course )
    My site: DelphiTuts.com (coming soon)...

    Download Font Studio 4.21 here.

  8. #8
    Hi Again Nitron!

    The download link really don't works here! http://www.delphituts.com/labs/FontStudio421.zip

    I can not even ping delphituts.com here, I tryed it for days long and I think it does not works here in Brazil, it is blocked someway.

    Is there no altenative download links? Please upload it to 4shared or any other free hosting service!

    Thanks!

  9. #9
    The link does work here. Perhaps someone should make a mirror download?
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  10. #10
    Just one more question about TCharacterData ... what are Ox and Oy values?

    Edit: ahhh... it's all in the readme.txt
    Last edited by Srki_82; 08-12-2010 at 10:16 PM.

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
  •