GNOME Bugzilla – Bug 515432
Add function to get bidirectional character type of a unicode character
Last modified: 2008-04-21 23:56:18 UTC
There is currently no API in Pango to get the bidirectional character type of a unicode character (section 3.2 in UAX #9), pango_unichar_direction() only returns the direction, not the exact character type. Pango already has access to this information by using fribidi_get_type(), so it should be easy to add a corresponding function to the API. This function would make it possible to replace the ICU dependency in WebKit GTK+ by GLib and Pango without an additional dependency on fribidi.
Fair enough. When adding that, we should add a bidi-type iterator too...
This bug is blocking http://bugs.webkit.org/show_bug.cgi?id=15914 If this isn't going to happen for 2.24 we should consider proposing ICU as an external dependency ASAP.
I may add this tomorrow, so it makes it to the pango release on monday.
Umm, feel a bit lazy doing this today. Can someone cook a patch? Put it in pango-bidi-types.[hc], adding enum PangoBidiType that copies name and order from http://www.unicode.org/reports/tr9/. Then use a switch to convert from fribidi types. Then add pango_bidi_type_for_unichar(). For bonus, do an iterator ala pango_script_iter_*() on it. But that can be added later. Thanks.
Created attachment 109643 [details] [review] Proposed patch Does that look ok?
I can work it out from there. Thanks!
2008-04-21 Behdad Esfahbod <behdad@gnome.org> Bug 515432 – Add function to get bidirectional character type of a unicode character Patch from Jürg Billeter * docs/pango-sections.txt: * docs/tmpl/layout.sgml: * docs/tmpl/main.sgml: * docs/tmpl/pangocairo.sgml: * pango/Makefile.am: * pango/pango-bidi-type.c (pango_bidi_type_for_unichar): * pango/pango-bidi-type.h: * pango/pango-types.h: * pango/pango-utils.c (pango_log2vis_get_embedding_levels), (pango_unichar_direction): * pango/pango.def: * pango/pango.h: New public API: enum PangoBidiType; pango_bidi_type_get_type() pango_bidi_type_for_unichar()