FontConfigSubstitutionRule
محتويات
[
يخفي
]FontConfigSubstitutionRule class
قاعدة استبدال تكوين الخط.
لمعرفة المزيد، قم بزيارةالعمل مع الخطوط مقالة توثيقية.
public class FontConfigSubstitutionRule : FontSubstitutionRule
الخصائص
اسم | وصف |
---|---|
override Enabled { set; } | يحدد ما إذا كانت القاعدة ممكّنة أم لا. |
طُرق
اسم | وصف |
---|---|
IsFontConfigAvailable() | تحقق مما إذا كانت أداة fontconfig متاحة أم لا. |
ResetCache() | إعادة تعيين ذاكرة التخزين المؤقت لنتائج استدعاء fontconfig. |
ملاحظات
تستخدم هذه القاعدة أداة fontconfig على أنظمة Linux (وأنظمة أخرى شبيهة بـ Unix) للحصول على substitution إذا لم يكن الخط الأصلي متاحًا.
إذا لم تكن أداة fontconfig متاحة، فسيتم تجاهل هذه القاعدة.
أمثلة
يعرض استبدال تكوين الخط المعتمد على نظام التشغيل.
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);
// يعمل كائن FontConfigSubstitutionRule بشكل مختلف على أنظمة التشغيل Windows/غير Windows.
// على نظام التشغيل Windows، غير متوفر.
if (isWindows)
{
Assert.False(fontConfigSubstitution.Enabled);
Assert.False(fontConfigSubstitution.IsFontConfigAvailable());
}
bool isLinuxOrMac =
new[] {PlatformID.Unix, PlatformID.MacOSX}.Any(p => Environment.OSVersion.Platform == p);
// على Linux/Mac، سيكون لدينا إمكانية الوصول إليه، وسنكون قادرين على إجراء العمليات.
if (isLinuxOrMac)
{
Assert.True(fontConfigSubstitution.Enabled);
Assert.True(fontConfigSubstitution.IsFontConfigAvailable());
fontConfigSubstitution.ResetCache();
}
أنظر أيضا
- class FontSubstitutionRule
- مساحة الاسم Aspose.Words.Fonts
- المجسم Aspose.Words