FontConfigSubstitutionRuleResetCache Method |
Namespace: Aspose.Words.Fonts
// Create a new FontSettings object and get its font config substitution rule FontSettings fontSettings = new FontSettings(); FontConfigSubstitutionRule fontConfigSubstitution = fontSettings.SubstitutionSettings.FontConfigSubstitution; // The FontConfigSubstitutionRule object works differently on Windows/non-Windows platforms // On Windows, it is unavailable PlatformID pid = Environment.OSVersion.Platform; bool isWindows = pid == PlatformID.Win32NT || pid == PlatformID.Win32S || pid == PlatformID.Win32Windows || pid == PlatformID.WinCE; if (isWindows) { Assert.False(fontConfigSubstitution.Enabled); Assert.False(fontConfigSubstitution.IsFontConfigAvailable()); } // On Linux/Mac, we will have access and will be able to perform operations bool isLinuxOrMac = pid == PlatformID.Unix || pid == PlatformID.MacOSX; if (isLinuxOrMac) { Assert.True(fontConfigSubstitution.Enabled); Assert.True(fontConfigSubstitution.IsFontConfigAvailable()); fontConfigSubstitution.ResetCache(); }