Glyph Designer BMFont Export Format


  • This section describes the contents of the BMFont output format used by Glyph Designer. The BMFont format was originally created by Andreas Jönsson and can be found at http://www.angelcode.com. Information about BMFont format was taken from information found on that page.

    Glyph Designer provides a number of different output options:

    • BMFont Text
    • BMFont XML
    • BMFont LUA
    • BMFont Binary
    • Sprite Kit

    In the drop down list of export types the list is a little longer as it also lists some different file extensions as well e.g. .txt and .xml. Regardless of the file extension, if BMFont is mentioned in the export type then the contents of the export will adhere to the BMFont format, but laid out as required by the format being used e.g. text or XML.

    This article will cover the contents of BMFont output. It will not specifically cover the Sprite Kit export format which is proprietary to Glyph Designer, but the contents of that file format are the same as BMFont, but not formatted in the same way.

    info

    face - Fonts display name
    size - Font size
    bold - 1 = bold, 0 = not bold
    italic - 1 = italic, 0 = not italic
    charset - Not used by Glyph Designer
    unicode - Always set to 1 as all glyphs use unicode
    stretchH - Fonts height stretch. Always 100%
    smooth - Not used by Glyph Designer
    aa - Always 1 in Glyph Designer
    padding - The padding within each glyph image (up, right, down, left)
    spacing - The spacing between each glyph image on the texture atlas (horizontal, vertical)
    outline - Not used by Glyph Designer

    common

    lineHeight - The distance in pixels between each line of text
    base - The number of pixels from the top of the glyph to the base line
    scaleW - Not used by Glyph Designer
    scaleH - Not used by Glyph Designer
    pages - Always 1 when using Glyph Designer
    packed - Not used by Glyph Designer

    page

    This tag gives the name of the texture file to be used with this control file

    id - The page id which is always 0 for Glyph Designer
    file - Filename of the texture file to use

    char

    This tag describes the characters and glyphs within a font. There is one for each character in the font.

    id - The characters unicode id
    x - x location for the top left corner glyph image in the texture atlas
    y - y location for the top left corner glyph image in the texture atlas
    width - Width of the glyph image within the texture atlas
    height - Height of the glyph image within the texture atlas
    xoffset - How much to adjust the x position of the glyph when rendering it defined by font metrics
    yoffset - How much to adjust the y position of the glyph when rendering it defined by font metrics
    xadvance - How far to advance the x position to render the next glyph in the string
    page - Not used by Glyph Designer
    chnl - Not used by Glyph Designer

    kerning

    The kerning information is used to adjust the distance between glyphs between certain characters. This allows letters such as o to sit under W e.g.

    first - The first character id
    second - The second character id
    amount - Amount to adjust the x position for the character +/-


  • 1
    Posts
    620
    Views
    Log in to reply

Internal error.

Oops! Looks like something went wrong!