Learn WP7 XNA Game Development (three. Two Sprite texture Font)

Source: Internet
Author: User
Sprite Texture Font

For XNA fonts, in addition to the previous Spritefont there is a spritetexturefont, in fact, is the generated font bitmap picture, that is, you can use the bitmap type of fonts as a XNA font set, this is tantamount to expanding the font library, The font library that is not in the phone can also be used. Its use is the same as the Spritefont, are loaded with Spritefont, and then painted by the drawstring method.

To use the picture library, you first need to make a font picture. In the Http://www.daisy123.com/?page_id=427%20 Ttf2bmp project can directly generate font pictures, the project is open source.

It seems so good to use Chinese and it seems to be no problem! But the fact is not so perfect, because if you want to generate more than 20,000 Chinese characters, the picture will be very large, which caused the failure to load, because the WP7 to the picture limit is 2048K, and only thousands of words of the picture library has more than 10 m. It seems that if you want to use Chinese characters still have a lot of strength to deal with the font.

 

This is a tool-generated font library picture file:

Realize:

The text picture that will be generated by the tool is added to the project. The implementation code is the same as Spritefont.



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.