On 2009-11-19 17:28-0500 Hazen Babcock wrote: > Alan W. Irwin wrote: >> That leaves the "modern" unicode text rendering path used by the cairo, qt, >> ps, psttf, and other devices that does not use plfreetype. If I recall >> correctly you may have added at least one centralized helper function for >> the modern unicode case which some devices (cairo?) use and others do not >> (yet). > > Yes, this is what I was referring to. Does anyone else have an opinion on > which path we should keep going forward? On the one hand we have the > ubiquitous while loop. On the other we have four different functions, one > called at the start of text, one called for new characters, one called for > new esc characters and one called at the end of the text. The cairo driver > currently has both approaches implemented if anyone is curious to compare the > two. >
I am going to quote you below with lines of code added. Functions called for approach 1: proc_str (106) ucs4_to_pango_markup_format (116) total lines: (222) Functions called for approach 2: text_begin_cairo (21) text_char_cairo (33) text_esc_cairo (41) text_end_cairo (87) total lines: (182) There seems to be a reduction in code and simplification into separate routines with better defined purposes with approach 2. So on those grounds alone I suggest you go ahead and drop proc_str and ucs4_to_pango_markup_format from cairo.c Note the huge loop in plP_text that exercises the above functions needs cleaning up. I have recently been fighting my way through that loop logic for other purposes (dropping the momentary change to a symbol font). Currently I believe that loop executes a lot of unnecessary code when plsc->alt_unicode is true. (In other words, some tests for if ( !plsc->alt_unicode ) should be applied.) Furthermore, I believe once that change was done the code could be rearranged so that there were two separate plsc->alt_unicode true and false loops to replace the one giant loop. That change would make the code much easier to read. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel