3
A
回答
7
How to manage custom fonts in web application (system.drawing)
它應該有可能你的 字體文件存儲在磁盤上或在數據庫中,並 然後使用 PrivateFontCollection類 使用的字體在運行。
這裏是你將如何使用它:
PrivateFontCollection collection = new PrivateFontCollection();
// Add the custom font families.
// (Alternatively use AddMemoryFont if you have the font in memory, retrieved from a database).
collection.AddFontFile(@"E:\Downloads\actest.ttf");
using (var g = Graphics.FromImage(bm))
{
// Create a font instance based on one of the font families in the PrivateFontCollection
Font f = new Font(collection.Families.First(), 16);
g.DrawString("Hello fonts", f, Brushes.White, 50, 50);
}
乾杯。
相關問題
- 1. 如何加載自定義字體?
- 2. 自定義圖標字體未加載
- 3. 自定義繪製CTreeCtrl:如何添加字體穿透?
- 4. 繪製自定義形狀以將圖像加載爲recyclerview項目
- 5. 用自定義字體繪製標籤
- 6. android:什麼是首選,加載自定義字體或圖像?
- 7. 在窗體上繪製自定義圖標
- 8. 如何在旋轉的自定義圖像地圖上繪製GPS標記
- 9. 在Windows 8 Metro應用中加載自定義字體
- 10. 如何正確加載自定義UICollectionViewCell上的圖像?
- 11. @ font-face不加載自定義字體
- 12. Xamarin窗體Windows Azure自定義登錄
- 13. CoreText不加載自定義字體
- 14. PixiJS:加載自定義字體
- 15. 如何在CustomBox中添加自定義加載圖像?
- 16. 自定義字體僅在加載字體時才顯示
- 17. 如何繪製圖像上的文字
- 18. 加載自定義字體失敗
- 19. 自定義CSS字體加載問題
- 20. 如何在畫布上繪製自定義視圖android
- 21. 如何在Apple Watch上繪製自定義圖形?
- 22. 自定義字體不加載
- 23. 在窗體上繪製加載圓形
- 24. Android自定義字體加載錯誤
- 25. 如何將SD卡上的PNG圖像加載到Canvas以在Android中繪製?
- 26. 繪製自定義圖表
- 27. 自定義字體未被加載?
- 28. 如何在imagestring()中加載我的自定義字體?
- 29. 在Windows窗體中加載圖像
- 30. 如何加載大小超過60kb的自定義字體(ttf)