Closed timothyschoen closed 8 months ago
I still have one small PR coming up. The way I currently store the currently active object in the Lua registry is hacky and needs to be fixed. It could also potentially cause bugs.
I can't get rid of it entirely without changing the API, but I think I can at least minimise its usage as much as possible.
the errors seem to be gone now. while the font in pd for windows already looks somewhat small, is it supposed to be this small? it's kind of difficult to read here (though maybe my font/display settings are just too small overall somehow..)
edit: I see the font is scaled down to match plug-data, is it that small in plug-data too?
the errors seem to be gone now. while the font in pd for windows already looks somewhat small, is it supposed to be this small? it's kind of difficult to read here (though maybe my font/display settings are just too small overall somehow..)
edit: I see the font is scaled down to match plug-data, is it that small in plug-data too?
Yeah, I guess the problem is that the text is set too small in the example, since you can set your own font size. It's also too small in plugdata
Indeed, the example uses 10pt for the text, which is really small on hi-dpi displays. Also, the yellow foreground color on the pink background make the Bezier example just barely visible, at least for my eyes. We should maybe change that in hello-gui.pd_lua. E.g., here is how it looks like with a dark gray background and the font size set to 12 pt, which also seems to be the default in new patch windows in vanilla:
I think that this looks a lot better. Obviously, I still need to change the text a bit to make everything fit again. But first let me merge this PR so that those annyoing bugs on Windows are fixed.
@timothyschoen I don't think that the new factor of 0.75 applied at line 1013 is correct. After merging this, the font sizes are even smaller than before, at least on Linux (this is with desktop scaling at 100%, but on Linux the desktop scale doesn't seem to affect the canvas anyway, only the GUI):
Everything is back to normal after commenting out line 1013:
So I think that we need to get rid of that line. Maybe you could adjust the scaling on the plugdata side instead? Or adjust the scaling depending on the OS and the desktop scaling that is in effect? Gets complicated, I know, but the way it is now, the font sizes are way off in vanilla and 10 is completely illegible.
Ok, here's how the demo looks now after fiddling with some of the positions, and after commenting out line 1013:
I've included the [osc~] object for reference, with the canvas font size set to 12, which matches the font size in the gfx example. The font sizes look alright to me.
I'm ready to commit this so that you can test it on vanilla in Windows, and on plugdata. Opinions?
Here's the example that I used for testing, with the modified hello-gui.pd_lua included. But note that you'll need to comment out line 1013 and recompile to compare with the screenie that I posted above.
Ok, I just went ahead and commited my changes now, so that you can test. @timothyschoen I'm ready to revert the font scaling change (rev. d7f6fe8875b1a38f458d08214c446634efcc6440) as soon as you come up with something better.
Ok, I just went ahead and commited my changes now, so that you can test. @timothyschoen I'm ready to revert the font scaling change (rev. d7f6fe8) as soon as you come up with something better.
I've now just scaled the fontsize on plugdata's side so it's about the same as in pd-vanilla. I removed your comment in #42 as well.
Fixes 2 problems on Windows:
Better random string generation, which fixes #39. We now have a string with 61 random alphanumeric chars (also using a better random algorithm), which should give plenty of randomness.
Fontheight needs to be passed to tcl/tk as a negative value to get it to scale along with hi-dpi screens on Windows. This is done in other places in pd's source code as well, like here