Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tk & Antialised Fonts...

4 views
Skip to first unread message

Georgios Petasis

unread,
Jun 4, 2003, 2:45:19 AM6/4/03
to
Hi all,

I have tried the new addition, the antialised fonts that have
been introduced recently in the core. It seems to work
fine under redhat 9.0 that I tried it.

However, I have some objections regarding the changes
in the default fonts. Is this required? Now tk has changed
from a sans serief font (helvetica - arial) to serif font
(like times new roman). The default font is set to something
like sans_serif but in my system this font is found like
"sans serif" (no undersore). And the tk's heuristics for
substituting fonts when an exact match is not found choose
a totally irrelevant font :-)

I know I can use XDefaults or the option
database to change it to what-ever I want. I
just wanted to point that we should choose more
carefully the defaults. (i.e. with the new
defaults the BWidget dialogs use a font that is huge!)

Regarding the new antialised support it seems to work
great. I haven't seen any problem at all, except from the change
in the default fonts of course :-)

George


Jeffrey Hobbs

unread,
Jun 4, 2003, 11:40:53 AM6/4/03
to
Georgios Petasis wrote:
...

> Regarding the new antialised support it seems to work
> great. I haven't seen any problem at all, except from the change
> in the default fonts of course :-)

The new AA stuff is very much still in flux. The intention is not
to modify existing default fonts, but rather to have AA fit in the
same as the existing setup. If it squeaks through to a release in
the current state, then do please complain. :)

--
Jeff Hobbs The Tcl Guy
Senior Developer http://www.ActiveState.com/
Tcl Support and Productivity Solutions

Joe English

unread,
Jun 4, 2003, 8:39:25 PM6/4/03
to
Georgios Petasis wrote:
>
>I have tried the new addition, the antialised fonts that have
>been introduced recently in the core. It seems to work
>fine under redhat 9.0 that I tried it.
>
>However, I have some objections regarding the changes
>in the default fonts. Is this required?

Tk specifies "Helvetica -12" as the default font for most
widgets on Unix, but according to font(n) "Helvetica"
doesn't necessarily mean "Helvetica", it means "a sans
serif ``European'' font" that is guaranteed to exist
on all platforms. For instance, if you ask Tk for Helvetica
on Windows you'll usually get Arial, and on the Mac you'll
usually get Geneva. Under X11, you usually _do_ get Helvetica,
since Adobe contributed a (bitmap) version of the font
to the X consortium.

Now with fontconfig (which Xft uses), "sans-serif" is the
name of the sans serif font which is guaranteed to exist,
so I changed tkUnixDefault.h to use that instead if HAVE_XFT
is defined. (Plus, if you ask for "Helvetica", you usually
get an uglier bitmap font.)

> Now tk has changed
>from a sans serief font (helvetica - arial) to serif font
>(like times new roman).

You definitely shouldn't be getting a serif font. Can you try
'font actual {sans-serif -12}' and see what that returns?
On Mandrake 9.1, this maps to "Luxi Sans", and on my Debian
box I get "Nimbus Sans L".

> The default font is set to something
>like sans_serif but in my system this font is found like
>"sans serif" (no undersore).

It should be "sans-serif" with a hyphen, not an underscore.
Both "sans" and "sans serif" _should_ be aliased to "sans-serif"
in /etc/fonts.conf (which in turn should map to a "best" or
"preferred" font later on). Also check /etc/fonts/local.conf,
and ~/.fonts.conf.

> And the tk's heuristics for
>substituting fonts when an exact match is not found choose
>a totally irrelevant font :-)

With --enable-xft, font substitution is left entirely up
to fontconfig. What fontconfig does is somewhat difficult
to follow, but it should generally do something sensible.

>I know I can use XDefaults or the option
>database to change it to what-ever I want. I
>just wanted to point that we should choose more
>carefully the defaults. (i.e. with the new
>defaults the BWidget dialogs use a font that is huge!)
>
>Regarding the new antialised support it seems to work
>great. I haven't seen any problem at all, except from the change
>in the default fonts of course :-)


This is a good question: should Tk's defaults be "the platform
default 'best' font", or "the same as in 8.4"?

--Joe English

jeng...@flightlab.com

Georgios Petasis

unread,
Jun 5, 2003, 1:34:53 AM6/5/03
to
"Joe English" <jeng...@flightlab.com> wrote in message
news:bbm3f...@enews4.newsguy.com...

