refine &get_output_char()
authorimiyazaki <imiyazaki>
Sun, 5 Oct 2003 14:36:46 +0000 (14:36 +0000)
committerimiyazaki <imiyazaki>
Sun, 5 Oct 2003 14:36:46 +0000 (14:36 +0000)
chise2otf/chise2otf

index 050133f..eb100c6 100755 (executable)
@@ -223,7 +223,7 @@ sub ids_rest{
 
 sub replace_ids{
     my($ids)=@_;
-#    $ids=&normalize_ids($ids,"UniJIS");
+    $ids=&normalize_ids($ids,"UniJIS");
     return $geta if(($ids!~/[$idc]/)
                    or($ids=~/[\x{10000}-]/));
                     #irregular for KAGE.
@@ -256,8 +256,6 @@ sub normalize_ids{
            $output_ids.=pack("U",$output_char_id);
        }elsif($output_char_id=&get_char_attribute($char,"=ucs")){
            $output_ids.=pack("U",$output_char_id);
-       }elsif($output_char_id=&get_char_attribute($char,"ucs")){
-           $output_ids.=pack("U",$output_char_id);
        }else{
            return $geta;
        }
@@ -276,33 +274,28 @@ sub get_output_char{
        return pack("S",$jis|0x8080);
     }else{
        foreach $out_cs (@order){
-           if($out_cs eq 'UniJIS'){
+           if($out_cs eq 'UniJIS'
+              and &get_char_attribute($char,"adobe-unijis-utf16-h")){
                if($out_char=&get_char_attribute($char,'=ucs@jis')
-                  or ($out_char=&get_char_attribute($char,'=ucs')and
-                      &get_char_attribute($char,"adobe-unijis-utf16-h"))
-#                     &get_char_attribute($char,"adobe-unijis-ucs2-h"))
-                  ){
+                  or $out_char=&get_char_attribute($char,'=ucs')){
                    return "\\UTF{".sprintf("%X",$out_char)."}";
                }
-           }elsif($out_cs eq 'UniGB'){
+           }elsif($out_cs eq 'UniGB'
+                  and &get_char_attribute($char,"adobe-unigb-ucs2-h")){
                if($out_char=&get_char_attribute($char,'=ucs@gb')
-                  or ($out_char=&get_char_attribute($char,'=ucs')and
-                      &get_char_attribute($char,"adobe-unigb-ucs2-h"))
-                  ){
+                  or $out_char=&get_char_attribute($char,'=ucs')){
                    return "\\UTFC{".sprintf("%X",$out_char)."}";
                }
-           }elsif($out_cs eq 'UniCNS'){
+           }elsif($out_cs eq 'UniCNS'
+                  and &get_char_attribute($char,"adobe-unicns-ucs2-h")){
                if($out_char=&get_char_attribute($char,'=ucs@cns')
-                  or ($out_char=&get_char_attribute($char,'=ucs')and
-                      &get_char_attribute($char,"adobe-unicns-ucs2-h"))
-                  ){
+                  or $out_char=&get_char_attribute($char,'=ucs')){
                    return "\\UTFT{".sprintf("%X",$out_char)."}";
                }
-           }elsif($out_cs eq 'UniKS'){
+           }elsif($out_cs eq 'UniKS'
+                  and &get_char_attribute($char,"adobe-uniks-ucs2-h")){
                if($out_char=&get_char_attribute($char,'=ucs@ks')
-                  or ($out_char=&get_char_attribute($char,'=ucs')and
-                      &get_char_attribute($char,"adobe-uniks-ucs2-h"))
-                  ){
+                  or $out_char=&get_char_attribute($char,'=ucs')){
                    return "\\UTFK{".sprintf("%X",$out_char)."}";
                }
            }elsif($out_cs eq 'GT'){