Class DocumentFontsSubsystem

Class DocumentFontsSubsystem

ชื่อพื้นที่: Aspose.Note.Fonts การประกอบ: Aspose.Note.dll (25.4.0)

การประยุกต์ใช้ที่ง่ายของ Aspose.Note.FontsSubsystem. Retrieves System.Drawing.FoontFamily object จาก 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 โดยใช้ตัวอักษรที่กําหนดเองจาก Stream

// 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(สตรีม, Dictionary<string, string="">)

เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Note.Fonts.DocumentFonsSubsystem

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

Parameters

defaultFontStream Stream

หมายเลขที่กําหนดเอง

fontsSubstitutions Dictionary < string , string >

ตัวแทนของ fonts

DocumentFontsSubsystem(string, คําพูด<string, string="">)

เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Note.Fonts.DocumentFonsSubsystem

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

Parameters

defaultFontFile string

หมายเลขที่กําหนดเอง

fontsSubstitutions Dictionary < string , string >

ตัวแทนของ fonts

DocumentFontsSubsystem(ลักษณะ: String, String="">)

เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Note.Fonts.DocumentFonsSubsystem

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

Parameters

fontsSubstitutions Dictionary < string , string >

ตัวแทนของ fonts

Properties

Default

รับหรือตั้งค่าตัวอย่าง default static

public static DocumentFontsSubsystem Default { get; set; }

คุณสมบัติมูลค่า

DocumentFontsSubsystem

Methods

FetchFontFamily(รั้ว)

Fetches ครอบครัวอักษรเป็น候補สําหรับ GetFontFamily

protected override FontFamily FetchFontFamily(string fontName)

Parameters

fontName string

ชื่อ font

Returns

FontFamily

The System.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 >

ตัวแทนของ fonts

Returns

DocumentFontsSubsystem

Aspose.Note.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 ใหม่โดยใช้ font จากไฟล์ที่ระบุเป็นแบบกําหนดเอง

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

Parameters

filePath string

ไฟล์ที่มีชื่ออักษรแบบกําหนดเอง

fontsSubstitutions Dictionary < string , string >

ตัวแทนของ fonts

Returns

DocumentFontsSubsystem

Aspose.Note.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(สตรีม, Dictionary<string, string="">)

สร้างตัวอย่าง DocumentFontsSubsystem ใหม่โดยใช้อักษรจากสตรีมที่ระบุเป็นแบบกําหนดเอง

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

Parameters

defaultFontStream Stream

กระแสที่มีชื่ออักษรที่กําหนดเอง

fontsSubstitutions Dictionary < string , string >

ตัวแทนของ fonts

Returns

DocumentFontsSubsystem

Aspose.Note.Fonts.DocumentFonsSubsystem ระบบ

Examples

แสดงวิธีการบันทึกเอกสารในรูปแบบ PDF โดยใช้ตัวอักษรที่กําหนดเองจาก Stream

// 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,>

 แบบไทย