GNOME Bugzilla – Bug 114749
add g_unichar_get_mirror_char
Last modified: 2011-02-18 16:07:08 UTC
It makes sense to me for all the unicode tables to be in one place, so I propose we remove pango_get_mirror_char from mini-fribidi (as part of the modernization) and replace it with g_unichar_get_mirror_char.
Created attachment 17340 [details] [review] patch against glib head
Adding PATCH keyword and setting priority to high because of the patch.
Note that there *are* several other bunches of Unicode data in Pango - the break property stuff, and I just added the TR #24 script identification. Unless something is generally useful, I'm not sure it makes sense to move it to GLib. That doesn't mean that we can't move this one.
Three comments: - I think we need to switch gen-unicode-tables.pl to point at the *directory* including the Unicode files, rather than pointing at 7 individual files. - The docs could use some love - tell the user what the a mirrored character is and why they should use it. In Unicode, some characters are <firstterm>mirrored</firstterm>, this means that when the character occurs in a right-to-left section of text... Or whatever. TRUE and FALSE should be marked up as %TRUE and %FALSE. - You lost the attribution that the code was from fribidi and the copyrights. Other than that, looks fine to commit.
> - I think we need to switch gen-unicode-tables.pl to point > at the *directory* including the Unicode files, rather > than pointing at 7 individual files. I don't know... if you're running the script with anything other than the current stable version of Unicode, that is less convenient, because the files have the version in their names (see http://www.unicode.org/Public/4.0-Update1/ for instance).
Created attachment 19851 [details] [review] updated patch
I really don't think it would be hard to make the code take a directory and figure out what files are what: opendir (DIR, $d) || die "Cannot open Unicode data dir $d: $!\n"; while (defined ($f = readdir (DIR)) { $unicodedata = "$d/$f" if ($f =~ s/UnicodeData.*.txt/); $proplist = "$d/f" if ($f =~ s/PropList.*.txt/); [...] } closedir (DIR); defined $unicodedata || die "Did not find UnicodeData file"; [...] Patch looks fine to commit.
2003-09-12 Noah Levitt <nlevitt@columbia.edu> * glib/gen-unicode-tables.pl: * glib/gunichartables.h: * glib/gunicode.h: * glib/guniprop.c: Add g_unichar_get_mirror_char. (#114749)
2003-09-12 Noah Levitt <nlevitt@columbia.edu> * glib/gen-unicode-tables.pl: Take a directory where to look for the unicode files on the command line instead of 7 individual files.