Page 1 of 1
[FIXED] Possibility to change ZGE default font?
Posted: Fri Feb 18, 2022 10:14 am
by Ats
Hello. I just spent 5 minutes trying to figure out why my code wasn't working. Turned out there was a letter l in the middle of the numbers.
- 1_or_l.png (1.44 KiB) Viewed 10135 times
Is there's a way to change the default code font? If not, could that be possible to add, or is it too complicated?
Or maybe, if the font is embedded during compilation, we could switch to a more readable font?
Here's the same in SublimeText:
- 1_or_l_sublimetext.png (1.41 KiB) Viewed 10135 times
Re: Possibility to change ZGE default font?
Posted: Tue Jul 26, 2022 8:15 am
by Ats
Today I tried replacing the editor font by another.
After a quick search "font.name" in the ZGameEditor project, the fonts used are:
- 'Tahoma': most of the program
- 'MS Sans Serif': text editors, maybe?
- 'Courier New': a lone wolf that only appears in zgameeditor\tools\ZDesigner\3rdparty\SynEditMiscClasses.pas
Replacing Tahoma works just fine, but I can't get to replace the MS Sans Serif used by the editor.
I even tried to put Tahoma everywhere, but the editor font is still different:
- 1_or_l_editor.png (3.07 KiB) Viewed 9575 times
.
So where does the magic happen to set the editor's font?
I would like to try replacing it by the fonts used in Sublime Text:
Windows: Consolas 10 pt.
Linux: Monospace 10 pt. (the exact monospace font used may vary on different Linux distributions or versions)
OS X: Menlo Regular 12 pt.
- zfaZJ.png (122.93 KiB) Viewed 9575 times
Re: Possibility to change ZGE default font?
Posted: Wed Jul 27, 2022 9:28 am
by Kjell
Hi Ats,
Ats wrote: ↑Tue Jul 26, 2022 8:15 amSo where does the magic happen to set the editor's font?
ZGameEditor uses the
SynEdit component for code editing and doesn't set any specific font ( so the default is used ). Apparently you can set a custom font using the
SetFont procedure. Should be pretty straight-forward to add a CodeEditorFont entry ( alongside CodeEditorFontSize ) in the configuration file so ZGE users can easily configure this themselves.
K
Re: Possibility to change ZGE default font?
Posted: Wed Jul 27, 2022 2:43 pm
by VilleK
Please try this. Download ZGE again, I just updated it.
Open ZGameEditor.ini
In the Designer-section, add
"CodeEditorFontName=the name of your font"
For instance: CodeEditorFontName=Webdings
Save the file.
Open ZGE and see if it worked.
Re: Possibility to change ZGE default font?
Posted: Thu Jul 28, 2022 9:38 am
by Ats
Thanks VilleK, it's working perfectly and the font Consolas makes the code very nice to look at