bug 1002425 - add a Gecko script code for "mathematical notation". r=smontagu

This commit is contained in:
Jonathan Kew 2014-04-28 17:10:36 +01:00
parent 9206df019f
commit 30b7cfad0e
3 changed files with 43 additions and 5 deletions

View File

@ -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 (<FH>) {
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,

View File

@ -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[] = {

View File

@ -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
};