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.

P#145571 2024-04-03 12:48

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.

P#145575 2024-04-03 13:41

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.

P#145576 2024-04-03 14:12

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

P#145581 2024-04-03 15:30

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

P#145632 2024-04-04 01:20

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

P#145664 2024-04-04 10:13

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

P#145719 2024-04-04 21:29

[Please log in to post a comment]