Google Summer of Code Intern has Text Layout Problem
gazzaguru2 at btinternet.com
Mon Jul 16 17:07:28 UTC 2007
Probably best to put the text morph inside another morph that handles the
I still have some problems with this, but maybe down to using different font
technologies (TTCFont; FreeTypeFont etc.).
I do find that the margins on TextMotph work, though need a bit of cajojing
to actually update the layout!
From: squeak-dev-bounces at lists.squeakfoundation.org
[mailto:squeak-dev-bounces at lists.squeakfoundation.org] On Behalf Of Michael
Sent: 16 July 2007 5:50 pm
To: The general-purpose Squeak developers list
Subject: Re: Google Summer of Code Intern has Text Layout Problem
Todd Blanchard wrote:
> I don't understand too well how Squeak's styled text works. However,
me neither ;-)
> Google Summer of Code intern has some questions about it that I'm
> someone more knowledgeable can answer.
Apologies for not answering earlier to your request, somehow scrolled of
> This is some <b>bold</b> text.
> I'm sure you get that. CSS uses a box model. Useful diagram here:
> He's trying to figure out what to do if the user creates a style that
> says the b style has 20 pixel margins with a line border. How does he
> get the text to layout right and get the size/shape of the enclosure to
> draw the borders? Extra tricky if the bold section wraps for some
> fraction of lines. Is there an easy api he can use to embed wrappers
> around styles such that he can fiddle the margins/borders?
Hmm, judging from the hoops we to jump through in Sophie he will do a
line based layout/composition, as the the 20 pixel margin would require
to also increase the line spacing around that line?
The then needs to implement rendering runs to display the decoration for
the length of the affected text. Including handling the special cases of
what to do at line breaks etc.
Welcome to the wonderful world of "basic" text editing and layout ;-)
Some Squeak text layout guru probably could come up with clever tricks
to render the text including box as an embedded object within the Squeak
P.S. Users these days consider InDesign level text layout and processing
as "basic". No kidding...
More information about the Squeak-dev