In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.