The use of bmfont tools for art in cocos2d-x

Source: Internet
Author: User

1. download and install the free Bitmap Font creation tool Bitmap Font Generator in windows

Tools:Http://www.angelcode.com/products/bmfont/install_bmfont_1.13.exe

2. Open the software and select Opotion> FontSetting to set the font to be exported.

I will use here. Size can set the font Size, it is best to set the Size of the Size, here is 32 Height can set the font stretch Height, keep the default 100% can be


3. select Edit-> Clear all chars in font to Clear the following characters.

4. Select the menu Edit-> Selecting text from file... select a file that contains the text you want to generate.

Generate a *. Txt file containing the file you want to generate the font, as shown in figure

Select the created txt file. If any error occurs, check whether the txt file is unicode or UTF-8 encoded and whether the font contains the font in the text.
5. Option-> ExportOptions to set the exported style.

Here are some important points.

This attribute is very important when Padding is used to specify the size of the text surrounding the text and make the style later, we need to reserve space for special effects such as stroke and glow. For example, I expect to add a 2px border for my style and then add a 2px projection effect in the lower right corner, so I set the padding: 2px 4px 4px 2px

BitDepth, which must be 32 bits; otherwise there is no transparent layer

Presets: Specifies the preset color channel settings for font initialization, that is, the initial color settings of the font. We recommend that you use White text to set it to White text with alpha, that is, the transparent background of the White text.

Font descript: Specifies the Font description file. It can be in text or xml format, that is, fnt.

Textures, texture image format, decisive png.
6. option-> Save bitmap font...
Export it into a text file and a description file. If you follow the above configuration, there will be a *. png and a *. fnt

This is the exported png image. To make it clear, I chose black and transparent. The specific color depends on your application.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.