When I use the default fonts in my Ruby-Tk application it takes
400 milliseconds to start up. When I use Helvetica or other fonts it takes
6400 seconds. Is there something I can do about that? Perl does not have
that problem.
···
–
Wybo
When I use the default fonts in my Ruby-Tk application it takes
400 milliseconds to start up. When I use Helvetica or other fonts it takes
6400 seconds. Is there something I can do about that? Perl does not have
that problem.
–
Wybo
Hi,
From: Wybo Dekker wybo@servalys.nl
Subject: Tk: non-default font 16 x slower
Date: Mon, 18 Aug 2003 19:52:35 +0900
Message-ID: Pine.LNX.4.44.0308181227580.1504-100000@servalys.nl
When I use the default fonts in my Ruby-Tk application it takes
400 milliseconds to start up. When I use Helvetica or other fonts it takes
6400 seconds. Is there something I can do about that? Perl does not have
that problem.
Could you tell me your environment ( Ruby version, Tcl/Tk version, OS,
and so on ) and send me your script?
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
Use a font explicitely, not only string references (which causes the font
to be built over and over again), like:
font = TkFont.new(‘courier’)
widget.font(font)
hth,
Kero.
On Mon, 18 Aug 2003 19:52:35 +0900, Wybo Dekker wrote:
When I use the default fonts in my Ruby-Tk application it takes
400 milliseconds to start up. When I use Helvetica or other fonts it takes
6400 seconds. Is there something I can do about that? Perl does not have
that problem.
Hi,
From: Wybo Dekker wybo@servalys.nl
Subject: Tk: non-default font 16 x slower
Date: Mon, 18 Aug 2003 19:52:35 +0900
Message-ID: Pine.LNX.4.44.0308181227580.1504-100000@servalys.nl
When I use the default fonts in my Ruby-Tk application it takes
400 milliseconds to start up. When I use Helvetica or other fonts it takes
6400 seconds. Is there something I can do about that? Perl does not have
that problem.
I improved font control of Ruby/Tk on CVS. Probably, it has better
performance at setting the font option by a font name string.
On the operation of old version, Ruby/Tk creates automatically a
TkFont object which depends on the font parameters. To create a
TkFont object, Ruby/Tk creates named fonts on the Tk interpreter.
The Tk interpreter search a font which matchs to the font parameters.
The search needs large cost.
On the operation of new version, Ruby/Tk does NOT creates
automatically a TkFont object. Only requests the Tk interpreter to
set the font of the widget to the font based on the font parameters.
Without replacing the font, b.font returns a font name string.
So, b.font.size(20) will raise an exception.
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
very good tip, but why is font creation so exceedingly slow
anyway?
On a Pentium 100 it used to take a few seconds with a font
that was already cached by xfs.
Richard
On Tue, Aug 19, 2003 at 05:21:58AM +0900, Kero van Gelder wrote:
On Mon, 18 Aug 2003 19:52:35 +0900, Wybo Dekker wrote:
When I use the default fonts in my Ruby-Tk application it takes
400 milliseconds to start up. When I use Helvetica or other fonts it takes
6400 seconds. Is there something I can do about that? Perl does not have
that problem.Use a font explicitely, not only string references (which causes the font
to be built over and over again), like:font = TkFont.new(‘courier’)
Hi,
From: Richard Zidlicky rz@linux-m68k.org
Subject: Re: Tk: non-default font 16 x slower
Date: Tue, 19 Aug 2003 20:40:55 +0900
Message-ID: 20030819105527.GA2197@linux-m68k.org
very good tip, but why is font creation so exceedingly slow
anyway?
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
When I use the default fonts in my Ruby-Tk application it takes
400 milliseconds to start up. When I use Helvetica or other fonts it takes
6400 seconds. Is there something I can do about that? Perl does not have
that problem.Use a font explicitely, not only string references (which causes the font
to be built over and over again), like:font = TkFont.new(‘courier’)
very good tip, but why is font creation so exceedingly slow
anyway?
On a Pentium 100 it used to take a few seconds with a font
that was already cached by xfs.
It is “created” in Tk. Probably some “extra” things happen.
The answer to what happens, would be in some Tk manual or newsgroup
Bye,
Kero.