FontConfigSubstitutionRule
Inhalt
[
Ausblenden
]
FontConfigSubstitutionRule class
Schriftkonfigurations-Ersetzungsregel.
public class FontConfigSubstitutionRule : FontSubstitutionRule
Eigenschaften
Name | Beschreibung |
---|---|
override Enabled { set; } | Gibt an, ob die Regel aktiviert ist oder nicht. |
Methoden
Name | Beschreibung |
---|---|
IsFontConfigAvailable() | Überprüfen Sie, ob das Dienstprogramm fontconfig verfügbar ist oder nicht. |
ResetCache() | Setzt den Cache der Aufrufergebnisse von fontconfig zurück. |
Bemerkungen
Diese Regel verwendet das Dienstprogramm fontconfig auf Linux- (und anderen Unix-ähnlichen) Plattformen, um die Substitution abzurufen, wenn die ursprüngliche Schriftart nicht verfügbar ist.
Wenn das Dienstprogramm fontconfig nicht verfügbar ist, wird diese Regel ignoriert.
Beispiele
Zeigt die vom Betriebssystem abhängige Ersetzung der Schriftartkonfiguration an.
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);
// Das FontConfigSubstitutionRule-Objekt funktioniert auf Windows-/Nicht-Windows-Plattformen unterschiedlich.
// Unter Windows ist es nicht verfügbar.
if (isWindows)
{
Assert.False(fontConfigSubstitution.Enabled);
Assert.False(fontConfigSubstitution.IsFontConfigAvailable());
}
bool isLinuxOrMac =
new[] {PlatformID.Unix, PlatformID.MacOSX}.Any(p => Environment.OSVersion.Platform == p);
// Unter Linux/Mac haben wir Zugriff darauf und können Operationen ausführen.
if (isLinuxOrMac)
{
Assert.True(fontConfigSubstitution.Enabled);
Assert.True(fontConfigSubstitution.IsFontConfigAvailable());
fontConfigSubstitution.ResetCache();
}
Siehe auch
- class FontSubstitutionRule
- namensraum Aspose.Words.Fonts
- Montage Aspose.Words