Tips for using dot-matrix fonts (such as XXFarEastFont-Arial) in Silverlight

Source: Internet
Author: User
Tags vector font silverlight

We know that the default Chinese font for Silverlight is "Ya-black," which is a vector font that is guaranteed to be true when the size of the text changes. But is the effect really as good as we think?

Let's do an experiment, a simple XAML

<textblock fontsize= "text=" I am the song of the body, ABC? Margin= "/>"

The effect of the following figure:

It looks okay, but as you can see from the actual project development, in SL, some of the words in the dark, such as: "Increase" the word deformation of a class of more powerful (although the SL3 has a significant improvement), it is difficult to let us often and the song and other standard Chinese font to deal with people accept.

People often ask: "Why the SL font so vague ah." SL can't use the Song Dynasty, it sucks! Wait

In fact, the SL can definitely use dot matrix font, but this technique is not very clear to most people.

Let's set the XAML fontfamily property

<textblock fontsize= "fontfamily=" SimSun "text=" I am the song of the body, ABC? Margin= "/>"

Look at the effect

What do you think? The Standard song body! The key is that the value of fontfamily should be "SimSun" rather than "XXFarEastFont-Arial".

But here, this solution is not perfect. We look at "ABC" these three English, not as good as the default. I'm not really sure about this, but to solve this problem we just need to explicitly set English (like Arial) fonts. To see the XAML by setting the method

<textblock fontsize= "fontfamily=" Arial,simsun "text=" I am the song of the body, ABC? Margin= "/>"

Look at the effect

 

Well, it's perfect.

Note the order and setting of the fontfamily: both fonts are separated by a half-width comma (,), and the English font must be written before the Chinese font.

OK, hope to be useful to everyone.

Source: http://024hi.cnblogs.com/

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.