Added support for OpenType font attributes in Silverlight, which are mainly controlled by Typography attributes. Next let's take a look at what attributes it adds.
Note: The OpenType of the system must be used, so FontFamily = "gabriel ".
I. Pen hyphens
Connect "ft". As shown in the green box, you can determine whether to establish a connection based on True or False of Typography. StandardLigatures:
The Code is as follows:
<TextBlock FontFamily="Gabriola" FontSize="100" HorizontalAlignment="Center"
Margin="33,304,142,114" Text="NewsftepSet-"
Typography.StandardLigatures="False" Width="525" />
<TextBlock FontFamily="Gabriola" FontSize="100" HorizontalAlignment="Center"
Margin="33,406,142,12" Text="NewsftepSet-"
Typography.StandardLigatures="True" Width="525" />
Ii. decimal points
Display scores such as 1/5 and 4/13 according to mathematical score numbers. Control by setting the Typography. Fraction attribute to Normal, Slashed, and Stacked.
The Code is as follows:
<TextBlock Text="5/152 Normal" HorizontalAlignment="Center"
FontFamily="Gabriola" FontSize="50" Height="100"
Typography.Fraction="Normal" Margin="487,313,12,187" />
<TextBlock Text="5/152 Slashed" HorizontalAlignment="Center"
FontFamily="Gabriola" FontSize="50" Height="100"
Typography.Fraction="Slashed" Margin="487,373,31,0" VerticalAlignment="Top" />
<TextBlock Text="5/152 Stacked" HorizontalAlignment="Center"
FontFamily="Gabriola" FontSize="50" Height="100"
Typography.Fraction="Stacked" Margin="487,419,9,81" />
Iii. up/down Mark
For example, the chemical iron oxide is used to set the Typography. Variants attribute to Subscript and Superscript to enable the upper and lower mark. For example:
The Code is as follows:
<TextBlock FontFamily="Gabriola" FontSize="50" Height="100"
HorizontalAlignment="Center" Margin="487,488,117,12" >
<Run Text="Fe" Typography.Variants="Normal" />
<Run Text="2" Typography.Variants="Subscript" />
<Run Text="O" Typography.Variants="Normal" />
<Run Text="3" Typography.Variants="Superscript" />
</TextBlock>
4. Hand writing
In our daily life, we need some pretty hand writing. In Silverlight 5 RC, we have prepared 7 styles of hand writing by setting Typography. the True and False values of StylisticSet * are implemented. The number * is replaced by an integer ranging from 1 to 7, and the number above 8 is invalid. For example:
The Code is as follows:
<TextBlock Text="NewsftepSet-" HorizontalAlignment="Center" FontSize="50"
Height="100" FontFamily="Gabriola" Margin="20,12,484,488" />
<TextBlock Text="NewsftepSet1" HorizontalAlignment="Center" FontSize="50" FontFamily="Gabriola"
Typography.StylisticSet1="True" Height="100" Margin="245,12,255,488" />
<TextBlock FontFamily="Gabriola" FontSize="50" Height="100" HorizontalAlignment="Center"
Margin="471,12,28,488" Text="NewsftepSet2" Typography.StylisticSet2="True" />
<TextBlock FontFamily="Gabriola" FontSize="50" Height="100" HorizontalAlignment="Center"
Margin="20,118,478,382" Text="NewsftepSet3" Typography.StylisticSet3="True" />
<TextBlock FontFamily="Gabriola" FontSize="50" Height="100" HorizontalAlignment="Center"
Margin="246,118,246,382" Text="NewsftepSet4" Typography.StylisticSet4="True" />
<TextBlock FontFamily="Gabriola" FontSize="50" Height="100" HorizontalAlignment="Center"
Margin="471,118,25,382" Text="NewsftepSet5" Typography.StylisticSet5="True" />
<TextBlock FontFamily="Gabriola" FontSize="50" HorizontalAlignment="Center" Width="221"
Margin="20,224,459,253" Text="NewsftepSet6" Typography.StylisticSet6="True" />
<TextBlock FontFamily="Gabriola" FontSize="50" HorizontalAlignment="Center" Width="218"
Margin="247,224,235,253" Text="NewsftepSet7" Typography.StylisticSet7="True" />
If you need the source code, click SL5OpenType.zip to download it. Thank you for your support ~