Possibility to change ZGE default font?

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

Post Reply
User avatar
Ats
Posts: 603
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Possibility to change ZGE default font?

Post 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_or_l.png (1.44 KiB) Viewed 7829 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_or_l_sublimetext.png (1.41 KiB) Viewed 7829 times
User avatar
Ats
Posts: 603
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Possibility to change ZGE default font?

Post 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
1_or_l_editor.png (3.07 KiB) Viewed 7269 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
zfaZJ.png (122.93 KiB) Viewed 7269 times
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Re: Possibility to change ZGE default font?

Post 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
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Possibility to change ZGE default font?

Post 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.
User avatar
Ats
Posts: 603
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Possibility to change ZGE default font?

Post by Ats »

Thanks VilleK, it's working perfectly and the font Consolas makes the code very nice to look at :D
Post Reply