12-06-2025, 04:37 AM
Thank you, bplus, for pointing that out. You're absolutely right — I made a serious mistake by not providing any error handling when the font fails to load.I have already updated the original post with corrections.
Let me clarify a few points:
The purpose of this program is to demonstrate a method for correctly displaying local/national characters (rather than garbled text) in QB64 applications. English users typically don't encounter this issue. On Chinese Windows systems where I've tested it, the display works correctly.
Variables like fn, fn1, etc., are simply font handles used by the _LoadFont function. I'm not sure why fn appears highlighted, but pressing F1 doesn't bring up help information. The multiple fonts are loaded only for demonstration purposes.
Since my testing was done on Chinese Windows systems, I didn't initially include Chinese font files, as they wouldn't be meaningful for most users and might affect testing results. However, I did leave comments in the code indicating that users should replace the font paths with their own local fonts and directories.
The LINE INPUT section addresses a quirk in QB64's graphical mode where typed characters appear garbled on screen (though stored correctly in memory), making it hard for users to review or edit their input. Console mode provides a more user-friendly input experience. The dual INPUT sections are merely for comparison and are optional — they're included for anyone interested in testing the difference. Note that using the console requires the $CONSOLE metacommand.
Following bplus's suggestion, I've revised the code by removing unnecessary portions and have now uploaded the STHUPO.TTF font file. If you place it in your Windows\Fonts directory, you should see it render correctly.
I hope this approach helps non-English speakers display their native characters properly in QB64.
Thank you all again for your feedback and corrections.
Let me clarify a few points:
The purpose of this program is to demonstrate a method for correctly displaying local/national characters (rather than garbled text) in QB64 applications. English users typically don't encounter this issue. On Chinese Windows systems where I've tested it, the display works correctly.
Variables like fn, fn1, etc., are simply font handles used by the _LoadFont function. I'm not sure why fn appears highlighted, but pressing F1 doesn't bring up help information. The multiple fonts are loaded only for demonstration purposes.
Since my testing was done on Chinese Windows systems, I didn't initially include Chinese font files, as they wouldn't be meaningful for most users and might affect testing results. However, I did leave comments in the code indicating that users should replace the font paths with their own local fonts and directories.
The LINE INPUT section addresses a quirk in QB64's graphical mode where typed characters appear garbled on screen (though stored correctly in memory), making it hard for users to review or edit their input. Console mode provides a more user-friendly input experience. The dual INPUT sections are merely for comparison and are optional — they're included for anyone interested in testing the difference. Note that using the console requires the $CONSOLE metacommand.
Following bplus's suggestion, I've revised the code by removing unnecessary portions and have now uploaded the STHUPO.TTF font file. If you place it in your Windows\Fonts directory, you should see it render correctly.
I hope this approach helps non-English speakers display their native characters properly in QB64.
Thank you all again for your feedback and corrections.

