Magnus Woldrich <[email protected]> wrote:
>> I recently discovered two useful scripts for changing the font size
>> of a running urxvt terminal, one that worked with xft fonts and one
>> that worked with X11 fonts.
>
> Where are those scripts? :)

They're linked in the script, but they're also completely incorporated
into it (with proper attribution, of course).

> http://github.com/trapd00r/pickyfont
>
> It's called pickyfont - though it's perfectly usable today, I wanted some way
> to:
>
> 1) get at a list of (XLFD and xft) fonts available on the system,
>    without having to resort to external tools like xlsfonts and
>    fc-list. How to deal with problems like this:
>
>       % xlsfonts | grep -c dejavu
>       724
>
>       % xlsfonts | grep dejavu | perl -pe 's/(--0).+/$1/' | sort -u | wc -l
>       42

Shouldn't that be possible with the Perl bindings for xlib? And as for
xft fonts it would probably be better to use fontconfig instead of X
directly, for example on my system xlsfonts doesn't list
fontconfig-managed fonts. Or am I misunderstanding your goal here?

> 2) a way to suggest fonts that should behave (in terms of size,
>    mostly) with the current basefont, or alternatively, a user
>    supplied one.

Finding other (X11) fonts with the same size is pretty easy (I'm doing
it in my script): First resolve font aliases to complete X font strings,
split the strings so you get the individual fields and then just filter
based on the size attribute. You may have to pay attention to the
pointsize, resolution and width, though.

I'm not sure how to do that using fontconfig but I don't think it should
be too difficult.

> The current approach, where we use a configuration file for quick
> access to certain fonts, isn't optimal, mostly because it:

By configuration file do you mean ~/.Xresources? Sure, that's a bit
inconvenient. But you can save changes back to it without having to edit
it by hand by using the 'xrdb -edit' command.

> 1) is hard to ship with defaults, there isn't that many fonts that we
>    can rely on being available on most setups. I don't think there's
>    much more than fixed and what shows up with the following command:
>
>       % xlsfonts | grep -P '^\d+'

Maybe a list of fonts in descending desirability could be used where the
first one that is available would be chosen? But fonts are of course
very much a matter of taste.

> 2) involved manual work. Neither convenient for $user, nor $dev.
>
> If you have any input, or if you'd like to join the project, I'd be
> delighted.

I'm not sure I completely understand what you're trying to accomplish --
something like a graphical font selector, only for terminals? I guess
the biggest problem with that would be that you can't actually show the
different fonts in a terminal side-by-side unless you used a graphical
toolkit. I can't really think of a way around that at the moment. But
I'll try to think of something. I'm not a great fan of Perl, though :)

-Jan


_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/rxvt-unicode

Reply via email to