我的WPF win APP使用下面的代碼,當字體已經安裝時,它可以正常工作。使用自定義字體而無需安裝win8.1 WPF APP
Button infoButton = new Button();
infoButton.Content = new FontIcon
{
FontFamily = new FontFamily("Segoe MDL2 Assets"),
Glyph = "",
Foreground = new SolidColorBrush(Colors.WhiteSmoke)
};
我想使用自定義字體,而無需在Windows上安裝它。我在解決方案中包含了所有相關的字體文件(將構建操作設置爲內容)。我如何使用上面的代碼?我知道如何在XAML中使用它,但我想在C#中使用它。
你不能將它添加到資源,並從那裏設置字體? – Prajwal
我必須從服務器代碼 – afr0