QB64.org Forum

QB64 Team Software => InForm Discussion => Topic started by: mohai on December 24, 2021, 07:47:27 am

Title: Any way to change built-in font ?
Post by: mohai on December 24, 2021, 07:47:27 am
Hello all,

Is there any way to change built-in font or change to a distributable one?
I mean, if I change the font in a form or some controls, I can only choose between buitl-in VGA font or the fonts installed in my Windows but, in different OS or different Windows versions, that font could not be available. So, labels and other texts will show different or even will show cut.

So, Is there any way to change or tweak InForm to include a different font into the EXE file, or to use an external font, such as NotoMono-Regular.ttf, even if it is not installed in your system?
Title: Re: Any way to change built-in font ?
Post by: SMcNeill on December 24, 2021, 07:56:37 am
Easiest way is to just copy that font and include it with your project as a resource file.
Title: Re: Any way to change built-in font ?
Post by: FellippeHeitor on December 24, 2021, 08:36:27 am
In the form designer, if you click the label that says "Font:" to the left of the font list, the list will turn into a text field where you can manually enter a font file name.
Title: Re: Any way to change built-in font ?
Post by: mohai on December 27, 2021, 02:25:35 pm
In the form designer, if you click the label that says "Font:" to the left of the font list, the list will turn into a text field where you can manually enter a font file name.
Thank you for the answers.

It works but, some care must be taken:

 - The font file must be in the same folder as UiEditor.exe (or must be installed in Windows system), so Inform will find it at edit time.
 - The font file must be in the same folder as the .EXE from your project. If not, default VGA font will be used instead.



Title: Re: Any way to change built-in font ?
Post by: FellippeHeitor on December 27, 2021, 02:34:25 pm
Precisely.