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
{
    public void Initialize(Document document)
    {
    }
    public Font GetFontByName(string name)
    {
    }
    public Font GetDefaultFont()
    {
    }
}

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 โดยใช้ตัวอักษรเริ่มต้นที่ระบุ

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(Path.Combine(dataDir, "missing-font.one"));
   string dataDirWithOutput = dataDir + "SaveUsingDocumentFontsSubsystemWithDefaultFontName_out.pdf";
   oneFile.Save(dataDirWithOutput, new PdfSaveOptions()
   {
       FontsSubsystem = DocumentFontsSubsystem.UsingDefaultFont("Times New Roman")
   });

แสดงวิธีการบันทึกเอกสารในรูปแบบ PDF โดยใช้ตัวอักษรเริ่มต้นจากไฟล์

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   string fontFile = Path.Combine(dataDir, "geo_1.ttf");
   Document oneFile = new Document(Path.Combine(dataDir, "missing-font.one"));
   dataDir += "SaveUsingDocumentFontsSubsystemWithDefaultFontFromFile_out.pdf";
   oneFile.Save(dataDir, new PdfSaveOptions()
                 {
                   FontsSubsystem = DocumentFontsSubsystem.UsingDefaultFontFromFile(fontFile)
                 });

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

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   string fontFile = Path.Combine(dataDir, "geo_1.ttf");
   Document oneFile = new Document(Path.Combine(dataDir, "missing-font.one"));
   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( Stream, 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, ลักษณะ <strings, 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(string)

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

protected override FontFamily FetchFontFamily(string fontName)
   {
   }

Parameters

fontName string

ชื่อ font

Returns

FontFamily

The System.Drawing.FontFamily

UsingDefaultFont(string, ลักษณะ <strings, 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 โดยใช้ตัวอักษรเริ่มต้นที่ระบุ

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(Path.Combine(dataDir, "missing-font.one"));
   string dataDirWithOutputPath = dataDir + "SaveUsingDocumentFontsSubsystemWithDefaultFontName_out.pdf";
   oneFile.Save(dataDirWithOutputPath, new PdfSaveOptions()
   {
       FontsSubsystem = DocumentFontsSubsystem.UsingDefaultFont("Times New Roman")
   });

UsingDefaultFontFromFile(string, ลักษณะ <strings, 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 โดยใช้ตัวอักษรเริ่มต้นจากไฟล์

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   string fontFile = Path.Combine(dataDir, "geo_1.ttf");
   Document oneFile = new Document(Path.Combine(dataDir, "missing-font.one"));
   string dataDirWithPath = dataDir + "SaveUsingDocumentFontsSubsystemWithDefaultFontFromFile_out.pdf";
   oneFile.Save(dataDirWithPath, new PdfSaveOptions()
   {
       FontsSubsystem = DocumentFontsSubsystem.UsingDefaultFontFromFile(fontFile)
   });

UsingDefaultFontFromStream( Stream, 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

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   string fontFile = Path.Combine(dataDir, "geo_1.ttf");
   Document oneFile = new Document(Path.Combine(dataDir, "missing-font.one"));
   string dataDirWithFileName = dataDir + "SaveUsingDocumentFontsSubsystemWithDefaultFontFromStream_out.pdf";
   using (var stream = File.Open(fontFile, FileMode.Open, FileAccess.Read, FileShare.Read))
   {
       oneFile.Save(dataDirWithFileName, new PdfSaveOptions()
       {
           FontsSubsystem = DocumentFontsSubsystem.UsingDefaultFontFromStream(stream)
       });
   }

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

 แบบไทย