How to use system font for text on mobile

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

:blue_book: Instructions

Sample for ios_sandbox to display Japanese text with system font on iPad

  1. Add font directory
NSString *fontDir = @"/System/Library/Fonts/AppFonts";
MobileApp::inst().setFontDirectory(fontDir.UTF8String);
  1. 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);
  1. ( 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.