Class DocumentFontsSubsystem

Class DocumentFontsSubsystem

Namn på plats: Aspose.Note.Fonts Sammanfattning: Aspose.Note.dll (25.4.0)

Enkel implementering av Aspose.Note.Fonts.FoonsSubsystem. Retrieves System.Drawing.PhantFamily objekt från OS.

public class DocumentFontsSubsystem : FontsSubsystem, IFontsSubsystem

Inheritance

object FontsSubsystem DocumentFontsSubsystem

Implements

IFontsSubsystem

Arvsmedlemmar

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

Visa hur man sparar ett dokument i pdf-format med hjälp av angiven standardformulär.

// 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")
                                                                                                         });

Visa hur man sparar ett dokument i pdf-format med standardformulär från en fil.

// 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)
                                                                                                               });

Visa hur man sparar ett dokument i pdf-format med standardformulär från en ström.

// 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(Stream, Ordförråd<string, string="">)

Initialiserar en ny instans av Aspose.Note.Fonts.DocumentFonsSubsystem klass.

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

Parameters

defaultFontStream Stream

Det är default font.

fontsSubstitutions Dictionary ochlt; string , string >

De här fontarna ersätter.

DocumentFontsSubsystem(String, Dictionary)

Initialiserar en ny instans av Aspose.Note.Fonts.DocumentFonsSubsystem klass.

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

Parameters

defaultFontFile string

Det är default font.

fontsSubstitutions Dictionary ochlt; string , string >

De här fontarna ersätter.

DocumentFontsSubsystem(Ordbok<string, string="">)

Initialiserar en ny instans av Aspose.Note.Fonts.DocumentFonsSubsystem klass.

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

Parameters

fontsSubstitutions Dictionary ochlt; string , string >

De här fontarna ersätter.

Properties

Default

Få eller ställa in statisk standardinstans.

public static DocumentFontsSubsystem Default { get; set; }

Fastighetsvärde

DocumentFontsSubsystem

Methods

FetchFontFamily(Sträng)

Fetches font familj som kandidat för GetFontFamily.

protected override FontFamily FetchFontFamily(string fontName)

Parameters

fontName string

Namnet på font.

Returns

FontFamily

Det här är system.Drawing.FontFamily.

UsingDefaultFont(String, Dictionary)

Skapa en ny DocumentFontsSubsystem instans med hjälp av det angivna standardformulärnamnet.

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

Parameters

defaultFontName string

Den föreskrivna fontnamnet.

fontsSubstitutions Dictionary ochlt; string , string >

De här fontarna ersätter.

Returns

DocumentFontsSubsystem

Den Aspose.Note.Fonts.DocumentFonsSubsystem.

Examples

Visa hur man sparar ett dokument i pdf-format med hjälp av angiven standardformulär.

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

Skapa en ny DocumentFontsSubsystem instans med hjälp av en font från den angivna filen som standard.

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

Parameters

filePath string

Filen innehåller standardformulärnamn.

fontsSubstitutions Dictionary ochlt; string , string >

De här fontarna ersätter.

Returns

DocumentFontsSubsystem

Den Aspose.Note.Fonts.DocumentFonsSubsystem.

Examples

Visa hur man sparar ett dokument i pdf-format med standardformulär från en fil.

// 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(Stream, Ordförråd<string, string="">)

Skapa en ny DocumentFontsSubsystem instans med hjälp av en font från angiven ström som standard.

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

Parameters

defaultFontStream Stream

Strömmen som innehåller standardformulärnamnet.

fontsSubstitutions Dictionary ochlt; string , string >

De här fontarna ersätter.

Returns

DocumentFontsSubsystem

Den Aspose.Note.Fonts.DocumentFonsSubsystem.

Examples

Visa hur man sparar ett dokument i pdf-format med standardformulär från en ström.

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

 Svenska