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
Κληρονομημένα μέλη
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, Dictionary="">)
Αρχίζει μια νέα περίπτωση της κατηγορίας 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; }
Αξία ιδιοκτησίας
Methods
FetchFontFamily(Σύνδεσμος)
Fetches οικογένεια γραμματοσειρών ως υποψήφιος για GetFontFamily.
protected override FontFamily FetchFontFamily(string fontName)
Parameters
fontName
string
Το όνομα του font.
Returns
Το σύστημα.Drawing.FontFamily
UsingDefaultFont(Σύνδεσμος, String, Dictionary="">)
Δημιουργήστε μια νέα ένδειξη DocumentFontsSubsystem χρησιμοποιώντας το προεπιλεγμένο όνομα γραμματοσειράς.
public static DocumentFontsSubsystem UsingDefaultFont(string defaultFontName, Dictionary<string, string=""> fontsSubstitutions = null)
Parameters
defaultFontName
string
Το προεπιλεγμένο όνομα κειμένου.
fontsSubstitutions
Dictionary
< ·
string
, string
>
Αντικατάσταση των γραμματοσειρών.
Returns
Το 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, Dictionary="">)
Δημιουργία νέας παραδείγματος DocumentFontsSubsystem χρησιμοποιώντας ένα γράμμα από το καθορισμένο αρχείο ως προεπιλογή.
public static DocumentFontsSubsystem UsingDefaultFontFromFile(string filePath, Dictionary<string, string=""> fontsSubstitutions = null)
Parameters
filePath
string
Το αρχείο που περιέχει προεπιλεγμένο όνομα γραμματοσειράς.
fontsSubstitutions
Dictionary
< ·
string
, string
>
Αντικατάσταση των γραμματοσειρών.
Returns
Το 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(Σύνδεση, Λεξικό<string, string="">)
Δημιουργήστε μια νέα ένδειξη DocumentFontsSubsystem χρησιμοποιώντας ένα γράμμα από την καθορισμένη ροή ως προεπιλογή.
public static DocumentFontsSubsystem UsingDefaultFontFromStream(Stream defaultFontStream, Dictionary<string, string=""> fontsSubstitutions = null)
Parameters
defaultFontStream
Stream
Η ροή που περιέχει το προεπιλεγμένο όνομα γραμματοσειράς.
fontsSubstitutions
Dictionary
< ·
string
, string
>
Αντικατάσταση των γραμματοσειρών.
Returns
Το 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 + "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,>