ระบุตำแหน่งแบบอักษรTrueType
หัวข้อนี้อธิบายลักษณะการทำงานดีฟอลต์ของAspose.Wordsเมื่อค้นหาแบบอักษรTrueTypeซึ่งรวมถึงความแตกต่าง.
คลาสFontSourceBaseถูกใช้เพื่อระบุแหล่งที่มาแบบอักษรต่างๆ มีการใช้งานหลายระดับFontSourceBase:
รายละเอียดการดำเนินงานสำหรับบางชั้นเรียนจะอธิบายไว้ด้านล่าง.
โหลดแบบอักษรจากระบบ
มีคลาสพิเศษSystemFontSourceที่ถูกใช้โดยค่าเริ่มต้นอยู่เสมอ มันแสดงแบบอักษรTrueTypeทั้งหมดที่ติดตั้งบนระบบ ดังนั้นจึงเป็นไปได้ที่จะสร้างรายการแหล่งที่มาที่มีSystemFontSourceและแหล่งที่มาอื่นๆที่จำเป็น:
For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C | |
System::SharedPtr<Document> doc = System::MakeObject<Document>(inputDataDir + u"Rendering.doc"); | |
System::SharedPtr<FontSettings> fontSettings = System::MakeObject<FontSettings>(); | |
// Retrieve the array of environment-dependent font sources that are searched by default. For example this will contain a "Windows\Fonts\" source on a Windows machines. | |
// We add this array to a new ArrayList to make adding or removing font entries much easier. | |
System::SharedPtr<TFontSourceBasePtrList> fontSources = System::MakeObject<TFontSourceBasePtrList>(fontSettings->GetFontsSources()); | |
// Add a new folder source which will instruct Aspose.Words to search the following folder for fonts. | |
System::SharedPtr<FolderFontSource> folderFontSource = System::MakeObject<FolderFontSource>(u"C:\\MyFonts\\", true); | |
// Add the custom folder which contains our fonts to the list of existing font sources. | |
fontSources->Add(folderFontSource); | |
// Convert the Arraylist of source back into a primitive array of FontSource objects. | |
System::ArrayPtr<TFontSourceBasePtr> updatedFontSources = fontSources->ToArray(); | |
// Apply the new set of font sources to use. | |
fontSettings->SetFontsSources(updatedFontSources); | |
// Set font settings | |
doc->set_FontSettings(fontSettings); | |
System::String outputPath = outputDataDir + u"SetFontsFoldersSystemAndCustomFolder.pdf"; | |
doc->Save(outputPath); |
อินสแตนซ์เดียวของSystemFontSourceคลาสถูกกำหนดโดยค่าเริ่มต้นในFontSettings บนระบบปฏิบัติการที่แตกต่างกันแบบอักษรอาจจะอยู่ในสถานที่ที่แตกต่างกัน อย่างไรก็ตามการใช้อินสแตนซ์FontSettingsสำหรับแต่ละเอกสารไม่ใช่ทางออกที่ดีที่สุด ในกรณีส่วนใหญ่การใช้DefaultInstanceควรเพียงพอ.
อินสแตนซ์ต่อเอกสารมีความจำเป็นเฉพาะในกรณีที่จำเป็นต้องใช้แหล่งแบบอักษรที่แตกต่างกันสำหรับเอกสารที่แตกต่างกันซึ่งเป็นกรณีที่หายาก การใช้หลายอินสแตนซ์FontSettingsลดประสิทธิภาพการทำงานเนื่องจากไม่ใช้แคชร่วมกัน.
ที่ไหนAspose.WordsมองหาTrueTypeแบบอักษรบนWindows
ในกรณีส่วนใหญ่ผู้ใช้Windowsไม่ประสบปัญหาสำคัญกับแบบอักษรที่ไม่ได้รับหรือเลย์เอาต์ที่ไม่ถูกต้อง โดยทั่วไปAspose.Wordsจะผ่านเอกสารและเมื่อพบลิงก์ของแบบอักษรมันจะดึงข้อมูลแบบอักษรจากโฟลเด.
บนWindowsเป็นครั้งแรกAspose.Wordsใช้แบบอักษรที่มีอยู่ทั้งหมดจากโฟลเดอร์_%windir%\Fonts การตั้งค่านี้จะทำงานสำหรับคุณมากที่สุดของเวลา คุณระบุเฉพาะโฟลเดอร์แบบอักษรของคุณเองถ้าคุณต้องการ Aspose.Wordsยังมองหาแบบอักษรเพิ่มเติมที่ลงทะเบียนในคีย์รีจิสทรีHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts นอกจากนี้Windows10 ช่วยให้การติดตั้งแบบอักษรสำหรับผู้ใช้ปัจจุบัน แบบอักษรจะถูกวางไว้ในโฟลเดอร์%userprofile%\AppData\Local\Microsoft\Windows\Fontsและระบุไว้ในรีจิสทรีHKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Fontsที่Aspose.Wordsจะมองหาแบบอักษรเหล่านี้.
หากเอกสารมีแบบอักษรที่ฝังอยู่Aspose.Wordsสามารถอ่านข้อมูลแบบอักษรที่เกี่ยวข้องจากเอกสารและ เอกสารอาจมีการเชื่อมโยงไปยังแบบอักษรที่ไม่ได้อยู่ในโฟลเดอร์ระบบซึ่งในกรณีนี้สถาน:
- ผู้ใช้สามารถตั้งค่าแหล่งที่มาแบบอักษรใหม่ผ่านคลาสของFontSettings
- Aspose.Wordsสามารถลองแทนที่แบบอักษรที่พลาดด้วยแบบเดียวกันได้
แบบอักษรบนระบบที่ไม่ใช่Windows
Aspose.Wordsจะมองหาแบบอักษรในโฟลเดอร์แบบอักษรของระบบ รายการของโฟลเดอร์เหล่านี้อาจเห็นได้ด้วยวิธีการGetSystemFontFolders หากไม่พบแบบอักษรที่สนับสนุนAspose.Wordsจะใช้แบบฟอนต์ดีฟอลต์ในตัวทีทีเอฟ.
เนื่องจากตัวชี้วัดแบบอักษรของWindowsและไม่ใช่WindowsOSแตกต่างกันAspose.Wordsทำทุกอย่างที่เป็นไปได้เพื่อหาแบบอักษรที่คล้ายกันและสร้างเค้าโครงที่คล้ายกับต้นฉบับ อย่างไรก็ตามนี้เป็นไปไม่ได้เสมอ. ในกรณีเหล่านี้ควรใช้ชั้นเรียนFontSettingsเพื่อเพิ่มแบบอักษรที่กำหนดเองหรือกฎการแทนที่.
ที่ไหนAspose.WordsมองหาTrueTypeแบบอักษรบนLinux
การแจกจ่ายLinuxแตกต่างกันอาจเก็บแบบอักษรในโฟลเดอร์ที่แตกต่างกัน Aspose.Wordsมองหาแบบอักษรในหลายสถานที่ โดยค่าเริ่มต้นAspose.Wordsจะค้นหาแบบอักษรในตำแหน่งที่ตั้งต่อไปนี้ทั้งหมด: /usr/share/fonts
, /usr/local/share/fonts
, /usr/X11R6/lib/X11/fonts
. ลักษณะการทำงานดีฟอลต์นี้จะทำงานสำหรับการแจกจ่ายLinuxส่วนใหญ่แต่ไม่รับประกันว่าจะทำงานตลอดเวลาซึ่งในกรณีนี้คุณอาจต้องระบุตำแหน่งของแบบอักษรชนิดจริงอย่างชัดเจน การทำเช่นนี้คุณต้องทราบว่ามีการติดตั้งแบบอักษรTrueTypeบนการแจกจ่ายLinuxของคุณ.
ที่ไหนAspose.WordsมองหาTrueTypeแบบอักษรบนแม็คOSเท่า
Aspose.Wordsมองหาแบบอักษรในโฟลเดอร์/Library/Fonts
ซึ่งเป็นตำแหน่งที่ตั้งมาตรฐานสำหรับTrueTypeแบบอักษรบนแม็คOSเอ็กซ์ในขณะที่การตั้งค่านี้จะทำงานกับคุณบ่อยที่สุดคุณอาจต้องระบุโฟลเดอร์แบบอักษรของคุณเองในกรณีที่คุณต้องการ.
TrueTypeแบบอักษรบนAndroid
บนAndroidเวิร์กโฟลว์แบบอักษรถูกห่อหุ้มในชั้นเรียนแบบอักษร. มีห้าประเภทของแบบอักษรเป็นแบบอักษรแต่ละตัวแทนของกลุ่มของครอบครัวตัวอักษรที่คล้:
- DEFAULT
- DEFAULT_BOLD
- MONOSPACE
- SANS_SERIF
- SERIF
ตัวอย่างเช่นตามAndroidของ แบบอักษร.เอ็กซ์เอ็มแอล แฟ้มการกำหนดค่า"ครั้ง"เป็นของ"เสริฟ"ครอบครัวเพื่อให้NotoSerif-ปกติทีทีเอฟจะใช้เมื่อมีการร้องขอ"เวลา":
แบบอักษร.เอ็กซ์เอ็มแอล
<family name="serif">
<font weight="400" style="normal">NotoSerif-Regular.ttf</font>
<font weight="700" style="normal">NotoSerif-Bold.ttf</font>
<font weight="400" style="italic">NotoSerif-Italic.ttf</font>
<font weight="700" style="italic">NotoSerif-BoldItalic.ttf</font>
</family>
<alias name="times" to="serif" />
<alias name="times new roman" to="serif" />
ในการค้นหาแบบอักษรที่คล้ายกันกลยุทธ์ที่อธิบายไว้ก่อนหน้านี้จะถูกใช้.
นอกจากนั้นAspose.Wordsมีรายการของตัวเองของการเปลี่ยนสำหรับแพลตฟอร์มAndroid.
สมมติว่าเอกสารมีแบบอักษร PMingLiU-ExtB ก่อนอื่น Aspose.Words จะค้นหาแบบอักษรที่ต้องการภายในแหล่งของระบบ.
รายการเริ่มต้นของAndroidโฟลเดอร์ของแบบอักษรคือ:
- /ระบบ/แบบอักษร
- /ระบบ/ตัวอักษร
- /ข้อมูล/แบบอักษร
Aspose.Wordsจะดูผ่านแหล่งที่มาที่ผู้ใช้กำหนดซึ่งถูกตั้งค่าด้วยวิธีการ:
Java
fontSettings->SetFontsFolder(u"C:\\MyFonts\\", true);
ในกรณีที่มีการระบุการแทนที่อย่างชัดเจนAspose.Wordsจะแทนที่แบบอักษรที่ขาดหายไปด้วยข้อเสนอแนะ:
Java
fontSettings->get_SubstitutionSettings()->get_TableSubstitution()->SetSubstitutes(u"PMingLiU-ExtB", System::MakeArray<System::String>({ u"Liberation Serif" }));
ถ้าไม่มีกฎใดทำงานให้ตรวจสอบตารางการเปลี่ยนภายในAspose.Words ถ้าตารางประกอบด้วยข้อมูลเกี่ยวกับแบบที่ดีแล้วแบบอักษรที่ได้รับการแทนที่ ในกรณีของเราAspose.WordsจะเลือกTypeface.SERIF
แต่ถ้าตารางไม่รู้อะไรเกี่ยวกับแบบอักษรที่ร้องขอแล้วAspose.WordsหยิบแบบอักษรตามกฎคำพิเศษMSหรือ.
TrueTypeแบบอักษรบน.NET CoreและXamarin
สำหรับ.NET CoreและXamarinกฎเดียวกันใช้กับสำหรับ Aspose.WordsสำหรับJava วกเขา โดยดีฟอลต์แบบอักษรระบบทั้งหมดของแพลตฟอร์มที่แอ็พพลิเคชันทำงานอยู่. รายการของโฟลเดอร์ที่การค้นหาจะดำเนินการสามารถพบได้โดยการเรียกวิธีการ:
Java
SystemFontSource()->GetAvailableFonts()
โหลดแบบอักษรจากโฟลเดอร์
หากเอกสารที่กำลังประมวลผลมีลิงก์ไปยังแบบอักษรที่ไม่ได้อยู่ในระบบหรือคุณไม่ต้องการเพิ่มลงในโฟลเดอร์ระบบหรือคุณขาดสิทธิ์ทางออกที่ดีที่สุดคือการเพิ่มโฟลเดอร์ที่มีแบบอักษรของคุณเองโดยใช้วิธีการSetFontsSources นี้จะช่วยให้การเปลี่ยนแหล่งที่มาของระบบที่มีแหล่งที่มาของผู้ใช้ Aspose.Wordsจะไม่มองหาแบบอักษรในรีจิสทรีหรือWindows\Fontโฟลเดอร์และแทนที่จะสแกนหาแบบอักษรภายในโฟลเดอร์ที่ระบุเท่านั้น วิธีการGetFontSourcesจะส่งคืนค่าที่สอดคล้องกัน.
ระบุหนึ่งหรือหลายโฟลเดอร์แบบอักษร
วิธีSetFontsFolderและSetFontsFoldersเป็นทางลัดไปยังวิธีการSetFontSourcesโดยมีหนึ่งหรือหลายอินสแตนซ์FolderFontSource วิธีการเหล่านี้จะใช้เพื่อระบุตำแหน่งที่Aspose.Wordsควรมองหาแบบอักษร หากไม่มีโฟลเดอร์หรือไม่สามารถเข้าถึงได้Aspose.Wordsจะเพิกเฉยต่อโฟลเดอร์นี้ หากโฟลเดอร์ทั้งหมดรวมถึงแหล่งที่มาสำหรับการแทนที่แบบอักษรถูกละเว้นAspose.Wordsจะใช้แบบอัก.
ตัวอย่างต่อไปนี้แสดงให้เห็นถึงวิธีการตั้งค่าโฟลเดอร์หรือแหล่งที่มาซึ่งในภายหลังAspose.Wordsจะใช้เพื่อค้นหาแบบอักษรTrueTypeระหว่างการแสดงผลหรือการฝังแบบอักษร:
For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C | |
// The path to the documents directories. | |
System::String inputDataDir = GetInputDataDir_RenderingAndPrinting(); | |
System::String outputDataDir = GetOutputDataDir_RenderingAndPrinting(); | |
System::SharedPtr<Document> doc = System::MakeObject<Document>(inputDataDir + u"Rendering.doc"); | |
System::SharedPtr<FontSettings> fontSettings = System::MakeObject<FontSettings>(); | |
// Note that this setting will override any default font sources that are being searched by default. Now only these folders will be searched for | |
// Fonts when rendering or embedding fonts. To add an extra font source while keeping system font sources then use both FontSettings.GetFontSources and | |
// FontSettings.SetFontSources instead. | |
fontSettings->SetFontsFolder(u"C:\\MyFonts\\", false); | |
// Set font settings | |
doc->set_FontSettings(fontSettings); | |
System::String outputPath = outputDataDir + u"SetTrueTypeFontsFolder.pdf"; | |
doc->Save(outputPath); |
คุณสามารถดาวน์โหลดไฟล์แม่แบบของตัวอย่างนี้ได้จาก Aspose.Words GitHub.
พารามิเตอร์บูลีนพิเศษควบคุมว่าแบบอักษรจะถูกสแกนซ้ำผ่านโฟลเดอร์ทั้งหมดดังนั้นการสแ ตัวอย่างต่อไปนี้แสดงวิธีการตั้งค่าAspose.Wordsเพื่อดูในหลายโฟลเดอร์สำหรับTrueTypeแบบอักษรเมื่อแสดงผล:
For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C | |
// The path to the documents directories. | |
System::String inputDataDir = GetInputDataDir_RenderingAndPrinting(); | |
System::String outputDataDir = GetOutputDataDir_RenderingAndPrinting(); | |
System::SharedPtr<Document> doc = System::MakeObject<Document>(inputDataDir + u"Rendering.doc"); | |
System::SharedPtr<FontSettings> fontSettings = System::MakeObject<FontSettings>(); | |
// Note that this setting will override any default font sources that are being searched by default. Now only these folders will be searched for | |
// Fonts when rendering or embedding fonts. To add an extra font source while keeping system font sources then use both FontSettings.GetFontSources and | |
// FontSettings.SetFontSources instead. | |
fontSettings->SetFontsFolders(System::MakeArray<System::String>({u"C:\\MyFonts\\", u"D:\\Misc\\Fonts\\"}), true); | |
// Set font settings | |
doc->set_FontSettings(fontSettings); | |
System::String outputPath = outputDataDir + u"SetFontsFoldersMultipleFolders.pdf"; | |
doc->Save(outputPath); |
หมายเหตุลำดับความสำคัญ หากมีแบบอักษรที่มีชื่อตระกูลและสไตล์เดียวกันในแหล่งที่มาแบบอักษรที่แตกต่างกันAspose.Wordsจะเลือกแบบอักษรจากแหล่งที่มาที่มีความสำคัญสูงกว่า ดูคำอธิบายของช่อง"ลำดับความสำคัญ"ด้านล่าง.
หากคุณไม่ต้องการใช้แบบอักษรของระบบเลยAspose.Wordsช่วยให้คุณสามารถเพิกเฉยและใช้แบบอักษรของคุณเองเท่านั้น:
C++
System::SharedPtr<FontSettings> fontSettings = System::MakeObject<FontSettings>()->get_DefaultInstance();
fontSettings->SetFontsFolder(u"C:\\MyFonts\\", true);
คุณสมบัติสำคัญ
คุณสมบัติPriorityจะถูกใช้เมื่อมีแบบอักษรที่มีชื่อตระกูลและสไตล์เดียวกันในแหล่งที่มาของแบบอัก ในกรณีนี้Aspose.Wordsเลือกแบบอักษรจากแหล่งที่มีค่าลำดับความสำคัญสูงกว่า ตัวอย่างเช่นมีรุ่นเก่าของตัวอักษรในโฟลเดอร์ระบบและลูกค้าเพิ่มรุ่นใหม่ของแบบอักษรเ.
C++
System::SharedPtr<FolderFontSource> folderFontSource = System::MakeObject<FolderFontSource>(u"C:\\MyFonts\\", true, 1);
โหลดแบบอักษรจากสตรีม
Aspose.Words จัดเตรียมคลาส StreamFontSource ซึ่งอนุญาตให้โหลดฟอนต์จากสตรีม ในการใช้แหล่งฟอนต์สตรีม ผู้ใช้จำเป็นต้องสร้างคลาสที่สืบทอดมาจาก StreamFontSource และจัดเตรียมการใช้งานของเมธอด OpenFontDataStream เมธอด OpenFontDataStream สามารถเรียกใช้ได้หลายครั้ง ในครั้งแรก เมธอดจะถูกเรียกใช้เมื่อ Aspose.Words สแกนแหล่งฟอนต์ที่ให้มาเพื่อรับรายการฟอนต์ที่พร้อมใช้งาน ในภายหลัง เมธอดอาจถูกเรียกใช้หากใช้ฟอนต์ในเอกสารเพื่อวิเคราะห์ข้อมูลฟอนต์และฝังข้อมูลฟอนต์ลงในรูปแบบเอาต์พุตบางรูปแบบ StreamFontSource อาจมีประโยชน์เนื่องจากอนุญาตให้โหลดข้อมูลฟอนต์เฉพาะเมื่อจำเป็นเท่านั้น และไม่สามารถเก็บไว้ในหน่วยความจำตลอดอายุการใช้งาน FontSettings.
For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C | |
namespace | |
{ | |
class ResourceSteamFontSourceExample : public StreamFontSource | |
{ | |
typedef ResourceSteamFontSourceExample ThisType; | |
typedef Aspose::Words::Fonts::StreamFontSource BaseType; | |
typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo; | |
RTTI_INFO(ThisType, ThisTypeBaseTypesInfo); | |
public: | |
System::SharedPtr<System::IO::Stream> OpenFontDataStream() override; | |
}; | |
System::SharedPtr<System::IO::Stream> ResourceSteamFontSourceExample::OpenFontDataStream() | |
{ | |
return System::Reflection::Assembly::GetExecutingAssembly()->GetManifestResourceStream(u"resourceName"); | |
} | |
} | |
void ResourceSteamFontSource() | |
{ | |
std::cout << "ResourceSteamFontSource example started." << std::endl; | |
// The path to the documents directory. | |
System::String dataDir = GetInputDataDir_RenderingAndPrinting(); | |
System::SharedPtr<Document> doc = System::MakeObject<Document>(dataDir + u"Rendering.doc"); | |
// FontSettings.SetFontSources instead. | |
FontSettings::get_DefaultInstance()->SetFontsSources(System::MakeArray<System::SharedPtr<FontSourceBase>>({System::MakeObject<SystemFontSource>(), System::MakeObject<ResourceSteamFontSourceExample>()})); | |
System::String outputPath = GetOutputDataDir_RenderingAndPrinting() + u"ResourceSteamFontSource.pdf"; | |
doc->Save(outputPath); | |
std::cout << "ResourceSteamFontSource example finished." << std::endl << std::endl; | |
} |
StreamFontSource
บันทึกและโหลดแคชการค้นหาแบบอักษร
เมื่อค้นหาแบบอักษรเป็นครั้งแรกAspose.Wordsจะซ้ำกับแหล่งแบบอักษรที่ระบุโดยผู้ใช้และสร้างแคชการค้ ดังนั้นแคชจะเก็บรวบรวมข้อมูลเกี่ยวกับแบบอักษรที่มีอยู่:ครอบครัวตัวอักษรสไตล์ชื่อแบบอั ในการเรียกที่ตามมาAspose.Wordsจะค้นหาข้อมูลเกี่ยวกับแบบอักษรที่ต้องการตามชื่อในแคชการค้นหาแบบอักษรหลังจากนั้นจะวิเคราะห์ไฟล์ที่ระบุเพื่อใช้แบบอักษร.
ขั้นตอนสำหรับการแยกแฟ้มแบบอักษรที่มีอยู่ทั้งหมดเพื่อเริ่มต้นแคชจะค่อนข้างใช้เวลานาน Aspose.Wordsช่วยให้คุณสามารถบันทึกและโหลดแคชโดยใช้วิธีการSaveSearchCacheเพื่อแก้ปัญหาประสิทธิภาพการทำงาน อผู้ใช้สามารถโหลดแคชที่บันทึกไว้ก่อนหน้านี้จากไฟล์และข้ามขั้นตอนของการแยกไฟล์แบบอั.
FontSettings
ด้วยแคชโหลด.
รับรายชื่อแบบอักษรที่มีอยู่
หากคุณต้องการดูรายการแบบอักษรที่มีอยู่ซึ่งสามารถใช้เพื่อแสดงผลเอกสารPDFคุณสามารถใช้วิธีการGetAvailableFontsตามที่แสดงในตัวอย่างรหัสต่อไปนี้ คลาสPhysicalFontInfoระบุข้อมูลเกี่ยวกับฟอนต์ฟอนต์ที่มีอยู่สำหรับAspose.Wordsเครื่องมือแบบอักษร:
For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C | |
// Get available system fonts | |
for (auto fontInfo : System::IterateOver(System::MakeObject<SystemFontSource>()->GetAvailableFonts())) | |
{ | |
std::cout << "FontFamilyName : " << fontInfo->get_FontFamilyName().ToUtf8String() << std::endl; | |
std::cout << "FullFontName : " << fontInfo->get_FullFontName().ToUtf8String() << std::endl; | |
std::cout << "Version : " << fontInfo->get_Version().ToUtf8String() << std::endl; | |
std::cout << "FilePath : " << fontInfo->get_FilePath().ToUtf8String() << std::endl; | |
} | |
// Get available fonts in folder | |
for (auto fontInfo : System::IterateOver(System::MakeObject<FolderFontSource>(inputDataDir, true)->GetAvailableFonts())) | |
{ | |
std::cout << "FontFamilyName : " << fontInfo->get_FontFamilyName().ToUtf8String() << std::endl; | |
std::cout << "FullFontName : " << fontInfo->get_FullFontName().ToUtf8String() << std::endl; | |
std::cout << "Version : " << fontInfo->get_Version().ToUtf8String() << std::endl; | |
std::cout << "FilePath : " << fontInfo->get_FilePath().ToUtf8String() << std::endl; | |
} | |
// Get available fonts from FontSettings | |
for (System::SharedPtr<FontSourceBase> fontsSource : FontSettings::get_DefaultInstance()->GetFontsSources()) | |
{ | |
for (auto fontInfo : System::IterateOver(fontsSource->GetAvailableFonts())) | |
{ | |
std::cout << "FontFamilyName : " << fontInfo->get_FontFamilyName().ToUtf8String() << std::endl; | |
std::cout << "FullFontName : " << fontInfo->get_FullFontName().ToUtf8String() << std::endl; | |
std::cout << "Version : " << fontInfo->get_Version().ToUtf8String() << std::endl; | |
std::cout << "FilePath : " << fontInfo->get_FilePath().ToUtf8String() << std::endl; | |
} | |
} |