Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Need information about font tool — Gideros Forum

Need information about font tool

RickyngkRickyngk Member
edited June 2012 in General questions
After export font with Gideros font tool, I've got a file .txt, like:

0
32
1 1
0 0
0 0
256 0

33
17 1
2 10
1 10
256 0

Would you please let me know more information about this file, and how it's used in TextField
Afaik:
33 --> char code
17 1 --> letter position in image
2 10 --> size of letter
1 10 --> base height, and unknown value
256 0 --> unknown

font-descent-height = size[0] - base_height

Regards,

Comments

  • gorkemgorkem Maintainer
    See: http://www.giderosmobile.com/forum/discussion/comment/6215#Comment_6215

    @atilim would it be nice to include this information in reference document? Shall I file a request for this on bugs.giderosmobile.com?

    Likes: MikeHart

    +1 -1 (+1 / -0 )Share on Facebook
  • RickyngkRickyngk Member
    edited June 2012
    Dear gorken,
    I think there're something different here:
    For font arial - italic size11, letter A (see attachment)

    65
    79 40
    8 8
    -1 8
    448 0

    I dont know clearly (-1, 8), and (448, 0) is used for. About (448, 0) , I think that it's not relative to dx2, dy2 as http://www.giderosmobile.com/forum/discussion/comment/6215#Comment_6215
    because size of image is 114x143 <<< 448

    Regards,

    example.png
    114 x 143 - 11K
  • atilimatilim Maintainer
    edited June 2012
    Hi,

    We're using FreeType2 to render fonts and all these values are related to FreeType2's glyph metrics: http://www.freetype.org/freetype2/docs/tutorial/step2.html

    33 --> char code
    17 1 --> letter position in image
    2 10 --> size of letter
    1 10 --> bearingX, bearingY (or bitmap_left, bitmap_top)
    256 0 --> advanceX, advanceY (multiplied by 64)

    Here bearing is used to render the glyph at correct position and advance is used to move the pointer to the next position (advanceY is always 0).

    here is a code from http://www.freetype.org/freetype2/docs/tutorial/step1.html to render a text which explains these values:
    pen_x = 300;
    pen_y = 200;
    for ( n = 0; n < num_chars; n++ )
    {
        /* ............... */
     
        /* now, draw to our target surface */ 
        my_draw_bitmap( &slot->bitmap, pen_x + slot->bitmap_left, pen_y - slot->bitmap_top ); 
     
        /* increment pen position */ 
        pen_x += slot->advance.x >> 6;
        pen_y += slot->advance.y >> 6; /* not useful for now */
    }
  • RickyngkRickyngk Member
    edited July 2012
    I'd like to give a clear figure ;)
    Gideros_font_format.png
    411 x 556 - 15K

    Likes: phongtt, atilim

    +1 -1 (+2 / -0 )Share on Facebook
Sign In or Register to comment.