> Georgios Petasis wrote:
> >
> >I have tried the new addition, the antialised fonts that have
> >been introduced recently in the core. It seems to work
> >fine under redhat 9.0 that I tried it.
> >
> >However, I have some objections regarding the changes
> >in the default fonts. Is this required?
>
> Tk specifies "Helvetica -12" as the default font for most
> widgets on Unix, but according to font(n) "Helvetica"
> doesn't necessarily mean "Helvetica", it means "a sans
> serif ``European'' font" that is guaranteed to exist
> on all platforms. For instance, if you ask Tk for Helvetica
> on Windows you'll usually get Arial, and on the Mac you'll
> usually get Geneva. Under X11, you usually _do_ get Helvetica,
> since Adobe contributed a (bitmap) version of the font
> to the X consortium.
>
> Now with fontconfig (which Xft uses), "sans-serif" is the
> name of the sans serif font which is guaranteed to exist,
> so I changed tkUnixDefault.h to use that instead if HAVE_XFT
> is defined. (Plus, if you ask for "Helvetica", you usually
> get an uglier bitmap font.)

I believe the root of the problem is that a "sans-serif" does not
exist in my system. I have only ""sans serif", which originate
from copying fonts from another operating system. My
system is redhat 9.0, so I suppose the same happens with
all redhat.

>
> > Now tk has changed
> >from a sans serief font (helvetica - arial) to serif font
> >(like times new roman).
>
> You definitely shouldn't be getting a serif font. Can you try
> 'font actual {sans-serif -12}' and see what that returns?
> On Mandrake 9.1, this maps to "Luxi Sans", and on my Debian
> box I get "Nimbus Sans L".

I will check this :-)

>
> > The default font is set to something
> >like sans_serif but in my system this font is found like
> >"sans serif" (no undersore).
>
> It should be "sans-serif" with a hyphen, not an underscore.
> Both "sans" and "sans serif" _should_ be aliased to "sans-serif"
> in /etc/fonts.conf (which in turn should map to a "best" or
> "preferred" font later on). Also check /etc/fonts/local.conf,
> and ~/.fonts.conf.

Well, I want to avoid customisation as much as possible, since I
update frequently my system. Also, I am not complaining for
my system, but for tk in general :-) I don't think we should require
such changes to be done by users, since the various distributions
do not offer a "sans-serif" font...

>
> > And the tk's heuristics for
> >substituting fonts when an exact match is not found choose
> >a totally irrelevant font :-)
>
> With --enable-xft, font substitution is left entirely up
> to fontconfig. What fontconfig does is somewhat difficult
> to follow, but it should generally do something sensible.
>
> >I know I can use XDefaults or the option
> >database to change it to what-ever I want. I
> >just wanted to point that we should choose more
> >carefully the defaults. (i.e. with the new
> >defaults the BWidget dialogs use a font that is huge!)
> >
> >Regarding the new antialised support it seems to work
> >great. I haven't seen any problem at all, except from the change
> >in the default fonts of course :-)
>
>
> This is a good question: should Tk's defaults be "the platform
> default 'best' font", or "the same as in 8.4"?
>

It would be great if we could get the default 'best' font, but I don't
think this is possible. Too many vendors, its one with different
defaults :-)

George


vince darley

unread,
Jun 5, 2003, 12:59:11 PM6/5/03
to
Jeffrey Hobbs <Je...@ActiveState.com> wrote in message news:<3EDE1327...@ActiveState.com>...

> Georgios Petasis wrote:
> ...
> > Regarding the new antialised support it seems to work
> > great. I haven't seen any problem at all, except from the change
> > in the default fonts of course :-)
>
> The new AA stuff is very much still in flux. The intention is not
> to modify existing default fonts, but rather to have AA fit in the
> same as the existing setup. If it squeaks through to a release in
> the current state, then do please complain. :)

Are there any plans to add AA stuff to Tk on Windows or MacOS X??

Vince.

Joe English

unread,
Jun 5, 2003, 12:36:25 PM6/5/03
to
Georgios Petasis wrote:

>Joe English wrote:
>> Now with fontconfig (which Xft uses), "sans-serif" is the
>> name of the sans serif font which is guaranteed to exist,
>> so I changed tkUnixDefault.h to use that instead if HAVE_XFT
>> is defined. (Plus, if you ask for "Helvetica", you usually
>> get an uglier bitmap font.)
>
>I believe the root of the problem is that a "sans-serif" does not
>exist in my system. I have only ""sans serif", which originate
>from copying fonts from another operating system.

