Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does Silverlight 5 RC improve font rendering?

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Today I'll show you how Silverlight 5 RC improves font rendering. The content of the article is good. Now I would like to share it with you. Friends who feel in need can understand it. I hope it will be helpful to you. Let's read it along with the editor's ideas.

Font rendering has been greatly optimized in the Silverlight 5 RC version, which now has a new class TextOptions with three dependency properties TextFormattingMode, TextHintingMode, and TextRenderingMode. The rendering mode of the font is defined.

1.TextFormattingMode

It has two formatting modes, which is to set the formatting of the font.

1.1 Display: it uses metrics to format fonts and symbols to make fonts appear clearer

1.2 Ideal: it's the old pattern, relatively less clear.

2.TextHintingMode

It has two fine-tuning modes, which is whether the rendering mode setting of the font is turned off.

2.1 Fixed: default mode, rendering mode

2.2 Animated: new mode, which turns off rendering mode

3.TextRenderingMode

It has four rendering modes, which is to set the font rendering type

3.1 Auto: automatic mode. ClearType is used by default, unless ClearType is disabled on this machine.

3.2 Aliased: no anti-aliasing mode, no anti-aliasing function

3. 3 Grayscale: use grayscale antialiasing to draw text

3.4 ClearType: smooth anti-aliasing drawing text

Let's take a look at the text processing in the Silverlight 5 RC version through an example. The Xaml code is as follows:

TextOptions.TextFormattingMode= "Display" TextOptions.TextHintingMode= Fixed "TextOptions.TextRenderingMode=" ClearType "/ > TextOptions.TextFormattingMode=" Display "TextOptions.TextHintingMode=" Animated "TextOptions.TextRenderingMode=" ClearType "/ > TextOptions.TextFormattingMode=" Display "TextOptions.TextHintingMode=" Fixed "TextOptions.TextRenderingMode=" Aliased "/ > TextOptions.TextFormattingMode=" Display "TextOptions.TextHintingMode=" Fixed "TextOptions.TextRenderingMode=" Grayscale "/ > TextOptions.TextFormattingMode=" Ideal "TextOptions.TextHintingMode=" Fixed "TextOptions.TextRenderingMode=" Cleartype "/ >

The CS code is as follows, and the text display effect is set through the background code.

PublicMainPage () {InitializeComponent (); / / background sets the text display effect of the tbText control TextOptions.SetTextFormattingMode (tbText, TextFormattingMode.Ideal); TextOptions.SetTextHintingMode (tbText, TextHintingMode.Fixed); TextOptions.SetTextRenderingMode (tbText, TextRenderingMode.Aliased);}

Finally, let's take a look at the results as follows. If you need the source code, please click SL5Text.zip to download.

That's all about Silverlight 5 RC's improvements in font rendering, and more related to Silverlight 5 RC's improvements in font rendering. You can search previous articles or browse the following articles to learn! I believe the editor will add more knowledge to you. I hope you can support it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report