Class DocumentFontsSubsystem

Class DocumentFontsSubsystem

名称: Aspose.Note.Fonts 集合: Aspose.Note.dll (25.4.0)

簡單的實施 Aspose.Note.FontsSubsystem. Retrieves System.Drawing.FoontFamily 對象從 OS。

public class DocumentFontsSubsystem : FontsSubsystem, IFontsSubsystem

Inheritance

object FontsSubsystem DocumentFontsSubsystem

Implements

IFontsSubsystem

继承人

FontsSubsystem.AddFontSubstitution(string, string) , FontsSubsystem.AddFont(Stream, string) , FontsSubsystem.AddFont(Stream) , FontsSubsystem.AddFont(string) , FontsSubsystem.LoadFontsFromFolder(string) , FontsSubsystem.GetFontFamily(string) , FontsSubsystem.TranslateFontName(string) , FontsSubsystem.FetchFontFamily(string) , FontsSubsystem.FindFontFamilyInInternalCollection(string) , FontsSubsystem.DefaultFont , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

显示如何保存文档在PDF格式使用指定的默认字体。

// The path to the documents directory.
                                                                                   string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                                   // Load the document into Aspose.Note.
                                                                                   Document oneFile = new Document(Path.Combine(dataDir, "missing-font.one"));

                                                                                   // Save the document as PDF
                                                                                   dataDir = dataDir + "SaveUsingDocumentFontsSubsystemWithDefaultFontName_out.pdf";
                                                                                   oneFile.Save(dataDir, new PdfSaveOptions() 
                                                                                                         {
                                                                                                             FontsSubsystem = DocumentFontsSubsystem.UsingDefaultFont("Times New Roman")
                                                                                                         });

显示如何从文件中保存文档的PDF格式使用默认字体。

// The path to the documents directory.
                                                                                     string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                                     string fontFile = Path.Combine(dataDir, "geo_1.ttf");

                                                                                     // Load the document into Aspose.Note.
                                                                                     Document oneFile = new Document(Path.Combine(dataDir, "missing-font.one"));

                                                                                     // Save the document as PDF
                                                                                     dataDir = dataDir + "SaveUsingDocumentFontsSubsystemWithDefaultFontFromFile_out.pdf";
                                                                                     oneFile.Save(dataDir, new PdfSaveOptions()
                                                                                                               {
                                                                                                                   FontsSubsystem = DocumentFontsSubsystem.UsingDefaultFontFromFile(fontFile)
                                                                                                               });

显示如何保存文档在PDF格式使用默认字体从流。

// The path to the documents directory.
                                                                                       string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                                       string fontFile = Path.Combine(dataDir, "geo_1.ttf");

                                                                                       // Load the document into Aspose.Note.
                                                                                       Document oneFile = new Document(Path.Combine(dataDir, "missing-font.one"));

                                                                                       // Save the document as PDF
                                                                                       dataDir = dataDir + "SaveUsingDocumentFontsSubsystemWithDefaultFontFromStream_out.pdf";

                                                                                       using (var stream = File.Open(fontFile, FileMode.Open, FileAccess.Read, FileShare.Read))
                                                                                       {
                                                                                           oneFile.Save(dataDir, new PdfSaveOptions()
                                                                                                                     {
                                                                                                                         FontsSubsystem = DocumentFontsSubsystem.UsingDefaultFontFromStream(stream)
                                                                                                                     });
                                                                                       }

Constructors

DocumentFontsSubsystem(流, 词典<string, string="">)

启动 Aspose.Note.Fonts.DocumentFonsSubsystem 类的新例子。

public DocumentFontsSubsystem(Stream defaultFontStream, Dictionary<string, string=""> fontsSubstitutions = null)

Parameters

defaultFontStream Stream

默认字体。

fontsSubstitutions Dictionary < string , string >

字体替代。

DocumentFontsSubsystem(string, 字典<string, string="">)

启动 Aspose.Note.Fonts.DocumentFonsSubsystem 类的新例子。

public DocumentFontsSubsystem(string defaultFontFile, Dictionary<string, string=""> fontsSubstitutions = null)

Parameters

defaultFontFile string

默认字体。

fontsSubstitutions Dictionary < string , string >

字体替代。

DocumentFontsSubsystem(字典<string, string="">)

启动 Aspose.Note.Fonts.DocumentFonsSubsystem 类的新例子。

public DocumentFontsSubsystem(Dictionary<string, string=""> fontsSubstitutions = null)

Parameters

fontsSubstitutions Dictionary < string , string >

字体替代。

Properties

Default

