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

Bug#894159: OpenTTD, icu and ParagraphLayout



Hi folks,

I'm the maintainer of the OpenTTD package, and stumbled on this bug
report, which refers to my package as the last user of the
ParagraphLayout API in icu.

First off: I have a pending new upstream version of OpenTTD that I'd
like to upload, but I don't want to interfere with this transition.
Should I hold it off, or do we expect that resolving these issues will
take a while and should I just upload it now (and have it build against
the current icu version)?


As for the layout issue, AFAIU the following is the case (but correct me
if I'm wrong):
 - ICU used to offer a layout API (which handles the layout of a single
   line of text).
 - Harfbuzz offers a similar layouting engine.
 - icu-le-hb is a separate piece of code that offers the (now removed)
   ICU layout API, by using Harfbuzz
 - ICU offers a ParagraphLayout API (which handles wordwrapping a piece
   of text). This code needs the (now removed) layout API, so currently
   it can only be built on top of icu-le-hb.

This gives a dependency chain where Harfbuzz optionally depends on ICU,
icu-le-hb depends on Harfbuzz and (I presume) ICU, and where
ParagraphLayout depends on icu-le-hb. Since ICU and ParagraphLayout live
in the same source package, this results in a circular dependency, which
needs two successive builds of the ICU package (once without
ParagraphLayout and once with), building icu-le-hb in between, to make
this work.

This does seem like a weird situation, also for ICU upstream. Do they
have any plans to resolve this?

One suggested solution (by László) is to integrate icu-le-hb into the
ICU source package, so the double compilation could at least happen
inside the ICU source package instead of having to be managed
externally. I do wonder: If icu-le-hb is properly integrated into the
ICU build system (probably needs integration upstream to be feasible),
this double build could be removed, right?

One alternative I can imagine is to move the ParagraphLayout code from
the ICU library (where it seems a bit out of place now) into the
icu-le-hb code. AFAICS that would resolve the circular dependency (or
does Harfbuzz need ICU and is that still a problem? That seems hard to
fix in any case...).


Another solution is of course to disable ParagraphLayout. László also
asked if OpenTTD, being the only user of this API, could migrate to
another solution. I've discussed this with OpenTTD upstream yesterday,
and they were already aware of the layout API removal and have been
casually looking at Harfbuzz and Pango as a replacement, but they do not
see an easy solution yet. ParagraphLayout seems to fit their usecase
quite neatly: they need internationalized word-wrapping of text (e.g.
also supporting right-to-left locales). Harfbuzz does not seem to offer
that, and Pango seems heavy-handed (and might not be easy to adapt to
OpenTTD's SDL renderer, and might not be portable enough).

Neither me or upstream has much experience in this field, perhaps you
have a different suggestion for an alternative?

Gr.

Matthijs

Attachment: signature.asc
Description: PGP signature


Reply to: