TableSubstitutionRule Class |
Namespace: Aspose.Words.Fonts
The TableSubstitutionRule type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | Enabled |
Specifies whether the rule is enabled or not.
(Inherited from FontSubstitutionRule.) |
Name | Description | |
---|---|---|
![]() ![]() | AddSubstitutes |
Adds substitute font names for given original font name.
|
![]() | Equals | (Inherited from Object.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() ![]() | GetSubstitutes |
Returns array containing substitute font names for the specified original font name.
|
![]() | GetType | (Inherited from Object.) |
![]() ![]() | Load(Stream) |
Loads table substitution settings from XML stream.
|
![]() ![]() | Load(String) |
Loads table substitution settings from XML file.
|
![]() | LoadAndroidSettings |
Loads predefined table substitution settings for Linux platform.
|
![]() ![]() | LoadLinuxSettings |
Loads predefined table substitution settings for Linux platform.
|
![]() ![]() | LoadWindowsSettings |
Loads predefined table substitution settings for Windows platform.
|
![]() ![]() | Save(Stream) |
Saves the current table substitution settings to stream.
|
![]() ![]() | Save(String) |
Saves the current table substitution settings to file.
|
![]() ![]() | SetSubstitutes |
Override substitute font names for given original font name.
|
![]() | ToString | (Inherited from Object.) |
// Create a blank document and a new FontSettings object Document doc = new Document(); FontSettings fontSettings = new FontSettings(); doc.FontSettings = fontSettings; // Create a new table substitution rule and load the default Windows font substitution table TableSubstitutionRule tableSubstitutionRule = fontSettings.SubstitutionSettings.TableSubstitution; tableSubstitutionRule.LoadWindowsSettings(); // In Windows, the default substitute for the "Times New Roman CE" font is "Times New Roman" Assert.AreEqual(new[] { "Times New Roman" }, tableSubstitutionRule.GetSubstitutes("Times New Roman CE").ToArray()); // We can save the table for viewing in the form of an XML document tableSubstitutionRule.Save(ArtifactsDir + "Font.TableSubstitutionRule.Windows.xml"); // Linux has its own substitution table // If "FreeSerif" is unavailable to substitute for "Times New Roman CE", we then look for "Liberation Serif", and so on tableSubstitutionRule.LoadLinuxSettings(); Assert.AreEqual(new[] { "FreeSerif", "Liberation Serif", "DejaVu Serif" }, tableSubstitutionRule.GetSubstitutes("Times New Roman CE").ToArray()); // Save the Linux substitution table using a stream using (FileStream fileStream = new FileStream(ArtifactsDir + "Font.TableSubstitutionRule.Linux.xml", FileMode.Create)) { tableSubstitutionRule.Save(fileStream); }