接收或设置静态默认例子。

public static DocumentFontsSubsystem Default { get; set; }

财产价值

DocumentFontsSubsystem

Methods

FetchFontFamily(线条)

Fetches 字体家庭作为 GetFontFamily 的候选人。

protected override FontFamily FetchFontFamily(string fontName)

Parameters

fontName string

字体名称。

Returns

FontFamily

此分類上一篇:Drawing.FontFamily

UsingDefaultFont(string, 字典<string, string="">)

使用默认字体名称创建新的 DocumentFontsSubsystem 例子。

public static DocumentFontsSubsystem UsingDefaultFont(string defaultFontName, Dictionary<string, string=""> fontsSubstitutions = null)

Parameters

defaultFontName string

默认字体名称。

fontsSubstitutions Dictionary < string , string >

字体替代。

Returns

DocumentFontsSubsystem

此分類上一篇: WL31_.Fonts.DocumentFonsSubsystem

Examples

显示如何保存文档在PDF格式使用指定的默认字体。

// The path to the documents directory.
                                                                                   string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                                   // Load the document into Aspose.Note.
                                                                                   Document oneFile = new Document(Path.Combine(dataDir, "missing-font.one"));

                                                                                   // Save the document as PDF
                                                                                   dataDir = dataDir + "SaveUsingDocumentFontsSubsystemWithDefaultFontName_out.pdf";
                                                                                   oneFile.Save(dataDir, new PdfSaveOptions() 
                                                                                                         {
                                                                                                             FontsSubsystem = DocumentFontsSubsystem.UsingDefaultFont("Times New Roman")
                                                                                                         });

UsingDefaultFontFromFile(string, 字典<string, string="">)

创建新的 DocumentFontsSubsystem 例子,使用默认文件中的字体。

public static DocumentFontsSubsystem UsingDefaultFontFromFile(string filePath, Dictionary<string, string=""> fontsSubstitutions = null)

Parameters

filePath string

文件包含默认字体名称。

fontsSubstitutions Dictionary < string , string >

字体替代。

Returns

DocumentFontsSubsystem

此分類上一篇: WL31_.Fonts.DocumentFonsSubsystem

Examples

显示如何从文件中保存文档的PDF格式使用默认字体。

// The path to the documents directory.
                                                                                     string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                                     string fontFile = Path.Combine(dataDir, "geo_1.ttf");

                                                                                     // Load the document into Aspose.Note.
                                                                                     Document oneFile = new Document(Path.Combine(dataDir, "missing-font.one"));

                                                                                     // Save the document as PDF
                                                                                     dataDir = dataDir + "SaveUsingDocumentFontsSubsystemWithDefaultFontFromFile_out.pdf";
                                                                                     oneFile.Save(dataDir, new PdfSaveOptions()
                                                                                                               {
                                                                                                                   FontsSubsystem = DocumentFontsSubsystem.UsingDefaultFontFromFile(fontFile)
                                                                                                               });

UsingDefaultFontFromStream(流, 词典<string, string="">)

创建新的 DocumentFontsSubsystem 例子,使用默认情况下从指定流中输入字体。

public static DocumentFontsSubsystem UsingDefaultFontFromStream(Stream defaultFontStream, Dictionary<string, string=""> fontsSubstitutions = null)

Parameters

defaultFontStream Stream

包含默认字体名称的流。

fontsSubstitutions Dictionary < string , string >

字体替代。

Returns

DocumentFontsSubsystem

此分類上一篇: WL31_.Fonts.DocumentFonsSubsystem

Examples

显示如何保存文档在PDF格式使用默认字体从流。

// The path to the documents directory.
                                                                                       string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                                       string fontFile = Path.Combine(dataDir, "geo_1.ttf");

                                                                                       // Load the document into Aspose.Note.
                                                                                       Document oneFile = new Document(Path.Combine(dataDir, "missing-font.one"));

                                                                                       // Save the document as PDF
                                                                                       dataDir = dataDir + "SaveUsingDocumentFontsSubsystemWithDefaultFontFromStream_out.pdf";

                                                                                       using (var stream = File.Open(fontFile, FileMode.Open, FileAccess.Read, FileShare.Read))
                                                                                       {
                                                                                           oneFile.Save(dataDir, new PdfSaveOptions()
                                                                                                                     {
                                                                                                                         FontsSubsystem = DocumentFontsSubsystem.UsingDefaultFontFromStream(stream)
                                                                                                                     });
                                                                                       }

</string,></string,></string,></string,></string,></string,></string,></string,></string,></string,></string,></string,>

 中文