Re: Features needed for high-end DTP apps



Damon Chaplin <damon kendo fsnet co uk> writes:

> How does TeX's 'glue' relate to the min/max char/word space options in
> XPress? We should consider InDesign's justification model as well.

TeX's glue works like a spring. It has a natural size, a potential for
expanding and a potential for shrinking. When TeX optimizes a
paragraph, it calculates the quality of each line; if the glue in a
line has shrunk or expanded a lot, the quality assesed to the line
goes down. The penalty is a nonlinear (cubic, as I recall) function of
the amount of expanding and shrinking the glue has to do.

When the line is justified, each glob of glue is expanded or shrunk an
amount proportional to its expand and shrink potential. TeX uses globs
of glue as inter-word spacing, but doesn't allow expanding the space
between characters.

If glue like that is used both between characters and as inter-word
spacing, the effect would be bad, because every time a line was
justified, inter-character space would expand a little. This is not
what you want; if the justification can reasonably be done by
expanding inter-word spaces alone, you definitely want to do that.

So for inter-character spaces, we might extend the concept of glue to
also have an associated "level". Glue on a lower level would only be
expanded if the glue at a higher level could not reasonably provide
the extra space, where reasonably might be defined as "not exceeding a
certain penalty".

Such multilevel glue could also be used in other cases where you need
space that is stretchable only in emergencies - space below headings
is an example. Inter-line spacing is another.

> It looks like TeX will be quite useful!

It worth at least understanding TeX's algorithm and knowing what it
can and can't do, and what it can relatively simply be extended to do.

> Hmm. I didn't know that characters can change when words are hyphenated.
> I suppose the hyphenation dictionary should contain this extra
> information where needed. How many words is this needed for?

According to the TeXbook this is used in Swedish and German, but that
is about all I know about it.

> We can at least cooperate on the design & algorithms. If you want to
> code it that would be great - I'd do some of the others instead.

Well, I don't know when I am going to be able to do any real work on
it. These mails are just braindumps of blue-sky ideas. I don't see all
of it being implemented in the forseeable future, but I do think it
worth keeping them in mind to make sure it is possible to add them
later.

> > And capitalization on a per-line bases. Eg. you might want the first
> > line of a paragraph to be set with small-caps.
> 
> Yes, that should be added to the list. It sounds a bit tricky,
> though.

I guess the tricky thing is how to communicate to Pango, that you want
something special to happen to a particular _line_. It sort of
cross-cuts Pango's phases. Algorithmically, it isn't hard to do.


Søren



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