Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Ironwright on October 11, 2022, 08:36:20 PM

Title: Why does mc.mcCtrlLoadGcodeString change the font size of the Gcode window to 32
Post by: Ironwright on October 11, 2022, 08:36:20 PM
Why does mc.mcCtrlLoadGcodeString change the font size of the Gcode display to 32.  It enters the Gcode just fine but it changes the font size to 32 for the g code window.  If I edit it and change it back it changes the font size immediately upon reloading the window.
Title: Re: Why does mc.mcCtrlLoadGcodeString change the font size of the Gcode window to 32
Post by: joeaverage on October 11, 2022, 10:07:18 PM
Hi,
I think the Gcode that results from reading a string is just a series of Ascii characters, they do not have a font size.
It is only when the string is displayed that those characters get fleshed out into screen readable symbols.....and the size of each symbol is a property
of the display Window, not the character string itself.

May I suggest you alter the properties of the Gcode window in Mach to have the font size of your choice.

Craig
Title: Re: Why does mc.mcCtrlLoadGcodeString change the font size of the Gcode window to 32
Post by: Ironwright on October 12, 2022, 10:57:55 AM
I have multiple times.  Every time the lua script writes to the gcode window it changes the font size.
Title: Re: Why does mc.mcCtrlLoadGcodeString change the font size of the Gcode window to 32
Post by: Ironwright on October 12, 2022, 02:40:32 PM
I figured it out.  The font size of the g code window is controlled by the number of lines you have the window set to.  Setting the font size parameter does nothing. If you leave the lines parameter blank it will default to a font size of 32 (for my window size).  The higher the lines count the lower the font size the window will have.
Title: Re: Why does mc.mcCtrlLoadGcodeString change the font size of the Gcode window to 32
Post by: joeaverage on October 12, 2022, 03:22:18 PM
Hi,
kool.

I was going to suggest that after making an edit of the window properties that you shut down Mach and then restart. A shutdown will flush any changes made in the Mach session
to the .ini file.

Craig
Title: Re: Why does mc.mcCtrlLoadGcodeString change the font size of the Gcode window to 32
Post by: smurph on October 13, 2022, 11:04:00 PM
I figured it out.  The font size of the g code window is controlled by the number of lines you have the window set to.  Setting the font size parameter does nothing. If you leave the lines parameter blank it will default to a font size of 32 (for my window size).  The higher the lines count the lower the font size the window will have.

Correct.  In the beginning, to make Mach cross platform, we used cross platform fonts that you selected from a dropdown list.  They had no point sizes and the number of lines in the display is what "sized" the fonts.  But people wanted to use Windows provided fonts at the expense of the cross platform ability of the original GUI.  So we added that in and the standard Windows Font dialog was used to select the font.  Everything in the font dialog is used with the exception of the point size on screen elements that used the line sizing before for backwards compatibility.

Steve