Handling of LRE, RLE, PDF, LRO and RLO in Pango



Hi,

I'm a bit lost here since I lack the in-depth knowledge and 
the couldn't find the answer in the Unicode standard. The
problem is the following:

We use Yudit to edit persian po files and Yudit inserts
RIGHT-TO-LEFT OVERRIDE (0x202E) at the start and 
POP DIRECTIONAL FORMATTING (0x202C) at the end of each
msgstr. Without these markers the text is displayed wrong
in Yudit and can thus only hardly be edited. The problem
is that Pango renders glyphs for these chars instead of 
only using them for formatting as Yudit does. The rendered
glyphs from MS Arial are thin vertical lines with rectangles
on top (unfilled for RLO, filled for PDF).

I'm not really sure if this is the desired behaviour. A
simple fix would be to change the basic shaper modules
to ignore these characters:

Index: basic-ft2.c
===================================================================
RCS file: /cvs/gnome/pango/modules/basic/basic-ft2.c,v
retrieving revision 1.14
diff -u -p -r1.14 basic-ft2.c
--- basic-ft2.c	2002/01/19 20:04:11	1.14
+++ basic-ft2.c	2002/02/15 11:07:28
@@ -212,7 +212,8 @@ basic_engine_shape (PangoFont        *fo
 	if (pango_get_mirror_char (wc, &mirrored_ch))
 	  wc = mirrored_ch;
 
-      if (wc == 0x200B || wc == 0x200E || wc == 0x200F)	/* Zero-width characters */
+      if (wc == 0x200B || wc == 0x200E || wc == 0x200F || /* Zero-width characters */
+          (wc >= 0x202A && wc <= 0x202E)) /* LRE, RLE, PDF, LRO, RLO */
 	{
 	  set_glyph (font, glyphs, i, p - text, 0);
 	}


This fixes the problem for me but I'm not sure if there are
cases where one would want the glyphs to be rendered. If you
agree that the above change is the right thing to do, I can 
apply similar patches to all basic shapers.


Salut, Sven



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]