using cAlgo.API;
namespace cAlgo
{
// このサンプルは、チャートコントロールのフォントプロパティを使用して、フォントサイズ、スタイル、ファミリーを設定する方法を示しています
[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 = "細いウェイト サイズ 10 フォントスタイル ノーマル フォント デフォルト",
FontSize = 10,
FontWeight = FontWeight.Thin,
FontStyle = FontStyle.Normal,
ForegroundColor = Color.Black,
Margin = 10
});
stackPanel.AddChild(new TextBlock
{
Text = "細いウェイト サイズ 10 フォントスタイル イタリック フォント デフォルト",
FontSize = 10,
FontWeight = FontWeight.Thin,
FontStyle = FontStyle.Italic,
ForegroundColor = Color.Black,
Margin = 10
});
stackPanel.AddChild(new TextBlock
{
Text = "細いウェイト サイズ 10 フォントスタイル オブリーク フォント デフォルト",
FontSize = 10,
FontWeight = FontWeight.Thin,
FontStyle = FontStyle.Oblique,
ForegroundColor = Color.Black,
Margin = 10
});
stackPanel.AddChild(new TextBlock
{
Text = "ブラックウェイト サイズ 10 フォントスタイル ノーマル フォント デフォルト",
FontSize = 10,
FontWeight = FontWeight.Black,
FontStyle = FontStyle.Normal,
ForegroundColor = Color.Black,
Margin = 10
});
stackPanel.AddChild(new TextBlock
{
Text = "ボールドウェイト サイズ 10 フォントスタイル ノーマル フォント デフォルト",
FontSize = 10,
FontWeight = FontWeight.Bold,
FontStyle = FontStyle.Normal,
ForegroundColor = Color.Black,
Margin = 10
});
stackPanel.AddChild(new TextBlock
{
Text = "ヘビウェイト サイズ 10 フォントスタイル ノーマル フォント デフォルト",
FontSize = 10,
FontWeight = FontWeight.Heavy,
FontStyle = FontStyle.Normal,
ForegroundColor = Color.Black,
Margin = 10
});
stackPanel.AddChild(new TextBlock
{
Text = "ボールドウェイト サイズ 20 フォントスタイル ノーマル フォント デフォルト",
FontSize = 20,
FontWeight = FontWeight.Bold,
FontStyle = FontStyle.Normal,
ForegroundColor = Color.Black,
Margin = 10
});
stackPanel.AddChild(new TextBlock
{
Text = "ボールドウェイト サイズ 20 フォントスタイル ボールド フォント デフォルト",
FontSize = 20,
FontWeight = FontWeight.Bold,
FontStyle = FontStyle.Bold,
ForegroundColor = Color.Black,
Margin = 10
});
stackPanel.AddChild(new TextBlock
{
Text = "ボールドウェイト サイズ 20 フォントスタイル イタリック フォント デフォルト",
FontSize = 20,
FontWeight = FontWeight.Bold,
FontStyle = FontStyle.Italic,
ForegroundColor = Color.Black,
Margin = 10
});
stackPanel.AddChild(new TextBlock
{
Text = "ボールドウェイト サイズ 20 フォントスタイル オブリーク フォント デフォルト",
FontSize = 20,
FontWeight = FontWeight.Bold,
FontStyle = FontStyle.Oblique,
ForegroundColor = Color.Black,
Margin = 10
});
}
}
}