IsFontConfigAvailable
Contents
[
Hide
]FontConfigSubstitutionRule.IsFontConfigAvailable method
Check if fontconfig utility is available or not.
public bool IsFontConfigAvailable()
Examples
Shows operating system-dependent font config substitution.
FontSettings fontSettings = new FontSettings();
FontConfigSubstitutionRule fontConfigSubstitution =
fontSettings.SubstitutionSettings.FontConfigSubstitution;
bool isWindows = new[] {PlatformID.Win32NT, PlatformID.Win32S, PlatformID.Win32Windows, PlatformID.WinCE}
.Any(p => Environment.OSVersion.Platform == p);
// The FontConfigSubstitutionRule object works differently on Windows/non-Windows platforms.
// On Windows, it is unavailable.
if (isWindows)
{
Assert.False(fontConfigSubstitution.Enabled);
Assert.False(fontConfigSubstitution.IsFontConfigAvailable());
}
bool isLinuxOrMac =
new[] {PlatformID.Unix, PlatformID.MacOSX}.Any(p => Environment.OSVersion.Platform == p);
// On Linux/Mac, we will have access to it, and will be able to perform operations.
if (isLinuxOrMac)
{
Assert.True(fontConfigSubstitution.Enabled);
Assert.True(fontConfigSubstitution.IsFontConfigAvailable());
fontConfigSubstitution.ResetCache();
}
See Also
- class FontConfigSubstitutionRule
- namespace Aspose.Words.Fonts
- assembly Aspose.Words