[LV2] pugl, libsofd and ui scaling

Stefan Westerfeld stefan at space.twc.de
Wed Feb 21 09:39:19 PST 2018


On Wed, Feb 21, 2018 at 05:51:34PM +0100, Robin Gareus wrote:
> On 02/21/2018 05:25 PM, Stefan Westerfeld wrote:
> > So I wonder if libsofd could support setting a desired text size, like 11, 12,
> > 24.
> Depends which x11 fonts are installed. Check with `xfontsel` and
> compared to https://github.com/x42/sofd/blob/master/libsofd.c#L1942
> eg.    XJFONT="-*-times-*-*-*-*-34-*-*-*-*-*-*-*" ./sofd

Yes, I've seen this. But actually this is exactly the kind of internal
knowledge of how libsofd is implemented that I would not want to put into each
plugin UI using it. I could do something like

switch (text_size)
TESTFONT ("-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*");
TESTFONT ("-*-verdana-medium-r-normal-*-12-*-*-*-*-*-*-*");
TESTFONT ("-misc-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*");
TESTFONT ("-misc-fixed-medium-r-normal-*-12-*-*-*-*-*-*-*");
TESTFONT ("-*-helvetica-medium-r-normal-*-14-*-*-*-*-*-*-*");
TESTFONT ("-*-verdana-medium-r-normal-*-14-*-*-*-*-*-*-*");
TESTFONT ("-misc-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*");
TESTFONT ("-misc-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*");
TESTFONT ("-*-helvetica-medium-r-normal-*-16-*-*-*-*-*-*-*");
TESTFONT ("-*-verdana-medium-r-normal-*-16-*-*-*-*-*-*-*");
TESTFONT ("-misc-fixed-medium-r-normal-*-16-*-*-*-*-*-*-*");
TESTFONT ("-misc-fixed-medium-r-normal-*-16-*-*-*-*-*-*-*");

to manually figure out which font to use for libsofd, but this would mean that
I try to do the job of figuring out which fonts are installed myself. There
also doesn't seem to be a simple rule which pixel sizes are supported by which
font, so all numbers would have to be hard coded. It doesn't seem to be the
appropriate place to do the font selection magic in the SpectMorph UI.

> I wish there was a better alternative for a simple file-dialog. Being
> able to depend on pango/cairo would actually help a lot.

If you were to implement a file dialog that has these dependencies, I'd happily
use it. I already have a cairo dependency, and a pango dependency wouldn't be
a problem for me. Especially if I know that I need this only for the Linux
build, where both libraries are usually installed.

   Cu... Stefan
Stefan Westerfeld, http://space.twc.de/~stefan

More information about the Devel mailing list