@@ -152,6 +152,7 @@ namespace jsar::example
152152 printf (" singlepass - Single rendering pass\n " );
153153 printf (" --env-map <path> Specify environment map directory path\n " );
154154 printf (" --no-env-map Disable environment map rendering\n " );
155+ printf (" --system-fonts-dir <dir> Set custom system fonts directory\n " );
155156 printf (" --help Show this help\n " );
156157 printf (" \n " );
157158 printf (" Examples:\n " );
@@ -161,6 +162,7 @@ namespace jsar::example
161162 printf (" %s --stereo singlepass\n " , programName);
162163 printf (" %s --env-map /path/to/cubemap # Use custom environment map\n " , programName);
163164 printf (" %s --no-env-map # Disable environment map\n " , programName);
165+ printf (" %s --system-fonts-dir /usr/share/fonts # Use custom font directory\n " , programName);
164166 }
165167
166168 bool init (int argc, char **argv)
@@ -279,6 +281,21 @@ namespace jsar::example
279281 if (samples < 0 || samples > 16 )
280282 samples = 4 ;
281283 }
284+ else if (arg == " --system-fonts-dir" )
285+ {
286+ if (i + 1 >= argc)
287+ {
288+ printf (" Error: --system-fonts-dir requires a directory path argument\n " );
289+ help (argv[0 ]);
290+ return false ;
291+ }
292+ string fontsDir = argv[++i];
293+ if (setenv (" JSAR_SYSTEM_FONTS_DIR" , fontsDir.c_str (), 1 ) != 0 )
294+ {
295+ printf (" Error: Failed to set JSAR_SYSTEM_FONTS_DIR environment variable\n " );
296+ return false ;
297+ }
298+ }
282299 else if (arg[0 ] != ' -' )
283300 {
284301 // This is the URL argument
0 commit comments