TableSubstitutionRule Class

Wordize.Fonts.TableSubstitutionRule class. Table font substitution rule.

TableSubstitutionRule class

Table font substitution rule.

public class TableSubstitutionRule : FontSubstitutionRule

Properties

NameDescription
Enabled { get; set; }Specifies whether the rule is enabled or not.

Methods

NameDescription
AddSubstitutes(string, params string[])Adds substitute font names for given original font name.
GetSubstitutes(string)Returns array containing substitute font names for the specified original font name.
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 Android 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(string, params string[])Override substitute font names for given original font name.

Remarks

This rule defines the list of substitute font names to be used if the original font is not available. Substitutes will be checked for the font name and the font info alternative name (if any).

Examples

Shows how to configure table substitution rule.

FontSettings fontSettings = new FontSettings();

// Add substitutions for Arial font
fontSettings.SubstitutionSettings.TableSubstitution.AddSubstitutes("Arial", "Times New Roman", "FangSong");
fontSettings.SubstitutionSettings.TableSubstitution.AddSubstitutes("Arial", "Courier New");

// Get substitutions for Arial.
IEnumerable<string> substitutes = fontSettings.SubstitutionSettings.TableSubstitution.GetSubstitutes("Arial");
Assert.That(substitutes.Count, Is.EqualTo(3));

// Override substitutions for Arial font
fontSettings.SubstitutionSettings.TableSubstitution.SetSubstitutes("Arial", "Times New Roman");

substitutes = fontSettings.SubstitutionSettings.TableSubstitution.GetSubstitutes("Arial");
Assert.That(substitutes.Count, Is.EqualTo(1));

See Also