fix: do not insert space between IDC and CJK character.
authorimiyazaki <imiyazaki>
Thu, 29 Jan 2004 16:09:09 +0000 (16:09 +0000)
committerimiyazaki <imiyazaki>
Thu, 29 Jan 2004 16:09:09 +0000 (16:09 +0000)
simplify code.

inCHISE

diff --git a/inCHISE b/inCHISE
index 7a49830..3fb24fa 100755 (executable)
--- a/inCHISE
+++ b/inCHISE
@@ -174,17 +174,17 @@ while(<>){
     if($in_cs ne 'ucs@mcs'){
        s/(.)/&get_char_in_mcs($1,$in_cs)/ge;
     }
+    s/(amp.+?;)/&de_tex_er($1)/ge;
+#    s/(&.+?;)/&de_tex_er($1)/ge;
     s/([$asian])\s+([$asian])/$1$2/g unless($out_cs eq 'UniKS');
     s/([$asian])\s*([^$asian])/$1 $2/g;
-    s/([^$asian])\s*([$asian])/$1 $2/g;
+    s/([^$asian$idc])\s*([$asian])/$1 $2/g;
     s/\-\-\-/pack("U",0x2014)/geo;# EM DASH
     s/\-\-/pack("U",0x2013)/geo;# EN DASH
     s/\`\`/pack("U",0x201f)/geo;# DOUBLE HIGH-REVERSED-9 QUOTATION MARK
     s/\`/pack("U",0x201b)/geo;# SINGLE HIGH-REVERSED-9 QUOTATION MARK
     s/\'\'/pack("U",0x201d)/geo;# RIGHT DOUBLE QUOTATION MARK
     s/\'/pack("U",0x2019)/geo;# RIGHT DOUBLE QUOTATION MARK
-    s/(amp.+?;)/&de_tex_er($1)/ge;
-#    s/(&.+?;)/&de_tex_er($1)/ge;
     @chars=split(//);
   CHAR:
     for($i=0;$i<=$#chars;$i++){
@@ -270,8 +270,8 @@ while(<>){
                                $font_start++;
                            }
                        }
-                       print "{\\fontencoding{OT1}\\fontfamily{" .
-                           sprintf("chise%03d",$ids{$char}[0]) .
+                       print "{\\fontencoding{OT1}\\fontfamily{",
+                           sprintf("chise%03d",$ids{$char}[0]) ,
                                "}\\selectfont\\char$ids{$char}[1]}",&add_break($i);
                        next CHAR;
                    }
@@ -509,7 +509,7 @@ sub get_output_char{
               or $out_char_id=&get_char_attribute($char,'=>ucs')
               or $out_char_id=&get_char_attribute($char,'=>ucs*')
               ){
-               return '{\selectjisfont\char'.$out_char_id.'}';
+               return "{\\selectjisfont\\char$out_char_id}";
            }
        }elsif($out_cs eq 'UniGB'
               and &get_char_attribute($char,"vnd-adobe-cid-unigb-ucs2-h")){
@@ -519,7 +519,7 @@ sub get_output_char{
               or $out_char_id=&get_char_attribute($char,'=>ucs')
               or $out_char_id=&get_char_attribute($char,'=>ucs*')
               ){
-               return '{\selectgbsfont\char'.$out_char_id.'}';
+               return "{\\selectgbsfont\\char$out_char_id}";
            }
        }elsif($out_cs eq 'UniCNS'
               and &get_char_attribute($char,"vnd-adobe-cid-unicns-ucs2-h")){
@@ -529,7 +529,7 @@ sub get_output_char{
               or $out_char_id=&get_char_attribute($char,'=>ucs')
               or $out_char_id=&get_char_attribute($char,'=>ucs*')
               ){
-               return '{\selectcnsfont\char'.$out_char_id.'}';
+               return "{\\selectcnsfont\\char$out_char_id}";
            }
        }elsif($out_cs eq 'UniKS'
               and &get_char_attribute($char,"vnd-adobe-cid-uniks-ucs2-h")){
@@ -539,7 +539,7 @@ sub get_output_char{
               or $out_char_id=&get_char_attribute($char,'=>ucs')
               or $out_char_id=&get_char_attribute($char,'=>ucs*')
               ){
-               return '{\selectksxfont\char'.$out_char_id.'}';
+               return "{\\selectksxfont\\char$out_char_id}";
            }
        }elsif($out_cs eq 'GT'){
            return $gt if($gt=&get_macro_for_GT($char));
@@ -647,7 +647,9 @@ sub get_macro_for_HZK{
        }
     }
     if($hzk){
-       return "{\\fontencoding{OT1}\\fontfamily{".sprintf("hzk%02d",$HZK)."}\\selectfont\\char".$hzk."}";
+       return "{\\fontencoding{OT1}\\fontfamily{"
+           .sprintf("hzk%02d",$HZK)
+           ."}\\selectfont\\char".$hzk."}";
     }else{
        return undef;
     }
@@ -666,9 +668,7 @@ sub get_macro_for_CDP{
     if($cdp){
        $ucs=&get_char_attribute(&get_chars_matching("=big5-pua",$cdp),"=ucs");
        if($ucs){
-           return "{\\fontencoding{OT1}\\fontfamily{cdp}\\selectfont\\char"
-               .$ucs.
-                   "}";
+           return "{\\fontencoding{OT1}\\fontfamily{cdp}\\selectfont\\char$ucs}";
        }else{
            print STDERR "This should not happen.\n";
            print STDERR "ucs code point of CDP: $cdp not found.\n";