Page 1 of 1
KmotionCNC DRO font alignment issue after font change
Posted: Wed Jan 13, 2021 10:15 pm
by Tim G
Sorry, this probably seems a bit type A and unimportant to worry about, but I've been making a custom UI for KmotionCNC with the Screen Editor and ran into an issue after changing the font on the axis DRO section. After the font change, the font wants to center a bit when the numbers are changing rather than staying fixed like before. For example, the "X" in the X axis DRO indents a tad and the coordinate number indents a tad from the right as well, centering itself in the box. I'd really prefer the X never move and that the decimals stay aligned like before the font change. I'm a bit committed to the font now because I've invested a ton of time creating custom button bitmaps using that font, so I'm hoping I can tweak this. Any ideas?
Re: KmotionCNC DRO font alignment issue after font change
Posted: Thu Jan 14, 2021 3:41 pm
by TomKerekes
Hi Tim,
I think the issue is that the DRO expects a fixed width font (such as Courier New). If in the font a digit and a space have different width then the size of the text will change depending on the number of digits vs spaces. The Control centers the text in the Control. I can't think of a simple solution other than changing the KMotionCNC source code to separate the Label "X:" from the digits, and changing to right alignment. Can't you find a similar fixed width font?
Re: KmotionCNC DRO font alignment issue after font change
Posted: Thu Jan 14, 2021 6:26 pm
by Tim G
Thanks Tom, that was a big help! I wasn't aware of fixed vs. non-fixed font types. Seems like "mono" is a designation for those types of fonts. I was able to search online for a similar font style in monospaced form and that did the trick. The type A side of me can rest a little easier;).
Carl Bruce speaks very highly of you, by the way. I've had a lot of fun learning the Screen Editor and trying out some basic C programs for custom features/buttons for my new CNC router. C is a whole new world to me, but I really appreciate the flexibility it offers, and this forum has been a huge help there.
Re: KmotionCNC DRO font alignment issue after font change
Posted: Thu Jan 14, 2021 7:54 pm
by TomKerekes
Hi Tim,
Thanks for posting back and say hi to Carl.
Maybe post your screen set.
Re: KmotionCNC DRO font alignment issue after font change
Posted: Thu Jan 14, 2021 8:14 pm
by Tim G
Will do, and here's the screen set after the font change. It was fun to get things dialed and styled to match my router setup.
Re: KmotionCNC DRO font alignment issue after font change
Posted: Tue Nov 16, 2021 8:57 pm
by NOELNOG
very nice screen set.