From: Zhang Weiwu on
From Tk 8.5: Other Things You Should Know
<http://www.markroseman.com/tcl/guide85.html>

*Antialiased text under X11, Mac OS X.* This allows Tk to fit in
much better with modern desktops; the lack of antialiased fonts has
been a frequent criticism recently, particularly on Linux. Based on
Xft on X11, ATSUI on OS X.

is there a way to disable using of anti-alias font? I have an
application runs on a terminal that has large screen with low
resolution, where bitmap fonts with sharp black-white look works much
better than anti-aliased text.

The same application works fine with tk8.4, it default to Helvetic. If I
switch to 8.5 it defaults to an unknown anti-alias font.

This doesn't work on my test Ubuntu 10.04 system:

option add *font "-*-helvetic-*-*-*-*-16-*-*-*-*-*-*-*" widgetDefault

this also doesn't work:

font configure TkDefaultFont -family "Helvetica"
(even when

This works on the same system, it makes application font back to helvetica,
change "#!/usr/bin/wish" to "#!/usr/bin/wish8.4"

but then I cannot take advantage of new features in tcl/tk 8.5


From: Donal K. Fellows on
On 13/06/2010 15:26, Zhang Weiwu wrote:
> is there a way to disable using of anti-alias font?

It is a compile-time option. Just configure Tk with --disable-xft and it
will use the old font renderer.

Donal.
From: Zhang Weiwu on
On 2010年06月14日 03:30, Donal K. Fellows wrote:
> On 13/06/2010 15:26, Zhang Weiwu wrote:
>> is there a way to disable using of anti-alias font?
>
> It is a compile-time option. Just configure Tk with --disable-xft and it
> will use the old font renderer.

Can I infer from the answer that

1. In tk8.5 old and new font render do not co-exist.
2. the new font renderer, a.k.a. xft, would not be able to render old
bitmap font, at least not without configuring it

Thanks a lot for your answer! :)
From: Donal K. Fellows on
On 14 June, 03:05, Zhang Weiwu <zhangweiwu+J...(a)realss.com> wrote:
> 1. In tk8.5 old and new font render do not co-exist.

Tk will only link to one of them at a time; they both provide the same
internal SPI and its not one that was designed to be runtime
switchable. (It could be changed I suppose, but it's not exactly a
high priority thing given that apps that work with the new renderer
look much better.)

> 2. the new font renderer, a.k.a. xft, would not be able to render old
>    bitmap font, at least not without configuring it

Good question. No idea really; we do very little more than fire off
the requested font details through the fontconfig library. I
understand that has many things to adjust, but have no personal
experience of it. (It's always Just Worked for me.)

Donal.
From: Zhang Weiwu on
On 2010年06月14日 16:49, Donal K. Fellows wrote:
>> > 2. the new font renderer, a.k.a. xft, would not be able to render old
>> > bitmap font, at least not without configuring it
>>
> Good question. No idea really; we do very little more than fire off
> the requested font details through the fontconfig library. I
> understand that has many things to adjust, but have no personal
> experience of it. (It's always Just Worked for me.)
>
>
Following this idea, I solved the problem myself.

First, make bitmap fonts available through xft, on my Ubuntu 10.04 the
method is:

http://www.alanbriolat.co.uk/2009/04/enable-bitmap-fonts-on-ubuntu-jaunty/

Then specify font in program:

font configure TkDefaultFont -family "Helvetica"
# Better specify size by pixel for bitmap font
font configure TkCaptionFont -family "Helvetica" -size -25
font configure TkMenuFont -family "Helvetica" -weight bold

This solves the problem. Thanks for your answer in the first place.