From 30b7cfad0ee96073a3c3f42970e1cfb98a6f9d32 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Mon, 28 Apr 2014 17:10:36 +0100 Subject: [PATCH] bug 1002425 - add a Gecko script code for "mathematical notation". r=smontagu --- .../tools/genUnicodePropertyData.pl | 38 ++++++++++++++++++- .../util/nsUnicodePropertyData.cpp | 5 ++- intl/unicharutil/util/nsUnicodeScriptCodes.h | 5 ++- 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/intl/unicharutil/tools/genUnicodePropertyData.pl b/intl/unicharutil/tools/genUnicodePropertyData.pl index 51f69e445ed..91ec121a9ad 100644 --- a/intl/unicharutil/tools/genUnicodePropertyData.pl +++ b/intl/unicharutil/tools/genUnicodePropertyData.pl @@ -196,7 +196,37 @@ my %scriptCode = ( MIAO => 99, SHARADA => 100, SORA_SOMPENG => 101, - TAKRI => 102 + TAKRI => 102, + +# Expected unicode 7.0 additions, not yet supported; re-check when enabling +# by comparison with harfbuzz and with PangoScript values +# BASSA_VAH => 103, +# CAUCASIAN_ALBANIAN => 104, +# DUPLOYAN => 105, +# ELBASAN => 106, +# GRANTHA => 107, +# KHOJKI => 108, +# KHUDAWADI => 109, +# LINEAR_A => 110, +# MAHAJANI => 111, +# MANICHAEAN => 112, +# MENDE_KIKAKUI => 113, +# MODI => 114, +# MRO => 115, +# NABATAEAN => 116, +# OLD_NORTH_ARABIAN => 117, +# OLD_PERMIC => 118, +# PAHAWH_HMONG => 119, +# PALMYRENE => 120, +# PAU_CIN_HAU => 121, +# PSALTER_PAHLAVI => 122, +# SIDDHAM => 123, +# TIRHUTA => 124, +# WARANG_CITI => 125, + +# additional "script" code, not from Unicode (but matches ISO 15924's Zmth tag) +# XXX need to update this when the Unicode 7.0 scripts are enabled above + MATHEMATICAL_NOTATION => 103, ); my $sc = -1; @@ -210,6 +240,7 @@ sub readHarfBuzzHeader my $file = shift; open FH, "< $ARGV[0]/$file" or die "can't open harfbuzz header $ARGV[0]/$file\n"; while () { + s/CANADIAN_SYLLABICS/CANADIAN_ABORIGINAL/; # harfbuzz and unicode disagree on this name :( if (m/HB_SCRIPT_([A-Z_]+)\s*=\s*HB_TAG\s*\(('.','.','.','.')\)\s*,/) { unless (exists $scriptCode{$1}) { warn "unknown script name $1 found in $file\n"; @@ -233,6 +264,11 @@ sub readHarfBuzzHeader die "didn't find HarfBuzz script codes\n" if $sc == -1; die "didn't find HarfBuzz category codes\n" if $cc == -1; +# Additional code not present in HarfBuzz headers: +$sc = $scriptCode{"MATHEMATICAL_NOTATION"}; +$scriptCodeToTag[$sc] = "'Z','m','t','h'"; +$scriptCodeToName[$sc] = "MATHEMATICAL_NOTATION"; + my %xidmodCode = ( 'inclusion' => 0, 'recommended' => 1, diff --git a/intl/unicharutil/util/nsUnicodePropertyData.cpp b/intl/unicharutil/util/nsUnicodePropertyData.cpp index 757851decd0..accf71a68e0 100644 --- a/intl/unicharutil/util/nsUnicodePropertyData.cpp +++ b/intl/unicharutil/util/nsUnicodePropertyData.cpp @@ -11,7 +11,7 @@ */ /* - * Created on Mon Oct 21 16:33:35 2013 from UCD data files with version info: + * Created on Mon Apr 28 11:24:35 2014 from UCD data files with version info: * # Date: 2013-09-27, 23:05:00 GMT [KW] @@ -160,7 +160,8 @@ static const uint32_t sScriptCodeToTag[] = { HB_TAG('P','l','r','d'), HB_TAG('S','h','r','d'), HB_TAG('S','o','r','a'), - HB_TAG('T','a','k','r') + HB_TAG('T','a','k','r'), + HB_TAG('Z','m','t','h') }; static const int16_t sMirrorOffsets[] = { diff --git a/intl/unicharutil/util/nsUnicodeScriptCodes.h b/intl/unicharutil/util/nsUnicodeScriptCodes.h index 42d517ea692..77ce5e4ddc7 100644 --- a/intl/unicharutil/util/nsUnicodeScriptCodes.h +++ b/intl/unicharutil/util/nsUnicodeScriptCodes.h @@ -11,7 +11,7 @@ */ /* - * Created on Mon Oct 21 16:33:35 2013 from UCD data files with version info: + * Created on Mon Apr 28 11:24:35 2014 from UCD data files with version info: * # Date: 2013-09-27, 23:05:00 GMT [KW] @@ -181,8 +181,9 @@ enum { MOZ_SCRIPT_SHARADA = 100, MOZ_SCRIPT_SORA_SOMPENG = 101, MOZ_SCRIPT_TAKRI = 102, + MOZ_SCRIPT_MATHEMATICAL_NOTATION = 103, - MOZ_NUM_SCRIPT_CODES = 103, + MOZ_NUM_SCRIPT_CODES = 104, MOZ_SCRIPT_INVALID = -1 };