FileFontSource

FileFontSource class

يمثل ملف الخط TrueType الوحيد المخزن في نظام الملفات.

لمعرفة المزيد، قم بزيارةالعمل مع الخطوط مقالة توثيقية.

public class FileFontSource : FontSourceBase

المنشئون

اسموصف
FileFontSource(string)المولد.
FileFontSource(string, int)المولد.
FileFontSource(string, int, string)المولد.

الخصائص

اسموصف
CacheKey { get; }مفتاح هذا المصدر في ذاكرة التخزين المؤقت.
FilePath { get; }المسار إلى ملف الخط.
Priority { get; }يعيد أولوية مصدر الخط.
override Type { get; }يعيد نوع مصدر الخط.
WarningCallback { get; set; }يتم استدعاؤها أثناء معالجة مصدر الخط عند اكتشاف مشكلة قد تؤدي إلى فقدان دقة التنسيق.

طُرق

اسموصف
GetAvailableFonts()إرجاع قائمة الخطوط المتوفرة عبر هذا المصدر.

أمثلة

يوضح كيفية استخدام ملف الخط في نظام الملفات المحلي كمصدر للخط.

FileFontSource fileFontSource = new FileFontSource(MyDir + "Alte DIN 1451 Mittelschrift.ttf", 0);

Document doc = new Document();
doc.FontSettings = new FontSettings();
doc.FontSettings.SetFontsSources(new FontSourceBase[] {fileFontSource});

Assert.AreEqual(MyDir + "Alte DIN 1451 Mittelschrift.ttf", fileFontSource.FilePath);
Assert.AreEqual(FontSourceType.FontFile, fileFontSource.Type);
Assert.AreEqual(0, fileFontSource.Priority);

أنظر أيضا