3
<title>FontWeight (Inline) Test Page</title>
5
<script language="javascript" src="Silverlight.js"></script>
7
<script type="text/xaml" id="xaml">
8
<Canvas x:Name="canvas" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="100" Height="100" Loaded="onLoaded">
10
<Run Foreground="Black" FontFamily="Arial" FontSize="24">No value</Run>
12
<Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="Thin">Thin</Run>
14
<Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="ExtraLight">ExtraLight</Run>
16
<Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="Light">Light</Run>
18
<Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="Normal">Normal</Run>
20
<Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="Medium">Medium</Run>
22
<Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="SemiBold">SemiBold</Run>
24
<Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="Bold">Bold</Run>
26
<Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="ExtraBold">ExtraBold</Run>
28
<Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="Black">Black</Run>
30
<Run Foreground="Black" FontFamily="Arial" FontSize="24" FontWeight="ExtraBlack">ExtraBlack</Run>
32
<TextBlock Canvas.Left="200">
33
<Run x:Name="testcase1" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 1</Run>
35
<Run x:Name="testcase2" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 2</Run>
37
<Run x:Name="testcase3" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 3</Run>
39
<Run x:Name="testcase4" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 4</Run>
41
<Run x:Name="testcase5" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 5</Run>
43
<Run x:Name="testcase6" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 6</Run>
45
<Run x:Name="testcase7" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 7</Run>
47
<Run x:Name="testcase8" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 8</Run>
49
<Run x:Name="testcase9" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 9</Run>
51
<Run x:Name="testcase10" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 10</Run>
53
<Run x:Name="testcase11" Foreground="Black" FontFamily="Arial" FontSize="24">Test case 11</Run>
58
<script language="javascript">
59
function onLoaded (sender, args)
61
// invalid values defaults to None (no value is Default)
62
sender.findName ("testcase1").FontWeight = 1024;
63
sender.findName ("testcase2").FontWeight = 0;
64
sender.findName ("testcase3").FontWeight = "eXtrAlIgHt";
65
sender.findName ("testcase4").FontWeight = -475;
66
sender.findName ("testcase5").FontWeight = 32768;
67
sender.findName ("testcase6").FontWeight = 549;
69
sender.findName ("testcase7").FontWeight = 550;
70
sender.findName ("testcase8").FontWeight = -1;
71
sender.findName ("testcase9").FontWeight = 1023;
72
sender.findName ("testcase10").FontWeight = -474;
73
sender.findName ("testcase11").FontWeight = "eXtRaBlaCk";
75
// Silverlight shows an Alert
76
// Silverlight error message, ErrorCode: 2203, ErrorType:RuntimeError, Message: AG_E_RUNTIME_SETVALUE, MethodName: FontWeight
78
sender.findName ("testcase3").Cursor = sender.findName ("testcase2");
79
sender.findName ("testcase3").Cursor = null;
80
sender.findName ("testcase3").Cursor = true;
87
<div id="SilverlightPluginHost" style="position:absolute; top:50px; left:50px; width:500px; height:50px;"></div>
89
<script type="text/javascript">
90
var pe = document.getElementById("SilverlightPluginHost");
91
Silverlight.createObject("#xaml", pe, "AgControl1", {
94
inplaceInstallPrompt:false,
105
<div style="position:absolute; top:400px; left:50px">
106
<p>First column: "No value" to "Medium" are normal, "SemiBold" to "ExtraBlack" are <b>bold</b>
107
<p>Second column: "Test case 1-6" are normal, "Test case 7-11" are <b>bold</b>