Class DocumentFontsSubsystem
Il nome: Aspose.Note.Fonts Assemblea: Aspose.Note.dll (25.4.0)
Implementazione semplice di Aspose.Note.FontsSubsystem. Retrieves System.Drawing.FoodFamily oggetto dal sistema operativo.
public class DocumentFontsSubsystem : FontsSubsystem, IFontsSubsystem
Inheritance
object ← FontsSubsystem ← DocumentFontsSubsystem
Implements
I membri ereditari
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
Mostra come salvare un documento in formato pdf utilizzando la font predefinita specificata.
// 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")
});
Mostra come salvare un documento in formato pdf utilizzando la font predefinita da un file.
// 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)
});
Mostra come salvare un documento in formato pdf utilizzando la font predefinita da un flusso.
// 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, Diccionario<string, string=» » »)
Inizia una nuova instanza della classe Aspose.Note.Fonts.DocumentFonsSubsystem.
public DocumentFontsSubsystem(Stream defaultFontStream, Dictionary<string, string=""> fontsSubstitutions = null)
Parameters
defaultFontStream
Stream
Il default font.
fontsSubstitutions
Dictionary
di <
string
, string
>
I fonti sono sostituiti.
DocumentFontsSubsystem(String, diccionario, string=» » »)
Inizia una nuova instanza della classe Aspose.Note.Fonts.DocumentFonsSubsystem.
public DocumentFontsSubsystem(string defaultFontFile, Dictionary<string, string=""> fontsSubstitutions = null)
Parameters
defaultFontFile
string
Il default font.
fontsSubstitutions
Dictionary
di <
string
, string
>
I fonti sono sostituiti.
DocumentFontsSubsystem(di String, String=» » »)
Inizia una nuova instanza della classe Aspose.Note.Fonts.DocumentFonsSubsystem.
public DocumentFontsSubsystem(Dictionary<string, string=""> fontsSubstitutions = null)
Parameters
fontsSubstitutions
Dictionary
di <
string
, string
>
I fonti sono sostituiti.
Properties
Default
Riceve o impone l’indice di default statico.
public static DocumentFontsSubsystem Default { get; set; }
Valore di proprietà
Methods
FetchFontFamily(String)
Fatche la famiglia di font come candidato per GetFontFamily.
protected override FontFamily FetchFontFamily(string fontName)
Parameters
fontName
string
Il nome del font.
Returns
Il sistema.Drawing.FontFamily
UsingDefaultFont(String, diccionario, string=» » »)
Creare una nuova instanza DocumentFontsSubsystem utilizzando il nome di font predefinito specificato.
public static DocumentFontsSubsystem UsingDefaultFont(string defaultFontName, Dictionary<string, string=""> fontsSubstitutions = null)
Parameters
defaultFontName
string
Il nome di font default.
fontsSubstitutions
Dictionary
di <
string
, string
>
I fonti sono sostituiti.
Returns
Il Aspose.Note.Fonts.DocumentFonsSubsystem.
Examples
Mostra come salvare un documento in formato pdf utilizzando la font predefinita specificata.
// 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, diccionario, string=» » »)
Creare una nuova instanza DocumentFontsSubsystem utilizzando un font dal file specificato come predefinito.
public static DocumentFontsSubsystem UsingDefaultFontFromFile(string filePath, Dictionary<string, string=""> fontsSubstitutions = null)
Parameters
filePath
string
Il file contenente il nome di font default.
fontsSubstitutions
Dictionary
di <
string
, string
>
I fonti sono sostituiti.
Returns
Il Aspose.Note.Fonts.DocumentFonsSubsystem.
Examples
Mostra come salvare un documento in formato pdf utilizzando la font predefinita da un file.
// 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, Diccionario<string, string=» » »)
Creare una nuova instanza DocumentFontsSubsystem utilizzando un font dal flusso specificato come predefinito.
public static DocumentFontsSubsystem UsingDefaultFontFromStream(Stream defaultFontStream, Dictionary<string, string=""> fontsSubstitutions = null)
Parameters
defaultFontStream
Stream
Il flusso contenente il nome di font predefinito.
fontsSubstitutions
Dictionary
di <
string
, string
>
I fonti sono sostituiti.
Returns
Il Aspose.Note.Fonts.DocumentFonsSubsystem.
Examples
Mostra come salvare un documento in formato pdf utilizzando la font predefinita da un flusso.
// 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,>