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
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ể.
// 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")
});
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.
// 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)
});
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.
// 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, 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<string, 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(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(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
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<string, 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ể.
// 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, 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ừ 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.
// 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, 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.
// 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,>