[Pkg-tcltk-devel] Bug#543221: Bug#543221: tk8.6: Font specification incompatible with legacy apps

Sergei Golovan sgolovan at gmail.com
Sat Aug 29 18:31:27 UTC 2009


severity 543221 wishlist
tags 543221 moreinfo
thanks

On Sun, Aug 23, 2009 at 2:22 PM, Harald Braumann<harry at unheit.net> wrote:
>
> Fonts can now be specified in additional formats. E.g., I can set the X resource
>  *font: "DejaVu Sans Mono" 7
> and this works with tk8.6-apps. But it breaks legacy apps:
>  $ xterm
>  xterm: cannot load font "DejaVu Sans Mono" 7
>
>  $ emacs
>  Font `"DejaVu Sans Mono" 7' is not defined
>
> They expect an XLFD in the font resource. It is thus not possible to specify an
> Xft default font. Each application would have to be configured separately.
>
> The solution IMO is to indroduce new variables for the new font specifications,
> just like xterm did when it gained Xft support (XTerm*faceName, XTerm*faceSize).

A big difference between Tk and xterm is that in Tk you can't choose
between font rendering systems at runtime as in xterm (-fn or -fa in
command line, font or faceName and faceSize in XRDB). Tk can be
compiled with Xft support in which case it renders all fonts using
Xft. So, if Tk is built with Xft enabled, it still understands XLFD
but converts it into Xft structure internally. As a result, you don't
have to use the new font naming format in your resource file. Just
specify XLFD and Tk will still use Xft to render fonts. For "DejaVu
Sans Mono" 7 the following specification should be acceptable by both
emacs and Tk:

*font: -dejavu-dejavu sans mono-medium-r-normal-*-*-70-*-*-*-*-*-*

If you want to specify different fonts based on toolkit they are based
on, then you're out of luck, because XRDB doesn't allow that.

I'm changing the bug severity to wishlist as it doesn't fit to
important, and will close it if yuo won't give some more info.

Cheers!
-- 
Sergei Golovan





More information about the Pkg-tcltk-devel mailing list