Skip to content

FontStyle

Summary

Specifies style information applied to text.

Signature

1
public enum FontStyle

Namespace

cAlgo.API

Fields

Name Description
Normal Normal text.
Oblique Oblique text.
Italic Italic text.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample shows how to use a chart control font properties to set font size, style, and family
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class FontSample : Indicator
     {
         protected override void Initialize()
         {
             var stackPanel = new StackPanel
             {
                 HorizontalAlignment = HorizontalAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center,
                 BackgroundColor = Color.Gold,
                 Opacity = 0.6
             };
             stackPanel.AddChild(new TextBlock
             {
                 Text = "Thin Weight Size 10 FontStyle Normal Font Default",
                 FontSize = 10,
                 FontWeight = FontWeight.Thin,
                 FontStyle = FontStyle.Normal,
                 ForegroundColor = Color.Black,
                 Margin = 10
             });
             stackPanel.AddChild(new TextBlock
             {
                 Text = "Thin Weight Size 10 FontStyle Italic Font Default",
                 FontSize = 10,
                 FontWeight = FontWeight.Thin,
                 FontStyle = FontStyle.Italic,
                 ForegroundColor = Color.Black,
                 Margin = 10
             });
             stackPanel.AddChild(new TextBlock
             {
                 Text = "Thin Weight Size 10 FontStyle Oblique Font Default",
                 FontSize = 10,
                 FontWeight = FontWeight.Thin,
                 FontStyle = FontStyle.Oblique,
                 ForegroundColor = Color.Black,
                 Margin = 10
             });
             stackPanel.AddChild(new TextBlock
             {
                 Text = "Black Weight Size 10 FontStyle Normal Font Default",
                 FontSize = 10,
                 FontWeight = FontWeight.Black,
                 FontStyle = FontStyle.Normal,
                 ForegroundColor = Color.Black,
                 Margin = 10
             });
             stackPanel.AddChild(new TextBlock
             {
                 Text = "Bold Weight Size 10 FontStyle Normal Font Default",
                 FontSize = 10,
                 FontWeight = FontWeight.Bold,
                 FontStyle = FontStyle.Normal,
                 ForegroundColor = Color.Black,
                 Margin = 10
             });
             stackPanel.AddChild(new TextBlock
             {
                 Text = "Heavy Weight Size 10 FontStyle Normal Font Default",
                 FontSize = 10,
                 FontWeight = FontWeight.Heavy,
                 FontStyle = FontStyle.Normal,
                 ForegroundColor = Color.Black,
                 Margin = 10
             });
             stackPanel.AddChild(new TextBlock
             {
                 Text = "Bold Weight Size 12 FontStyle Normal Font Default",
                 FontSize = 12,
                 FontWeight = FontWeight.Bold,
                 FontStyle = FontStyle.Normal,
                 ForegroundColor = Color.Black,
                 Margin = 10
             });
             stackPanel.AddChild(new TextBlock
             {
                 Text = "Thin Weight Size 12 FontStyle Normal Font Calibri Light Italic",
                 FontSize = 12,
                 FontWeight = FontWeight.Thin,
                 FontStyle = FontStyle.Normal,
                 ForegroundColor = Color.Black,
                 FontFamily = "Calibri Light Italic",
                 Margin = 10
             });
             Chart.AddControl(stackPanel);
         }
         public override void Calculate(int index)
         {
         }
     }
 }

Last update: December 5, 2022

Comments