add $opt_use_kage_for_Ext_B.
authorimiyazaki <imiyazaki>
Sun, 16 Nov 2003 13:02:26 +0000 (13:02 +0000)
committerimiyazaki <imiyazaki>
Sun, 16 Nov 2003 13:02:26 +0000 (13:02 +0000)
fix &get_macro_for_ids().

inCHISE

diff --git a/inCHISE b/inCHISE
index 393007a..19a8eff 100755 (executable)
--- a/inCHISE
+++ b/inCHISE
@@ -5,6 +5,7 @@
 use strict;
 use vars qw($omegadb_path
            $opt_protrude $opt_allow_unify
+           $opt_use_kage_for_Ext_B
            %opt_order %order %order_map
            $opt_in_cs $opt_out_cs
            $opt_help $usage
@@ -32,9 +33,12 @@ $opt_order{'UniGB'}='g';
 $opt_order{'UniJIS'}='j';
 $opt_order{'UniKS'}='k';
 
-$opt_allow_unify=1; # 1=true, 0=false.
+$opt_allow_unify=0; # 1=true, 0=false.
 $opt_protrude=0;# 1=true, 0=false.
 
+# currently does not work.
+$opt_use_kage_for_Ext_B=0;# 1=true, 0=false.
+
 ### End ###
 
 my $strictly_forbidden_after = '「【『[(〈“‘‘(〔{《{\[\(\x{3016}{「';
@@ -198,21 +202,23 @@ while(<>){
                        }
                    }
                }
-               if($char_id >= 0x20000 && $char_id <=0x2a6df){
-                   # CJK Unified Ideographs Extension B
-                   if(not defined($ids{$char}) and $ids{$char}[1]>=0){
-                       $ids{$char}[0]=$font_start;
-                       $ids{$char}[1]=$ids_start;
-                       $ids_start++;
-                       if($ids_start>255){
-                           $ids_start=0;
-                           $font_start++;
+               if($opt_use_kage_for_Ext_B){
+                   if($char_id >= 0x20000 && $char_id <=0x2a6df){
+                       # CJK Unified Ideographs Extension B
+                       if(not defined($ids{$char}) and $ids{$char}[1]>=0){
+                           $ids{$char}[0]=$font_start;
+                           $ids{$char}[1]=$ids_start;
+                           $ids_start++;
+                           if($ids_start>255){
+                               $ids_start=0;
+                               $font_start++;
+                           }
                        }
+                       print "{\\fontencoding{OT1}\\fontfamily{" .
+                           sprintf("chise%03d",$ids{$char}[0]) .
+                               "}\\selectfont\\char$ids{$char}[1]}",&add_break($i);
+                       next CHAR;
                    }
-                   print "{\\fontencoding{OT1}\\fontfamily{" .
-                       sprintf("chise%03d",$ids{$char}[0]) .
-                           "}\\selectfont\\char$ids{$char}[1]}",&add_break($i);
-                   next CHAR;
                }
                if($ids=&get_ids($char)){
                    print &get_macro_for_ids($ids),&add_break($i);
@@ -373,7 +379,7 @@ sub get_macro_for_ids{
     return $geta if(($ids!~/[$idc]/)
                    or($ids=~/[\x{10000}-]/));
                     #irregular for KAGE.
-    if(not defined($ids{$ids}) and $ids{$ids}[1]>=0){
+    if(not defined($ids{$ids})){
        $ids{$ids}[0]=$font_start;
        $ids{$ids}[1]=$ids_start;
        $ids_start++;
@@ -477,7 +483,9 @@ sub get_ids{
     # return: ids
     my($char)=@_;
     my $ids="";
-    $ids=&get_char_attribute($char,"ids-aggregated")
+#    $ids=&get_char_attribute($char,"ids-aggregated")
+#      or $ids=&get_char_attribute($char,"ids");
+    $ids=&get_char_attribute($char,"ids-decomposed")
        or $ids=&get_char_attribute($char,"ids");
 #        or $ids=&get_char_attribute($char,"ideographic-structure");
 #    $ids=~s/[? ()]//g;