diff options
author | lecoanet | 2003-05-16 14:08:44 +0000 |
---|---|---|
committer | lecoanet | 2003-05-16 14:08:44 +0000 |
commit | 2a638c7135b065fdb8b7d4e28be145e2ab4e3504 (patch) | |
tree | 1dd7f76df6ed65e4758349ae799d998fecffcf0f /generic | |
parent | 878e8799fe25d3fc98bebf46ebf3447498ff7857 (diff) | |
download | tkzinc-2a638c7135b065fdb8b7d4e28be145e2ab4e3504.zip tkzinc-2a638c7135b065fdb8b7d4e28be145e2ab4e3504.tar.gz tkzinc-2a638c7135b065fdb8b7d4e28be145e2ab4e3504.tar.bz2 tkzinc-2a638c7135b065fdb8b7d4e28be145e2ab4e3504.tar.xz |
* (ComputeCoordinates): Modified the processing of
the white space/tab causing a line break when a
-width limiting atribute is in effect. The extra
space used to be located at the beginning of the
new line. Now it is suppressed. Other white spaces
are still displayed at the begining of the line.
The new behavior seems more natural.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/Text.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/generic/Text.c b/generic/Text.c index c2b8278..bd72341 100644 --- a/generic/Text.c +++ b/generic/Text.c @@ -470,6 +470,15 @@ ComputeCoordinates(ZnItem item, if (ptr) { scan++; } + else { + /* + * Skip white spaces occuring after an + * automatic line break. + */ + if ((*scan == ' ') || (*scan == '\t')) { + scan++; + } + } /* Build a line info even for an empty line * at the end of text or for an empty text. @@ -989,7 +998,26 @@ Render(ZnItem item) glPushMatrix(); glTranslated(xs, ys, 0.0); - ZnRenderString(text->tfi, lines_ptr->start, lines_ptr->num_bytes); + /* + * Temporary ack to fix utf8 display. + * the malloc should be done once for + * each rendering of the item and not + * for each line. The max line size should + * be stored by CC. + */ + { + char *buf; + int written; + + buf = ZnMalloc(lines_ptr->num_bytes+1); + Tcl_UtfToExternal(wi->interp, NULL, + lines_ptr->start, lines_ptr->num_bytes, + TCL_ENCODING_START|TCL_ENCODING_END, + NULL, buf, lines_ptr->num_bytes+1, NULL, + &written, NULL); + ZnRenderString(text->tfi, buf, written); + ZnFree(buf); + } glPopMatrix(); if (ISSET(text->flags, UNDERLINED) || ISSET(text->flags, OVERSTRIKED)) { |