gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: typesetting text


From: Fred Kiefer
Subject: Re: typesetting text
Date: Fri, 15 Dec 2000 19:01:41 +0100

Hi Nicola,

I think you are right that a lot of this text layout is just about
building up "words" and putting them into lines. But you should not use
the word "word" here it is rather something like box (as in TeX) or
nominal range (as used in the Apple documentation, for a range that can
be displayed with one PostScript show operation). We are talking about a
list of characters/glyphs with the same display attributes and including
no whitespace. (The difference is that there may be different fonts used
in one word)

To ignore the character/glyph difference for the moment is ok. All the
GNUstep text stuff has done this up to now. I did throw in a lot of
lines that look like they are switching from one to the other, but the
underlying code just returned its parameters. But as we will need to
support glyphs we should keep that code and make that distinction as
much as possible (Even if it would be an optimization to just leave it
out)

Your comment on the NSLayoutManager methods is a bit hard, perhaps some
of the methods really look as if the where very internal. After trying
to understand how a layout manager could work I had to admit that most
of those methods would be rather useful to implement one. Methods like
setLocation:forStartOfGlyphRange: are just what you proposed for
defining the length of a "word" and placing it inside of a line (here
called a line fragment).

One other point looks wrong to me, you don't have just single characters
that must be fitted into an already layouted text. When pasting or when
setting any text attributes there are big bunches of characters that
must be handled at once. In the old NSText code there was a lot of very
specific "optimization" of single characters, that in the end turned out
to be slower than doing it right for all changes. So please, spare up
those optimization until the very end.

I like the idea of caching the glyph/"word" information, but that should
be hidden very deeply in the typesetter or glyph generator, and perhaps
this is also second on the list, after writing the data structure to
hold those "words" .

What is missing in your paper is a discussion on how layout could be
processed in the background. This will make everything a lot more
complex, but will speed up things from the users point of view.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]