ScottPlot国际化

支持的字体检测

ScottPlot 附带字体检测方法,可帮助识别用于显示可能包含国际字符的文本的最佳安装字体。

  

Internationalization.cs

string chinese = "测试";
WpfPlot1.Plot.Axes.Title.Label.Text = chinese;
WpfPlot1.Plot.Axes.Title.Label.FontName = Fonts.Detect(chinese);

string japanese = "試験";
WpfPlot1.Plot.Axes.Left.Label.Text = japanese;
WpfPlot1.Plot.Axes.Left.Label.FontName = Fonts.Detect(japanese);

string korean = "테스트";
WpfPlot1.Plot.Axes.Bottom.Label.Text = korean;
WpfPlot1.Plot.Axes.Bottom.Label.FontName = Fonts.Detect(korean);

WpfPlot1.Refresh();


自动字体检测

Plot 的 Style 类包含一个方法,该方法会自动将常见绘图对象的字体设置为最有可能显示它们所包含的字符的字体。

  

Internationalization.cs

var sig1 = WpfPlot1.Plot.Add.Signal(Generate.Sin(phase: .1));
var sig2 = WpfPlot1.Plot.Add.Signal(Generate.Sin(phase: .2));
var sig3 = WpfPlot1.Plot.Add.Signal(Generate.Sin(phase: .3));

sig1.LegendText = "测试"; // Chinese
sig2.LegendText = "試験"; // Japanese
sig3.LegendText = "테스트"; // Korean
WpfPlot1.Plot.ShowLegend();

WpfPlot1.Plot.Title("测试"); // Chinese
WpfPlot1.Plot.YLabel("試験"); // Japanese
WpfPlot1.Plot.XLabel("테스트"); // Korean

WpfPlot1.Plot.Font.Automatic(); // set font for each item based on its content

WpfPlot1.Refresh();
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

code_shenbing

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值