You can use system font to display text by adding the directory to HOOPS using HPS::World::SetFontDirectory
. HPS::World โ HOOPS Visualize HPS Documentation 2022.0.0 documentation
Instructions
Sample for ios_sandbox to display Japanese text with system font on iPad
- Add font directory
NSString *fontDir = @"/System/Library/Fonts/AppFonts";
MobileApp::inst().setFontDirectory(fontDir.UTF8String);
- And set font in the system font directory
HPS::TextKit kit;
kit.SetPosition(HPS::Point(0,0,0))
.SetText("ใใญในใๆๅญ").SetFont("HiraMinProN-W3");
textsegment.InsertText(kit);
- ( You can use the code below to check font files and fonts in the directory )
for (NSString *fontFamilyName in [UIFont familyNames]) {
for (NSString *fontName in [UIFont fontNamesForFamilyName:fontFamilyName]) {
NSLog(@"Family: %@ Font: %@", fontFamilyName, fontName);
}
}
NSFileManager *fileMgr = [NSFileManager defaultManager];
NSArray *files = [fileMgr contentsOfDirectoryAtPath:@"/System/Library/Fonts/AppFonts" error:NULL];
NSLog(@"%@", files);
NSString *fontDir = @"/System/Library/Fonts/AppFonts";
MobileApp::inst().setFontDirectory(fontDir.UTF8String);
For Android:
System fonts are stored inside the /system/fonts directory.