summaryrefslogtreecommitdiffstats
path: root/util/unicode/writingSystems.sh
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2009-03-23 09:34:13 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-03-23 09:34:13 (GMT)
commit67ad0519fd165acee4a4d2a94fa502e9e4847bd0 (patch)
tree1dbf50b3dff8d5ca7e9344733968c72704eb15ff /util/unicode/writingSystems.sh
downloadQt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.zip
Qt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.tar.gz
Qt-67ad0519fd165acee4a4d2a94fa502e9e4847bd0.tar.bz2
Long live Qt!
Diffstat (limited to 'util/unicode/writingSystems.sh')
-rwxr-xr-xutil/unicode/writingSystems.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/util/unicode/writingSystems.sh b/util/unicode/writingSystems.sh
new file mode 100755
index 0000000..0fdc7a3
--- /dev/null
+++ b/util/unicode/writingSystems.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# This script generates the QFontDatabase::WritingSystem enum. It
+# uses the Unicode 4.0 Scripts.txt data file as the source, with the
+# following modifications:
+#
+# * Inherited is removed
+# * East Asian scripts (chapter 11) are renamed to: SimplifiedChinese,
+# TraditionalChinese, Japanese, Korean, Vietnamese
+# * Additiona Modern scripts (chapter 12) are removed
+# * Archaic scripts (chapter 13) are removed
+
+grep -Ev "(^[[:space:]]*#|^$)" data/Scripts.txt \
+ | awk '{print $3}' \
+ | grep -Ev "(Inherited|Hangul|Ogham|Old_Italic|Runic|Gothic|Ugaritic|Linear_B|Cypriot|Katakana_Or_Hiragana|Ethiopic|Mongolian|Osmanya|Cherokee|Canadian_Aboriginal|Deseret|Shavian)" \
+ | sed -e s,_,,g -e 's,^Common$,Any,' -e 's,^Hiragana$,SimplifiedChinese NEWLINE TraditionalChinese,' -e 's,^Katakana$,Japanese,' -e 's,^Bopomofo$,Korean,' -e 's,^Han$,Vietnamese,' -e 's,^#$,,' \
+ | uniq > writingSystems
+echo "" >> writingSystems
+echo "Other" >> writingSystems