created.
authorimiyazaki <imiyazaki>
Sat, 4 Oct 2003 16:38:16 +0000 (16:38 +0000)
committerimiyazaki <imiyazaki>
Sat, 4 Oct 2003 16:38:16 +0000 (16:38 +0000)
chise2otf/INSTALL.txt.ja [new file with mode: 0644]
chise2otf/chise2otf [new file with mode: 0755]
chise2otf/chiseotf.sty [new file with mode: 0644]
chise2otf/test.tex [new file with mode: 0644]

diff --git a/chise2otf/INSTALL.txt.ja b/chise2otf/INSTALL.txt.ja
new file mode 100644 (file)
index 0000000..531e426
--- /dev/null
@@ -0,0 +1,149 @@
+### ºîÀ®Ãæ ###
+
+¢£ ¤Ï¤¸¤á¤Ë
+
+  OTF¥Ñ¥Ã¥±¡¼¥¸ http://psitau.at.infoseek.co.jp/otf.html ¤ò»È¤Ã¤Æ¤ß¤¿
+  ¤Î¤ò¤­¤Ã¤«¤±¤Ë¡¢XEmacs/CHISE¤ÇºîÀ®¤·¤¿Ê¸½ñ¤òOTF¥Ñ¥Ã¥±¡¼¥¸¤òÍøÍѤ¹¤ë
+  TeX¥Õ¥¡¥¤¥ë¤ËÊÑ´¹¤¹¤ëperl¥¹¥¯¥ê¥×¥È¤ò½ñ¤¤¤Æ¤ß¤Þ¤·¤¿¡£
+
+  ¦¸/CHISEÍѤ˽ñ¤¤¤¿³°ÉôOTP¤ò¥Ù¡¼¥¹¤Ë¤·¤Æ¤¤¤ë¤Î¤Ç¡¢»ÅÍͤϴðËÜŪ¤Ë¤Ï¶¦
+  Ä̤ǡ¢
+
+  ¡¦IDS¤ò¥Ñ¡¼¥¹¤·¤Æʸ»ú¤ËÃÖ¤­´¹¤¨¤ë
+  ¡¦GT¥Õ¥©¥ó¥È¤Ë¥°¥ê¥Õ¤¬¤¢¤ì¤ÐÍøÍѤ¹¤ë¥ª¥×¥·¥ç¥ó¤¬¤¢¤ë
+  ¡¦¥°¥ê¥Õ¤¬¸«ÉÕ¤«¤é¤Ê¤±¤ì¤Ð¡¢¥Õ¥©¥ó¥È¹çÀ®¥·¥¹¥Æ¥à¤òÍøÍѤ¹¤ë
+
+  ¤Ê¤É¤Ï¤½¤Î¤Þ¤Þ¼õ¤±·Ñ¤¤¤Ç¤¤¤Þ¤¹¡£
+
+  ¤¿¤À¦¸¤È°Û¤Ê¤ê¡¢¸µ¥Õ¥¡¥¤¥ë¤ò°ìÅ٤˽èÍý¤¹¤ë¤Î¤Ç¡¢½èÍý¤¬´Êñ¤Ë¤Ê¤ë¤è¤¦
+  ¤Ë¡¢´Ä¶­¤Ë¤è¤Ã¤Æ¥Ù¡¼¥¹¤Ë¤¹¤ë¥Õ¥©¥ó¥È¤òÀÚÂؤ¨¤ë¤³¤È¤Ï¤»¤º¡¢Ê¸½ñÁ´ÂΤÇ
+  ¤É¤Î¥Õ¥©¥ó¥È¤òÍ¥À褹¤ë¤«¤ò¥¹¥¯¥ê¥×¥È¤Î¥ª¥×¥·¥ç¥ó¤ÇÀÚÂؤ¨¤ë¤è¤¦¤Ë¤·¤Æ
+  ¤¤¤Þ¤¹¡£»ÈÍÑÊýË¡¤Ï¥¹¥¯¥ê¥×¥È¤Î¡Ö-h¡×¥ª¥×¥·¥ç¥ó¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£
+
+  ¥¤¥ó¥¹¥È¡¼¥ë¤Î¼ê½ç¤Ï¼¡¤ÎÄ̤ê¤Ç¤¹¡£ruby/CHISE¤Ë°Í¸¤·¤Æ¤¤¤ëÉôʬ¤¬¤¢¤ê
+  ¤Þ¤¹¤Î¤Ç¡¢¤¢¤é¤«¤¸¤áruby/CHISE¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤ª¤¤¤Æ²¼¤µ¤¤¡£
+
+  ¡¦*ruby/CHISE¤Î¥¤¥ó¥¹¥È¡¼¥ë
+  ¡¦*ºÇ½é¤Ë ruby/CHISE ¤ò»È¤Ã¤Æ ids, ids-decomposed, ids-aggregated ¤È
+     ids ¤ÎµÕ°ú¤­DB¤òºî¤ë¡£
+  ¡¦*Chise_utils.pm ¤ò¥¤¥ó¥¹¥È¡¼¥ë¡ÊÍ× BerkeleyDB.pm¡Ë
+  ¡¦*pfaedit, t1asm ¤Ê¤É¤â¤í¤â¤í¤Î¥¤¥ó¥¹¥È¡¼¥ë
+  ¡¦OTF¥Ñ¥Ã¥±¡¼¥¸¤Î¥¤¥ó¥¹¥È¡¼¥ë
+  ¡¦¥Õ¥©¥ó¥È¥á¥È¥ê¥Ã¥¯¥Õ¥¡¥¤¥ë¤Î¥¤¥ó¥¹¥È¡¼¥ë
+  ¡¦ÀßÄê¤Î½ñ¤­´¹¤¨
+  ¡¦dvipdfmx ¤ÎÀßÄê
+  ¡¦¥¹¥¯¥ê¥×¥È¤Î¼Â¹Ô
+  ¡¦dvipdfmx ¤Î¼Â¹Ô
+
+   * ¦¸/CHISE¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¤¤ë¾ì¹ç¤Ï*°õ¤ÏÉÔÍפǤ¹¡£¤¿¤À¤·¡¢
+     ruby/CHISE ¤Ç ids ¤ÎµÕ°ú¤­DB¤òºî¤ëɬÍפ¬¤¢¤ëÅÀ¤Ë¸æÃí°Õ²¼¤µ¤¤¡£
+
+¢£ ¤Þ¤º ruby/CHISE ¤ò»È¤Ã¤Æ ids, ids-decomposed, ids-aggregated ¤È
+   ids ¤ÎµÕ°ú¤­DB¤òºî¤ê¤Þ¤¹¡£
+
+  $ cd $RUBY_CHISE_DIR/tools
+  $ vi make_ids_db.rb
+  - edit -
+  $ ruby make_ids_db.rb
+
+  db.make_ids_reverse
+  db.make_ids_db
+  db.make_ids_aggregated
+  db.make_ids_decomposed
+
+  ¤¬É¬ÍפǤ¹¡£
+
+¢£ Chise_utils.pm ¤ò¥¤¥ó¥¹¥È¡¼¥ë¡ÊÍ× BerkeleyDB.pm¡Ë
+
+  $ perl Makefile.PL
+  $ make
+  $ make install
+
+¢£ pfaedit, t1asm ¤Ê¤É¤â¤í¤â¤í¤Î¥¤¥ó¥¹¥È¡¼¥ë
+
+  1) Debian (woody) ¤Î¾ì¹ç
+
+    # apt-get install t1utils
+    # apt-get install pfaedit
+
+  2) Mac OS X ¤Î¾ì¹ç
+
+    ¡¦Mac OS X ¤Ç¤Ï fink ¤ò»È¤¨¤Ð t1asm ¤Ï¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤Þ¤¹¡£
+
+      $ sudo apt-get install t1utils
+
+    ¡¦pfaedit ¤Ï
+
+        http://pfaedit.sourceforge.net/MacOSX.html
+
+      ¤Ë¥Ð¥¤¥Ê¥ê¥Ñ¥Ã¥±¡¼¥¸¤¬¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¤½¤ì¤òÄ̾ï¤Î¥¤¥ó¥¹¥È¡¼¥ë¼ê½ç¤Ç
+      ¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ²¼¤µ¤¤¡£
+
+¢£ OTF¥Ñ¥Ã¥±¡¼¥¸¤Î¥¤¥ó¥¹¥È¡¼¥ë
+
+  ¾ÜºÙ¤Ï¾Êά¡£
+
+¢£ ¥Õ¥©¥ó¥È¥á¥È¥ê¥Ã¥¯¥Õ¥¡¥¤¥ë¤Î¥¤¥ó¥¹¥È¡¼¥ë
+
+  chise2otf-texmf-031003.tar.gz ¤ò¼è¤Ã¤Æ¤­¤ÆŸ³«¤¹¤ë
+  ¥Õ¥¡¥¤¥ë¤¬¾å½ñ¤­¤µ¤ì¤Æ¤·¤Þ¤¦¤«¤â¤·¤ì¤Ê¤¤¤Î¤Ç¡¢ÆâÍƤò³Îǧ¤·¤Æ²¼¤µ¤¤¡£
+
+    ex)
+    $ wget http://www.jokoji.jp/chise/chise2otf-texmf-031003.tar.gz
+    $ tar xvzf chise2otf-texmf-031003.tar.gz -C $TEXMF
+
+  * É¬Íפʤ餳¤Î¸å mktexlsr ¤ò¼Â¹Ô¤·¤Æ²¼¤µ¤¤¡£
+
+¢£ ÀßÄê¤Î½ñ¤­´¹¤¨
+
+¡¦makefonts.pl
+    $t1asm   ¢« t1asm ¤Î¾ì½ê 
+    $pfaedit ¢« pfaedit ¤Î¾ì½ê
+    $dbpath  ¢« ¥°¥ê¥Õ¤ò³ÊǼ¤¹¤ëDB¤Î¾ì½ê
+
+  * ¥Õ¥©¥ó¥È¹çÀ®¥·¥¹¥Æ¥à¤ò»È¤ï¤Ê¤¤¾ì¹ç¤Ï makefonts.pl ¤Ë´Ø¤¹¤ëÀßÄê¤ÏÉÔ
+    ÍפǤ¹¡£makefonts.pl ¤Ï¦¸/CHISE¤Î°ìÉô¤Ç¤¹¡£
+
+¡¦chise2otf
+    $perl      ¢« perl ¤Î¾ì½ê
+    $makefonts ¢« makefonts.pl ¤Î¤¢¤ë¾ì½ê
+
+¢£ dvipdfmx ¤ÎÀßÄê
+
+  $TEXMF/dvipdfm/CMap ¤Ë¥ê¥ó¥¯¤ò¤Ï¤ë¤Ê¤É¤·¤Æ CMap ¤ò dvipdfmx ¤Ç»È¤¨¤ë
+  ¤è¤¦¤Ë¤·¤Æ¤ª¤¯¡£
+
+  ex)
+  ln -s $ADOBE_READER_CMAP_DIR/* $TEXMF/dvipdfm/CMap/
+
+  ¤Þ¤¿¡¢dvipdfmx.cfg ¤Ë
+
+  f gto.map
+  f hiraginox.map
+
+  ¤ò²Ã¤¨¤ë¡£
+
+¢£ ¥¹¥¯¥ê¥×¥È¤Î¼Â¹Ô
+
+  ex)
+  $ perl chise2otf -o jtgckm test.tex > test2.tex
+
+¢£ dvipdfmx ¤Î¼Â¹Ô
+
+  ex)
+  $ dvipdfmx test2
+
+  * GT ¤ò»È¤¦»þ¤ÏTTF¤òdvipdfmx¤¬¸«ÉÕ¤±¤é¤ì¤ë½ê¤ËÃÖ¤¤¤Æ²¼¤µ¤¤¡£
+    ¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥ê¥ó¥¯¤ò¤Ï¤ë¤È¤«¡Ä (^^;;
+
+
+¢£ ¤ª¤Þ¤±
+
+¡û Mac OS X ¤Ç¤Î pTeX ¤Î¥¤¥ó¥¹¥È¡¼¥ë
+
+  »ä¤Ï¡ÖJIS X0212 for pTeX¡×
+
+    http://www2.kumagaku.ac.jp/teacher/herogw/index.html
+
+  ¤Î¥Ú¡¼¥¸¤Ë¤¢¤ë¥Ñ¥Ã¥±¡¼¥¸¤òÍøÍѤµ¤»¤Æ¤â¤é¤Ã¤Æ¤Þ¤¹¡£
+  ¤³¤³¤Ë¤ÏOTF¥Ñ¥Ã¥±¡¼¥¸¤â¤¢¤ê¤Þ¤¹¡£
diff --git a/chise2otf/chise2otf b/chise2otf/chise2otf
new file mode 100755 (executable)
index 0000000..306e939
--- /dev/null
@@ -0,0 +1,364 @@
+#!/usr/bin/perl
+
+use strict;
+use vars qw($opt_in_cs $opt_order $opt_help $usage
+           $in_cs $out_cs $i @chars
+           @order $order %order
+           $char $char_id $out_char
+           $ids $ids_argc %ids $idsdb
+           $idsdata_file $ids_start $font_start
+           $perl56 $perl58
+           @CDP @HZK @GT
+           );
+use Getopt::Long;
+use utf8;
+use Chise_utils ':all';
+
+my $perl="/usr/bin/perl";
+my $makefonts="/Users/izumi/.chise/makefonts.pl";
+my $geta=pack("S",8750|0x8080);
+
+if($^V and $^V ge v5.8){
+    $perl58=1;
+}elsif($^V and $^V ge v5.6){
+    $perl56=1;
+}else{
+    print STDERR "This versin is not supported.";
+}
+if($perl58){
+    eval "use Encode";
+    binmode(STDIN, ':encoding(utf8)');
+    binmode(STDOUT, ':encoding(utf8)');
+}
+
+&GetOptions("in=s"=>\$opt_in_cs,
+           "i=s"=>\$opt_in_cs,
+           "o=s"=>\$opt_order,
+           "order=s"=>\$opt_order,
+           "help",\$opt_help,
+           "h",\$opt_help);
+
+$usage=<<EOF;
+Usage: $0 -i <input coding system> -o <order of kanji> <filename>
+    input coding system: (default: ucs\@mcs)
+      ucs\@mcs, ucs\@cns, ucs\@gb, ucs\@jis, ucs\@ks
+    order of kanji: (default: j)
+       c: CNS
+       g: GB
+       j: JIS
+       k: KS
+       t: GT
+       m: Multi, use \\UTFM of otf.sty
+      You can also combine them, ex. jtcgkm
+EOF
+
+%order=('c'=>'UniCNS',
+       'g'=>'UniGB',
+       'j'=>'UniJIS',
+       'k'=>'UniKS',
+       't'=>'GT',
+       'm'=>'Multi',
+       );
+
+if($opt_help){
+    print STDERR $usage;
+    exit 1;
+}
+
+if(not defined($opt_in_cs)){
+    print STDERR "Assuming input coding system is ucs\@mcs.\n";
+    $in_cs='ucs@mcs';
+}else{
+    if(($opt_in_cs ne 'ucs@mcs')or
+       ($opt_in_cs ne 'ucs@cns')or
+       ($opt_in_cs ne 'ucs@gb')or
+       ($opt_in_cs ne 'ucs@jis')or
+       ($opt_in_cs ne 'ucs@ks')){
+       $in_cs=$opt_in_cs;
+    }else{
+       print STDERR $usage;
+       exit 1;
+    }
+}
+
+if(not defined($opt_order)){
+    print STDERR "Using only UniJIS.\n";
+    $opt_order='j';
+}
+
+if(defined($opt_order)){
+    if($opt_order=~/^[cgjktm]+$/){
+       @order=split(//,$opt_order);
+       @order=map {$order{$_}} @order;
+    }else{
+       print STDERR "Invalid option!\n";
+       print $usage;
+       exit 1;
+    }
+}
+
+$idsdata_file="idsdata.pl";
+$ids_start=0x00; 
+$font_start=0;
+
+if(-e $idsdata_file){
+    require $idsdata_file;
+}
+
+$ids_argc=0;
+$ids="";
+
+@GT=(#"=gt","=gt-k",
+     "=gt-pj-1","=gt-pj-2","=gt-pj-3","=gt-pj-4","=gt-pj-5",
+     "=gt-pj-6","=gt-pj-7","=gt-pj-8","=gt-pj-9","=gt-pj-10",
+     "=gt-pj-11"
+     #,"=gt-pj-k1","=gt-pj-k2"
+     );
+@HZK=("=hanziku-1","=hanziku-10","=hanziku-11","=hanziku-12",
+      "=hanziku-2","=hanziku-3","=hanziku-4","=hanziku-5",
+      "=hanziku-6","=hanziku-7","=hanziku-8","=hanziku-9");
+@CDP=("=big5-cdp");
+
+while(<>){
+    s/&(.*?);/&de_er($1)/ge;
+    s/(.)/&get_char_in_ucsmcs($1,$in_cs)/ge if($in_cs ne 'ucs@mcs');
+    @chars=split(//);
+    for($i=0;$i<=$#chars;$i++){
+       $char=$chars[$i];
+       $char_id=unpack("U",$chars[$i]);
+
+       if($char_id<=0x7f){
+           # Basic Latin
+           print $char;
+           next;
+       }elsif($char_id>=0x2ff0 and $char_id<=0x2fff){
+           # Ideographic Description Characters
+           &ids_parse();
+           next;
+       }elsif($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]}";
+           next;
+       }else{
+           if(($out_char=&get_output_char($char_id))){
+               print $out_char;
+           }else{
+               print &replace_ids(&get_ids($char));
+           }
+       }
+    }
+}
+
+open(IDSDATA,">$idsdata_file") or die;
+print IDSDATA 'use utf8;',"\n";
+foreach $ids (keys %ids){
+    print IDSDATA '$ids{\'',$ids,'\'}='
+       ,'[',join ",",@{$ids{$ids}},"];\n" if($perl56);
+    print IDSDATA '$ids{\'',encode('utf8',$ids),'\'}='
+       ,'[',join ",",@{$ids{$ids}},"];\n" if($perl58);
+}
+print IDSDATA '$font_start=',$font_start,";\n";
+print IDSDATA '$ids_start=',$ids_start,";\n";
+print IDSDATA "1;";
+
+### to use makefonts scripts, please uncomment the next lines.
+# system($perl,$makefonts) ==0
+#    or die "Could not make fonts: $?";
+
+exit 0;
+
+sub ids_parse{
+    my($ids,$ids_argc)=&ids_rest("",0,$chars[$i]);
+
+    while($ids_argc>0){
+       # We are in IDS.
+       $i++;
+       if($i>$#chars){
+           print STDERR "IDS parse error: $ids\n";
+           print $geta;
+           $ids="";
+           $ids_argc=0;
+           return;
+       }
+
+       ($ids,$ids_argc)=&ids_rest($ids,$ids_argc,$chars[$i]);
+       if($ids_argc==0){
+           if(($char_id=&get_char_id_for_ids($ids))
+              and($out_char=&get_output_char($char_id))){
+               print $out_char;
+           }else{
+               print &replace_ids($ids) if($perl56);
+               print encode('utf8', &replace_ids($ids)) if($perl58);
+           }
+           $ids="";
+           return;
+       }
+    }
+}
+
+sub ids_rest{
+    my($ids,$ids_argc,$char)=@_;
+    my($argc);
+    $argc=&ids_argc($char);
+    if($argc){
+       $ids_argc+= $ids_argc==0 ? $argc : $argc-1;
+    }else{
+       $ids_argc--;
+    }
+    $ids.=$char if($perl56);
+    $ids.=encode('utf8',$char) if($perl58);
+    return ($ids,$ids_argc);
+}
+
+sub replace_ids{
+    my($ids)=@_;
+#    $ids=&normalize_ids($ids,"UniJIS");
+    return $geta if(($ids!~/[$idc]/)
+                   or($ids=~/[\x{10000}-]/));
+                    #irregular for KAGE.
+    if(not defined($ids{$ids}) and $ids{$ids}[1]>=0){
+       $ids{$ids}[0]=$font_start;
+       $ids{$ids}[1]=$ids_start;
+       $ids_start++;
+    }
+    if($ids_start>255){
+       $ids_start=0;
+       $font_start++;
+    }
+    return "{\\fontencoding{T1}\\fontfamily{"
+       .sprintf("chisesub%03d",$ids{$ids}[0])
+       ."}\\selectfont\\char$ids{$ids}[1]}";
+}
+
+sub normalize_ids{
+    my($ids,$out_cs)=@_;
+    $ids = decode('utf8', $ids) if $perl58;
+    $out_cs=~s/Uni(.+)/"ucs\@".lc($1)/e;
+    my $output_ids="";
+    my($char,$char_id,$output_char_id);
+    while($ids=~m/(.)/g){
+       $char=$1;
+       $char_id=unpack("U",$char);
+       if($char=~/[$idc]/){
+           $output_ids.=$char;
+       }elsif($output_char_id=&get_char_attribute($char,"=$out_cs")){
+           $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;
+       }
+    }
+    return $output_ids;
+}
+
+sub get_output_char{
+    my($char_id)=@_;
+    my($char,$out_char,$suffix);
+    my($jis,$euc,$gt);
+    
+    $char=pack('U',$char_id);
+
+    if($jis=&get_char_attribute($char,'=jis-x0208')){
+       return pack("S",$jis|0x8080);
+    }else{
+       foreach $out_cs (@order){
+           if($out_cs eq 'UniJIS'){
+               if($out_char=&get_char_attribute($char,'=ucs@jis')){
+                   return "\\UTF{".sprintf("%X",$out_char)."}";
+               }
+           }elsif($out_cs eq 'UniGB'){
+               if($out_char=&get_char_attribute($char,'=ucs@gb')
+                  or $out_char=&get_char_attribute($char,'=ucs')){
+                   return "\\UTFC{".sprintf("%X",$out_char)."}";
+               }
+           }elsif($out_cs eq 'UniCNS'){
+               if($out_char=&get_char_attribute($char,'=ucs@cns')){
+                   return "\\UTFT{".sprintf("%X",$out_char)."}";
+               }
+           }elsif($out_cs eq 'UniKS'){
+               if($out_char=&get_char_attribute($char,'=ucs@ks')){
+                   return "\\UTFK{".sprintf("%X",$out_char)."}";
+               }
+           }elsif($out_cs eq 'GT'){
+               return $gt if($gt=&get_macro_for_GT($char_id));
+           }elsif($out_cs eq 'Multi'){
+               if($out_char=&get_char_attribute($char,'=ucs')){
+                   return "\\UTFM{".sprintf("%X",$out_char)."}";
+               }
+           }
+       }
+    }
+    return undef;
+}
+
+sub get_ids{
+    my($char)=@_;
+    my $ids="";
+    $ids=&get_char_attribute($char,"ids-aggregated")
+       or &get_char_attribute($char,"ids");
+    $ids=decode('utf8', $ids) if($perl58);
+    return $ids;
+}
+
+sub get_char_id_for_ids{
+    my($ids)=@_;
+    my($output_char);
+    $ids=decode('utf8', $ids) if($perl58);
+
+    if(&get_reverse_db("ids")){
+       if($output_char=$reverse_chardb{"ids"}->{$ids}){
+           $output_char=~s/^\?//;
+           return unpack("U",$output_char);
+       }
+    }else{
+       return undef;
+    }
+}
+
+sub get_char_in_ucsmcs{
+    # argument: <character>, <input coding system>
+    # return:   character in ucs@mcs.
+    my($char,$in_cs)=@_;
+    my($output_char);
+
+    if(&get_reverse_db("=$in_cs")){
+       if($output_char=$reverse_chardb{"=$in_cs"}->{$char}){
+           return $output_char=~s/^\?//;
+       }
+    }else{
+       return $char;
+    }
+}
+
+sub get_macro_for_GT{
+    my($char_id)=@_;
+    my($char,$gt,$GT);
+    $char=pack("U",$char_id);
+    foreach (@GT){
+       if($gt=&get_char_attribute($char,$_)){
+           m/gt\-pj\-(\d+)/ and $GT=$1;
+           last;
+       }
+    }
+    if($gt){
+       return "{\\fontfamily{"
+           .sprintf("gto%02d",$GT)
+           ."}\\selectfont\\char".($gt|0x8080)."}";
+    }else{
+       return undef;
+    }
+}
diff --git a/chise2otf/chiseotf.sty b/chise2otf/chiseotf.sty
new file mode 100644 (file)
index 0000000..2107f14
--- /dev/null
@@ -0,0 +1,60 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{chise}[2003/10/03 v.0.1 (Omega/CHISE Team)]
+
+\RequirePackage[multi]{otf}
+
+\DeclareKanjiFamily{JY1}{gto01}{}
+\DeclareFontShape{JY1}{gto01}{m}{n}{<-> s * [0.961] gto02}{}
+\DeclareKanjiFamily{JY1}{gto02}{}
+\DeclareFontShape{JY1}{gto02}{m}{n}{<-> s * [0.961] gto02}{}
+\DeclareKanjiFamily{JY1}{gto03}{}
+\DeclareFontShape{JY1}{gto03}{m}{n}{<-> s * [0.961] gto02}{}
+\DeclareKanjiFamily{JY1}{gto04}{}
+\DeclareFontShape{JY1}{gto04}{m}{n}{<-> s * [0.961] gto02}{}
+\DeclareKanjiFamily{JY1}{gto05}{}
+\DeclareFontShape{JY1}{gto05}{m}{n}{<-> s * [0.961] gto02}{}
+\DeclareKanjiFamily{JY1}{gto06}{}
+\DeclareFontShape{JY1}{gto06}{m}{n}{<-> s * [0.961] gto02}{}
+\DeclareKanjiFamily{JY1}{gto07}{}
+\DeclareFontShape{JY1}{gto07}{m}{n}{<-> s * [0.961] gto02}{}
+\DeclareKanjiFamily{JY1}{gto08}{}
+\DeclareFontShape{JY1}{gto08}{m}{n}{<-> s * [0.961] gto02}{}
+\DeclareKanjiFamily{JY1}{gto09}{}
+\DeclareFontShape{JY1}{gto09}{m}{n}{<-> s * [0.961] gto02}{}
+\DeclareKanjiFamily{JY1}{gto10}{}
+\DeclareFontShape{JY1}{gto10}{m}{n}{<-> s * [0.961] gto02}{}
+\DeclareKanjiFamily{JY1}{gto11}{}
+\DeclareFontShape{JY1}{gto11}{m}{n}{<-> s * [0.961] gto02}{}
+
+\DeclareFontFamily{T1}{chisesub000}{}
+\DeclareFontShape{T1}{chisesub000}{m}{n}{
+   <-> [.961] chisesub000min
+}{}
+\DeclareFontFamily{T1}{chisesub000}{}
+\DeclareFontShape{T1}{chisesub000}{bx}{n}{
+   <-> [.961] chisesub000got/bx/n
+}{}
+\DeclareFontFamily{T1}{chisesub001}{}
+\DeclareFontShape{T1}{chisesub001}{m}{n}{
+   <-> [.961] chisesub001min
+}{}
+\DeclareFontFamily{T1}{chisesub001}{}
+\DeclareFontShape{T1}{chisesub001}{bx}{n}{
+   <-> [.961] chisesub001got/bx/n
+}{}
+\DeclareFontFamily{T1}{chisesub002}{}
+\DeclareFontShape{T1}{chisesub002}{m}{n}{
+   <-> [.961] chisesub002min
+}{}
+\DeclareFontFamily{T1}{chisesub002}{}
+\DeclareFontShape{T1}{chisesub002}{bx}{n}{
+   <-> [.961] chisesub002got/bx/n
+}{}
+\DeclareFontFamily{T1}{chisesub003}{}
+\DeclareFontShape{T1}{chisesub003}{m}{n}{
+   <-> [.961] chisesub003min
+}{}
+\DeclareFontFamily{T1}{chisesub003}{}
+\DeclareFontShape{T1}{chisesub003}{bx}{n}{
+   <-> [.961] chisesub003got/bx/n
+}{}
diff --git a/chise2otf/test.tex b/chise2otf/test.tex
new file mode 100644 (file)
index 0000000..614b571
--- /dev/null
@@ -0,0 +1,20 @@
+% -*-coding: utf-8-mcs -*-
+\documentclass[a4paper,12pt]{article}
+
+\usepackage[english]{babel}
+\usepackage[T1]{fontenc}
+\usepackage{times}
+
+\usepackage{chiseotf}
+
+\begin{document}
+
+⿱木林 㐀 ⻍ 辶  漢 \UTF{FA47}
+
+攏
+
+\UTFM{2FF0}矢口 ⿰矢口
+
+滑  滑
+
+\end{document}