TableSubstitutionRule.GetSubstitutes

TableSubstitutionRule GetSubstitutes method. Returns array containing substitute font names for the specified original font name.

TableSubstitutionRule.GetSubstitutes method

Returns array containing substitute font names for the specified original font name.

public IEnumerable<string> GetSubstitutes(string originalFontName)
ParameterTypeDescription
originalFontNameStringOriginal font name.

Return Value

List of alternative font names.

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