export_options.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <html>
  2. <head>
  3. <title>Bitmap Font Generator - Documentation</title>
  4. </head>
  5. <body>
  6. <h1>Bitmap Font Generator - Documentation</h1>
  7. <p><a href="../documentation.html">Back to main page</a></p>
  8. <h2>Export options</h2>
  9. <p><img src="export_options.png" align="right"></p>
  10. <p>You can open the export options dialog by going to the Options menu and
  11. choosing Export options, or you can just press T on the keyboard.</p>
  12. <p>This dialog controls how the font will be stored, i.e. texture layout, file format, etc.</p>
  13. <h3>Padding</h3>
  14. <p>Padding is useful when you want to add some post processing effects in another
  15. paint program. For example, if you want to add a blurring effect that uses a 5x5 kernel,
  16. you would add a padding of 2 on all sides. Similarly if you want to add a drop shadow, you
  17. would add a bit of padding below and to the right of the characters (assuming that's the
  18. direction of the drop shadow that you want).
  19. <h3>Spacing</h3>
  20. <p>The spacing controls how much minimum space is left between characters in the font
  21. texture. If you're using mipmapping to scale the font texture when drawing the font, you'll
  22. need to add spacing to avoid bleeding when the texture is downscaled. The more mipmap levels
  23. you use the more spacing you need.</p>
  24. <p>Bilinear filtering may also cause bleeding, so unless you use pixel perfect drawing, where
  25. each texel is perfectly mapped to a pixel on the screen with a 1-to-1 releation ship you'll
  26. want to use at least 1 for vertical and horizontal spacing.</p>
  27. <h3>Equalize the cell heights</h3>
  28. <p>When this option is checked, all the font characters will be exported into cells of equal height.
  29. This option is especially useful when you workflow for producing the final font includes a post
  30. processing step where the characters are 'painted' based on the height of character, e.g. when
  31. applying a gradient.</p>
  32. <p>The drawback is that less characters will fit in the texture, and the font renderer will draw larger
  33. rectangles.</p>
  34. <h3>Force offsets to zero</h3>
  35. <p>This option was created to improve support for font renderers that don't handle xoffset, yoffset, and xadvance.
  36. When the option is checked the glyph images will be padded so that xoffset and yoffset will be 0
  37. and xadvance will be equal to the width. This option also forces the equalization of the cell heights.</p>
  38. <p>Observe, that this will modify the final spacing between characters if the original TrueType font uses negative
  39. xoffsets, or xadvance that is smaller than the glyph width, i.e. if the characters have any overhang.</p>
  40. <h3>Texture</h3>
  41. <p>BMFont supports several different texture layouts. The width and height, of course control
  42. the size of the texture. You'll want to keep the texture as small as possible, while
  43. still allowing all characters to fit in one texture.</p>
  44. <p>If you're importing colored icons, or planning on using post processing to add colors to the
  45. characters, then you'll want to choose the 32bit format, otherwise the 8bit format may be sufficient.</p>
  46. <p>If you choose the 32bit format, you may still optimize the usage of the texture memory if you
  47. choose to pack characters in each channel, though that will require a special <a href="pixel_shader.html">pixel shader</a> to
  48. decode during drawing. In this mode you can still import colored icons, the characters will be
  49. properly packed around them.</p>
  50. <p>The font outline can also be encoded together with the character in 8 bits, allowing you to
  51. store many more characters in the same space than if you had stored the outlined characters as
  52. colored images. This too require a special <a href="pixel_shader.html">pixel shader</a> to
  53. decode during drawing.</p>
  54. <p><b>Channel options</b></p>
  55. <ul>
  56. <li><i>glyph</i> : The channel will be set according to the glyph geometry. A value of 1 means the pixel is within the glyph.
  57. <li><i>outline</i> : The channel will be set according to the outline geometry. A value of 1 means the pixel is within the outline or glyph.
  58. <li><i>glyph + outline</i> : The value is encoded to allow separation of glyph and outline. A value of 0.5 means the pixel is within the outline, but not within the glyph. A value of 1 means the pixel is within the glyph.
  59. <li><i>one</i> : All pixels in the channel will be set to 1.
  60. <li><i>zero</i> : All pixels in the channel will be set to 0.
  61. </ul>
  62. <p>Some of the more common choices are:</p>
  63. <ul>
  64. <li>32bit white glyphs with black outline: alpha = <i>outline</i>, red = green = blue = <i>glyph</i>
  65. <li>32bit white glyphs without outline: alpha = <i>glyph</i>, red = green = blue = <i>one</i>
  66. <li>packed textures with glyph and outline encoded in 8 bits: alpha = <i>glyph + outline</i>
  67. <li>packed textures with glyphs without outline: alpha = <i>glyph</i>
  68. </ul>
  69. <h3>File format</h3>
  70. <p>Finally you can choose the file format for both the font descriptor and textures. This is mostly
  71. a matter of choice, rather than one having more benefits than the other. Though if you want to save
  72. disc space, you may want to choose binary file descriptor with png textures.</p>
  73. </body>
  74. </html>