簡體   English   中英

Microsoft Interop Excel,列出C# Vsto中所有可用的字體styles

[英]Microsoft Interop Excel, List all the available Font styles in C# Vsto

我是 .Net 世界的新手。 在正在開發的 Excel 的插件中,我想列出 Excel 中可用的所有字體 styles。請問是否有類似於 Excel.XlRgbColor.rgbDimGrey(用於顏色)的東西可以列出所有fonts。

辦公應用使用安裝在操作系統中的fonts。 此處的 Excel 列出了 fonts 來自 Windows API。因此 fonts 在 Microsoft.Office.Interop.Excel 中不可用,而在 System.Drawing.Text 中不可用。 https://learn.microsoft.com/en-us/do.net/framework/winforms/advanced/how-to-enumerate-installed-fonts )。

using System.Drawing.Text;
InstalledFontCollection installedFontCollection = new InstalledFontCollection();
FontFamily[] fontFamilies = installedFontCollection.Families;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM