On Thursday 28 December 2006 17:21, [EMAIL PROTECTED] wrote: > >----- Oorspronkelijk bericht ----- > >Van: J.Pietschmann [mailto:[EMAIL PROTECTED] > > > >Andreas L Delmelle wrote: > >> Maybe there's a possibility to re-use the existing CharIterators > >> in the fo package? > > > >I'd think so. > >The problem Manuel faces blocked me too from implementing UAX14, > >because I wanted to avoid another pass using a CharIterator over > >the text, similar to how whitespace handling was implemented then. > >Unfortunately I lost track how whitespace normalization and > >collapsing is handled now. > > Those are currently largely handled long before the UAX14 > implementation kicks in. Refinement white-space handling is dealt > with before any TextLayoutManager is instantiated, so operates purely > on the FOTree. > > > Perhaps setting break marks can be > > folded into the whitespace handling loop. > > That's certainly a possibility. FTM, to deal with Manuel's particular > problem, it may even suffice to add such break-marks only on FO > boundaries (so as to avoid that the TextLM needs to look ahead (or > back) at the next (or previous) FOText...) >
Joerg, Andreas, thanks for your suggestions. The idea to move the UAX#14 linebreaking into the whitespace loop is certainly worth looking into. Probably should do hyphenation at the same time as it iterates over Knuth elements in the LineLM and looks pretty 'ugly' as it modifies the Knuth elements retrospectively. If we do it in the whitesspace loop we would need a means of adding break opportunities to the data structures at this point. One possible solution would be to simply add a ZWSP char at each normal break opportunity and a soft hyphen char at every hyphenation point. The Inline LMs could easily deal with that. However, what about markers. Their content is only known at layout time isn't it? The other idea Andreas suggested, that is to give each Inline LM the last and first character of the their preceeding/following LM when constructing the LM from the FO is also worth a look. Thanks > > Cheers, > > Andreas Manuel