Class DocumentFontsSubsystem

Class DocumentFontsSubsystem

Nazwa przestrzeń: Aspose.Note.Fonts Zgromadzenie: Aspose.Note.dll (25.4.0)

Łatwa wdrożenie Aspose.Note.FontsSubsystem. Retrieves System.Drawing.FoontFamily obiekt z systemu operacyjnego.

public class DocumentFontsSubsystem : FontsSubsystem, IFontsSubsystem

Inheritance

object FontsSubsystem DocumentFontsSubsystem

Implements

IFontsSubsystem

Dziedziczeni członkowie

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

Pokaż, jak zapisać dokument w formacie PDF za pomocą określonego czcionki domyślnej.

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

Pokaż, jak zapisać dokument w formacie PDF za pomocą czcionki domyślnej z pliku.

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

Pokaż, jak zapisać dokument w formacie pdf za pomocą czcionki domyślnej z strumienia.

// 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, Słownik <string, String=» » »)

Inicjalizuje nową instancję klasy Aspose.Note.Fonts.DocumentFonsSubsystem.

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

Parameters

defaultFontStream Stream

Zdefiniowany font.

fontsSubstitutions Dictionary • < string , string >

Zastąpienia fontów.

DocumentFontsSubsystem(String, Słownik <string , string=» » »)

Inicjalizuje nową instancję klasy Aspose.Note.Fonts.DocumentFonsSubsystem.

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

Parameters

defaultFontFile string

Zdefiniowany font.

fontsSubstitutions Dictionary • < string , string >

Zastąpienia fontów.

DocumentFontsSubsystem(Słownik String, String=» » »)

Inicjalizuje nową instancję klasy Aspose.Note.Fonts.DocumentFonsSubsystem.

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

Parameters

fontsSubstitutions Dictionary • < string , string >

Zastąpienia fontów.

Properties

Default

Otrzymuje lub ustawia statyczny standard instancji.

public static DocumentFontsSubsystem Default { get; set; }

Wartość nieruchomości

DocumentFontsSubsystem

Methods

FetchFontFamily(strumień)

Fetches font family jako kandydat na GetFontFamily.

protected override FontFamily FetchFontFamily(string fontName)

Parameters

fontName string

Imię z fontem.

Returns

FontFamily

System.Drawing.FontFamily jest dostępny.

UsingDefaultFont(String, Słownik <string , string=» » »)

Tworzenie nowej instancji DocumentFontsSubsystem za pomocą określonego nazwy czcionki.

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

Parameters

defaultFontName string

Podstawowe nazwy czcionki.

fontsSubstitutions Dictionary • < string , string >

Zastąpienia fontów.

Returns

DocumentFontsSubsystem

Podręcznik Aspose.Note.Fonts.DocumentFonsSubsystem.

Examples

Pokaż, jak zapisać dokument w formacie PDF za pomocą określonego czcionki domyślnej.

// 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, Słownik <string , string=» » »)

Tworzenie nowej instancji DocumentFontsSubsystem za pomocą czcionki z określonego pliku jako domyślnego.

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

Parameters

filePath string

Archiwum zawierające domyślne nazwisko czcionki.

fontsSubstitutions Dictionary • < string , string >

Zastąpienia fontów.

Returns

DocumentFontsSubsystem

Podręcznik Aspose.Note.Fonts.DocumentFonsSubsystem.

Examples

Pokaż, jak zapisać dokument w formacie PDF za pomocą czcionki domyślnej z pliku.

// 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, Słownik <string, String=» » »)

Tworzenie nowej instancji DocumentFontsSubsystem za pomocą czcionki z określonego przepływu jako domyślnego.

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

Parameters

defaultFontStream Stream

Strumień zawierający domyślną nazwę czcionki.

fontsSubstitutions Dictionary • < string , string >

Zastąpienia fontów.

Returns

DocumentFontsSubsystem

Podręcznik Aspose.Note.Fonts.DocumentFonsSubsystem.

Examples

Pokaż, jak zapisać dokument w formacie pdf za pomocą czcionki domyślnej z strumienia.

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

 Polski