Skip to content

Commit

Permalink
adding comments to explain the reordering
Browse files Browse the repository at this point in the history
  • Loading branch information
kakwa committed Jun 8, 2017
1 parent a387a6c commit b173ac6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lib/emf2svg_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,17 @@ void text_convert(char *in, size_t size_in, char **out, size_t *size_out,
switch (states->currentDeviceContext.font_charset) {
case U_HEBREW_CHARSET:
case U_ARABIC_CHARSET:
/* with Utf-8 strings, the strings must always be
* stored in logical order, not visual order.
* Unicode Bidirectional (bidi) Algorithm does the work
* of rendering the text properly.
* So we reverse the text to be in logical order.
* However, this seems imcomplete,
* Right to Left ordering can also be set in
* ExtTextOutOptions (EMR_*TEXTOUT* records) and EMR_SETLAYOUT
* records, and it's completely ignored here.
* FIXME this is probably to simplistic.
*/
reverse_utf8((char *)string, *size_out);
break;
case U_ANSI_CHARSET:
Expand Down

0 comments on commit b173ac6

Please sign in to comment.