diff options
Diffstat (limited to 'generic/Text.c')
-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)) { |