Re: Patches for supporting Sinhala script
Owen Taylor <[email protected]>
| Newsgroups | gmane.comp.lib.icu.general |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 2003-09-16 at 18:51, Eric Mader wrote: > Hello Owen, > > I agree that the main function in IndicReordering.cpp has gotten pretty > complicated. I'm starting to think that it would be worth the trouble to > rewrite it to make it easier to understand and maintain. > > My goal when I wrote it was to have a single function which would handle > all of the Indic scripts, so that there wouldn't be a lot of code > duplication. Now I'm wondering if the complexity of the function as it > is now is really worth it... Certainly, the idea occurred to me that it might be easier to have separate functions for outputting a syllable for different languages, rather than the script flags approach. The code would doubtless get a bit longer, but it might be also easier to understand and maintain. I wouldn't claim to understand the code well enough at this point to know if that is actually the case. > Of course, if the function is rewritten, then the regression tests will > be even more important to make sure that everything still works with the > new function. > > ICU inlcudes a little test program for the LayoutEngine called letest. > This just runs the LayoutEngine over some canned data and checks to make > sure that the data that comes back matches the canned answers. Some > version of this might be useful for the regression test, at least in ICU. My idea was that it would be a lot easier to unit-test the Indic reordering part than the whole layout engine... application of OpenType features is dependent on the font, and when you get to GPOS, even on the exact details of how the font is rendered. But the Indic reordering code is essentially a deterministic transformation from Unicode codepoints to Unicode codepoints (+ feature tags). Unit tests for Indic-reordering should also be easier to share between Pango and ICU. Of course, this means having the unit test access internal functions to ICU or to the Pango layout module. It's not to hard to set this up for Pango, I don't how complicated it would be for ICU. > Also, if you have any ideas about how to make IndicReordering.cpp easier > to understand and maintain, I'd love to talk about it. No real suggestions at the moment, but I'll certainly feed any ideas I have back to you. (My current project is rewriting a different bunch of complex code ... redoing the itemization code in Pango so ZWJ ZWNJ actually get to the Indic shaper.) Regards, Owen