Skip to content

Commit

Permalink
Bug 1201533 - Remove the GetEastAsianWidth API and its supporting cha…
Browse files Browse the repository at this point in the history
…racter-property data. r=smontagu
  • Loading branch information
jfkthame committed Sep 6, 2015
1 parent 0cc8144 commit e681e88
Show file tree
Hide file tree
Showing 4 changed files with 641 additions and 703 deletions.
37 changes: 2 additions & 35 deletions intl/unicharutil/tools/genUnicodePropertyData.pl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# NB: not all the files are actually needed; currently, we require
# - UnicodeData.txt
# - Scripts.txt
# - EastAsianWidth.txt
# - BidiMirroring.txt
# - HangulSyllableType.txt
# - ReadMe.txt (to record version/date of the UCD)
Expand Down Expand Up @@ -334,7 +333,6 @@ sub readHarfBuzzHeader
my @script;
my @category;
my @combining;
my @eaw;
my @mirror;
my @hangul;
my @casemap;
Expand Down Expand Up @@ -510,37 +508,6 @@ sub readHarfBuzzHeader
}
close FH;

# read EastAsianWidth.txt
my %eawCode = (
'A' => 0, # ; Ambiguous
'F' => 1, # ; Fullwidth
'H' => 2, # ; Halfwidth
'N' => 3, # ; Neutral
'NA'=> 4, # ; Narrow
'W' => 5 # ; Wide
);
open FH, "< $ARGV[1]/EastAsianWidth.txt" or die "can't open UCD file EastAsianWidth.txt\n";
push @versionInfo, "";
while (<FH>) {
chomp;
push @versionInfo, $_;
last if /Date:/;
}
while (<FH>) {
s/#.*//;
if (m/([0-9A-F]{4,6})(?:\.\.([0-9A-F]{4,6}))*\s*;\s*([^ ]+)/) {
my $eaw = uc($3);
warn "unknown EAW code $eaw" unless exists $eawCode{$eaw};
$eaw = $eawCode{$eaw};
my $start = hex "0x$1";
my $end = (defined $2) ? hex "0x$2" : $start;
for (my $i = $start; $i <= $end; ++$i) {
$eaw[$i] = $eaw;
}
}
}
close FH;

# read BidiMirroring.txt
my @offsets = ();
push @offsets, 0;
Expand Down Expand Up @@ -773,14 +740,14 @@ sub sprintCharProps2
{
my $usv = shift;
return sprintf("{%d,%d,%d,%d,%d,%d,%d},",
$script[$usv], $eaw[$usv], $category[$usv],
$script[$usv], 0, $category[$usv],
$bidicategory[$usv], $xidmod[$usv], $numericvalue[$usv],
$verticalOrientation[$usv]);
}
$type = q/
struct nsCharProps2 {
unsigned char mScriptCode:8;
unsigned char mEAW:3;
unsigned char mUnused:3;
unsigned char mCategory:5;
unsigned char mBidiCategory:5;
unsigned char mXidmod:4;
Expand Down
4 changes: 0 additions & 4 deletions intl/unicharutil/util/nsUnicodeProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ inline nsIUGenCategory::nsUGenCategory GetGenCategory(uint32_t aCh) {
return sDetailedToGeneralCategory[GetGeneralCategory(aCh)];
}

inline uint8_t GetEastAsianWidth(uint32_t aCh) {
return GetCharProps2(aCh).mEAW;
}

inline uint8_t GetScriptCode(uint32_t aCh) {
return GetCharProps2(aCh).mScriptCode;
}
Expand Down
Loading

0 comments on commit e681e88

Please sign in to comment.