Log In  


When printing text on two lines I have found instances where the end of the strings are not pixel aligned. It appears some characters are a different width. I haven't investigated in detail but is this the case or is it maybe a bug? We are talking one or two pixels over 20+ character strings.



It's not a bug. There is a monospace variant of the font, but I don't think it's used anywhere. You can try it in the terminal by typing:

poke(0x4000, get(fetch"/system/fonts/lil_mono.font"))

Personally I really like the choice of a variable width font, especially in the code editor. It can fit more characters on screen horizontally, and I find it a lot more readable than the monospace variant.


Is there a way to default the font in the code editor to use the monospace font? I haven't seen a way to select new fonts anywhere.


I wonder if there is or will be a function to get the pixel length of a string?


Why would Zep make a lowercase "L" 3 pixels wide but an exclamation mark still use 4 pixels?


You can use print() to get the x coordinate of the next character to be printed and use that to calculate the pixel length of a string. https://www.lexaloffle.com/bbs/?tid=49817


Thanks.
Did not know that. I guess that will do. Kind of messy though.



[Please log in to post a comment]