[squeak-dev] Re: tab width

marcel.taeumel Marcel.Taeumel at hpi.de
Tue May 10 07:01:25 UTC 2016


Hi, there.

Tab widths are specified in terms of a TextStyle, which is basically a set
of fonts plus extras. So, at the moment there seem to be no direct means to
fetch tab widths with respect to a character width of a specific font. For
details, see CharacterScanner >> #plainTab.

Still, tabs are characters that should have some font information associated
with them.... hmmm...

There is a pool dictionary "TextConstants", which includes "DefaultTab",
"DefaultTabsArray", and "DefaultMarginTabsArray". Changing DefaultTab should
recompute both arrays/caches. In my image, DefaultTab is 24 pixels.

In my experience, some tools offer an configuration to say how much spaces a
tab character should span. So, for a proportional font, users could easily
account for very small spaces by just raising that factor.

Hence, I see no need for specifying tabs pixel-wise. We should rather switch
to "the width of the space character in the current font times X" where X
remains configurable throughout the system. One might think of overriding
such global property with a parameter in CharacterScanner. Use such global
state just for initialization purposes, not throughout the computation.

Best,
Marcel



--
View this message in context: http://forum.world.st/tab-width-tp4894141p4894164.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.


More information about the Squeak-dev mailing list