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
{
public void Initialize(Document document)
{
}
public Font GetFontByName(string name)
{
}
public Font GetDefaultFont()
{
}
}
Inheritance
object ← FontsSubsystem ← DocumentFontsSubsystem
Implements
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.
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")
});
Pokaż, jak zapisać dokument w formacie PDF za pomocą czcionki domyślnej z pliku.
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)
});
Pokaż, jak zapisać dokument w formacie pdf za pomocą czcionki domyślnej z strumienia.
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
DokumentFontsSubsystem(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.
DokumentFontsSubsystem(string, Słownik<strin, 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.
DokumentFontsSubsystem(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
Methods
FETCHFONTFAMILY (string)
Fetches font family jako kandydat na GetFontFamily.
protected override FontFamily FetchFontFamily(string fontName)
{
}
Parameters
fontName
string
Imię z fontem.
Returns
System.Drawing.FontFamily jest dostępny.
UsingDefaultFont(string, Słownik<strin, 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
Podręcznik Aspose.Note.Fonts.DocumentFonsSubsystem.
Examples
Pokaż, jak zapisać dokument w formacie PDF za pomocą określonego czcionki domyślnej.
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, Słownik<strang, 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
Podręcznik Aspose.Note.Fonts.DocumentFonsSubsystem.
Examples
Pokaż, jak zapisać dokument w formacie PDF za pomocą czcionki domyślnej z pliku.
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(Strum, 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
Podręcznik Aspose.Note.Fonts.DocumentFonsSubsystem.
Examples
Pokaż, jak zapisać dokument w formacie pdf za pomocą czcionki domyślnej z strumienia.
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,>