Class DocumentFontsSubsystem
Tên không gian: Aspose.Note.Fonts Tổng hợp: Aspose.Note.dll (25.4.0)
Việc thực hiện đơn giản của Aspose.Note.FontsSubsystem. Retrieves System.Drawing.FoontFamily object từ OS.
public class DocumentFontsSubsystem : FontsSubsystem, IFontsSubsystem
{
public void Initialize(Document document)
{
}
public Font GetFontByName(string name)
{
}
public Font GetDefaultFont()
{
}
}
Inheritance
object ← FontsSubsystem ← DocumentFontsSubsystem
Implements
Thành viên thừa kế
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
Hiển thị cách lưu một tài liệu trong định dạng pdf bằng cách sử dụng phông chữ mặc định cụ thể.
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")
});
Hiển thị cách lưu một tài liệu trong định dạng pdf bằng cách sử dụng phông chữ mặc định từ một tệp.
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)
});
Hiển thị cách lưu một tài liệu trong định dạng pdf bằng cách sử dụng phông chữ mặc định từ một dòng.
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
DocumentFontsSubsystem(Stream, Từ điển<string, string="">)
Bắt đầu một trường hợp mới của lớp Aspose.Note.Fonts.DocumentFonsSubsystem.
public DocumentFontsSubsystem(
Stream defaultFontStream,
Dictionary<string, string> fontsSubstitutions = null)
{
}
Parameters
defaultFontStream
Stream
Lời bài hát Default Font
fontsSubstitutions
Dictionary
<
string
, string
>
Các phông chữ thay thế
DocumentFontsSubsystem(string, Từ điển<strin, string="">)
Bắt đầu một trường hợp mới của lớp Aspose.Note.Fonts.DocumentFonsSubsystem.
public DocumentFontsSubsystem(
string defaultFontFile,
Dictionary<string, string> fontsSubstitutions = null)
{
}
Parameters
defaultFontFile
string
Lời bài hát Default Font
fontsSubstitutions
Dictionary
<
string
, string
>
Các phông chữ thay thế
DocumentFontsSubsystem(Ngôn ngữ<string, string="">)
Bắt đầu một trường hợp mới của lớp Aspose.Note.Fonts.DocumentFonsSubsystem.
public DocumentFontsSubsystem(Dictionary<string, string> fontsSubstitutions = null)
{
}
Parameters
fontsSubstitutions
Dictionary
<
string
, string
>
Các phông chữ thay thế
Properties
Default
Nhận hoặc đặt lệnh mặc định tĩnh.
public static DocumentFontsSubsystem Default
{
get;
set;
}
Giá trị bất động sản
Methods
Trang chủ » FetchFontFamily(string)
Fetches gia đình font như một ứng cử viên cho GetFontFamily.
protected override FontFamily FetchFontFamily(string fontName)
{
}
Parameters
fontName
string
Tên của font
Returns
Hệ thống.Drawing.FontFamily
UsingDefaultFont(string, Từ điển<strin, string="">)
Tạo một ví dụ DocumentFontsSubsystem mới bằng cách sử dụng tên phông chữ mặc định.
public static DocumentFontsSubsystem UsingDefaultFont(string defaultFontName, Dictionary<string, string> fontsSubstitutions = null)
{
}
Parameters
defaultFontName
string
Tên phông chữ mặc định
fontsSubstitutions
Dictionary
<
string
, string
>
Các phông chữ thay thế
Returns
Các Aspose.Note.Fonts.DocumentFonsSubsystem.
Examples
Hiển thị cách lưu một tài liệu trong định dạng pdf bằng cách sử dụng phông chữ mặc định cụ thể.
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, Từ điển<strin, string="">)
Tạo một ví dụ mới của DocumentFontsSubsystem bằng cách sử dụng một phông chữ từ tệp cụ thể theo mặc định.
public static DocumentFontsSubsystem UsingDefaultFontFromFile(string filePath, Dictionary<string, string> fontsSubstitutions = null)
{
}
Parameters
filePath
string
Tệp chứa tên văn bản mặc định.
fontsSubstitutions
Dictionary
<
string
, string
>
Các phông chữ thay thế
Returns
Các Aspose.Note.Fonts.DocumentFonsSubsystem.
Examples
Hiển thị cách lưu một tài liệu trong định dạng pdf bằng cách sử dụng phông chữ mặc định từ một tệp.
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(Thông tin, Từ điển<string, string="">)
Tạo một ví dụ mới của DocumentFontsSubsystem bằng cách sử dụng một phông chữ từ dòng cụ thể theo mặc định.
public static DocumentFontsSubsystem UsingDefaultFontFromStream(
Stream defaultFontStream,
Dictionary<string, string> fontsSubstitutions = null)
{
}
Parameters
defaultFontStream
Stream
dòng chứa tên font mặc định.
fontsSubstitutions
Dictionary
<
string
, string
>
Các phông chữ thay thế
Returns
Các Aspose.Note.Fonts.DocumentFonsSubsystem.
Examples
Hiển thị cách lưu một tài liệu trong định dạng pdf bằng cách sử dụng phông chữ mặc định từ một dòng.
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,>