Sounds like something is wrong with your fontconfig
installation; "serif", "sans-serif", and "monospace"
should _always_ be available.

>My system is redhat 9.0, so I suppose the same happens with

>all redhat. [...]


>Well, I want to avoid customisation as much as possible, since I
>update frequently my system. Also, I am not complaining for
>my system, but for tk in general :-) I don't think we should require
>such changes to be done by users, since the various distributions
>do not offer a "sans-serif" font...

I've checked on Debian testing, Mandrake 9.1, and Red Hat 8.0;
all of them provide the three standard aliases. In fact, these are
built into the standard fontconfig/Xft/XFree86 distributions, so
should work on any OS that includes them (unless the vendor has
broken something).

Could you also try running 'font families' from an Xft-enabled wish,
and let me know what the results are?


--Joe English

jeng...@flightlab.com

Jeff Hobbs

unread,
Jun 5, 2003, 2:29:55 PM6/5/03
to
[posted and mailed]

vincen...@users.sourceforge.net (vince darley) wrote in
news:4dd3bea3.03060...@posting.google.com:

This is one of those areas where Unix sorely lags behind. Tk already
picks up the AA support on OS X and Windows automatically. On Windows,
if you have the Diplay -> Properties -> Effects -> "Smooth edges of
screen fonts" on, then you get AA. On OS X, there is a magic var that
sets the minimum font size to do the AA on (I believe the default is
8). *nix and Xft are late to the game, and not drop-in replacements. :(

Donal K. Fellows

unread,
Jun 6, 2003, 9:22:12 AM6/6/03
to
Georgios Petasis wrote:
> It would be great if we could get the default 'best' font, but I don't
> think this is possible. Too many vendors, its one with different
> defaults :-)

Though sometimes you feel like the best solution to the "too many vendors"
problem would be if RedHat spontaneously vanished... :^/

Donal.
--
Donal K. Fellows http://www.cs.man.ac.uk/~fellowsd/ donal....@man.ac.uk
-- Naturally I will not be justifying this traditional argument with evidence
and rationale. -- Richard Thrippleton <re...@cam.ac.uk>

George Petasis

unread,
Jun 7, 2003, 3:31:49 PM6/7/03
to
Joe English wrote:

> You definitely shouldn't be getting a serif font. Can you try
> 'font actual {sans-serif -12}' and see what that returns?
> On Mandrake 9.1, this maps to "Luxi Sans", and on my Debian
> box I get "Nimbus Sans L".
>

font actual {sans-serif -12}
-family {Arial Unicode MS} -size 12 -weight normal -slant roman
-underline 0 -overstrike 0

Howver, simply typing 'pack [button .x -text test]'
gives me a button with a serif font :-)

George

George Petasis

unread,
Jun 7, 2003, 3:32:49 PM6/7/03
to
Joe English wrote:

>
> Could you also try running 'font families' from an Xft-enabled wish,
> and let me know what the results are?
>

font families
{Monotype Corsiva} {Century Schoolbook L} {Wingdings 3} {Wingdings 2}
MiscFixed {Estrangelo Edessa} {Euclid Fraktur} Gautami {Franklin Gothic
Medium} Haettenschweiler {Trebuchet MS} {Luxi Sans} Webdings {Palatino
Linotype} {Arial Black} {Luxi Mono} Euclid Verdana Wingdings {URW
Palladio L} console8x16 {MV Boli} {URW Gothic L} Dingbats {URW Chancery
L} {Times New Roman} LucidaTypewriter {Euclid Math One} {Euclid Extra}
{Lucida Console} {Bookman Old Style} Utopia {Lucida Sans Unicode} Symbol
{Century Gothic} {Bitstream Charter} {Comic Sans MS} {Courier 10 Pitch}
{Arial Narrow} Raavi Marlett {Nimbus Sans L} {Microsoft Sans Serif}
{Euclid Math Two} {Pump Demi Bold LET} console8x8 {Book Antiqua}
{Standard Symbols L} Fences {Nimbus Mono L} Courier {Arial Unicode MS}
{Luxi Serif} {Nimbus Roman No9 L} Mangal GiovanniITCTT Perpetua Fixed
{Euclid Symbol} Georgia Garamond Shruti Latha {MT Extra} Arial {Courier
New} Cursor SylfaenARM Tunga Tahoma Impact {URW Bookman L} {Square721 BT}

George

0 new messages