From c7ccd53ca4cdd9cd7771478c59af4d0e775b82e0 Mon Sep 17 00:00:00 2001 From: imiyazaki Date: Fri, 24 Oct 2003 12:43:07 +0000 Subject: [PATCH] add support for kanziku. add Latin Extended-A, Latin Extended-B and IPA Extensions. move CJK Unified Ideographs Extension B routine. --- outCMAP | 51 +++++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/outCMAP b/outCMAP index 38607b0..19a893b 100755 --- a/outCMAP +++ b/outCMAP @@ -25,7 +25,7 @@ my $omegadb_path="/usr/local/lib/chise/omega"; ### Options ### -$opt_order='jtcgk'; +$opt_order='jtcgkh'; $opt_protrude=0;# 1=true, 0=false. ### @@ -130,7 +130,7 @@ $ids=""; "=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"); +@HZK=("=hanziku-1","=hanziku-2","=hanziku-3","=hanziku-4","=hanziku-5","=hanziku-6","=hanziku-7","=hanziku-8","=hanziku-9","=hanziku-10","=hanziku-11","=hanziku-12"); @CDP=("=big5-cdp"); %order=('c'=>'UniCNS', @@ -138,13 +138,13 @@ $ids=""; 'j'=>'UniJIS', 'k'=>'UniKS', 't'=>'GT', -# not implemented yet. -# 'h'=>'HZK', -# 'd'=>'CDP', + 'h'=>'HZK', + # not implemented yet. + # 'd'=>'CDP', ); if(defined($opt_order)){ - if($opt_order=~/^[cgjkt]*$/){ + if($opt_order=~/^[cgjkth]*$/){ @order=split(//,$opt_order); @order=map {$order{$_}} @order; }else{ @@ -176,33 +176,36 @@ while(<>){ if($char_id<=0x20){ print $chars[$i]; next; - }elsif($char_id>0x20 and $char_id<=0xff){ + }elsif($char_id>0x20 and $char_id<=0x02ff){ # Basic Latin # Latin-1 Supplement + # Latin Extended-A + # Latin Extended-B + # IPA Extensions print &latin_parse(); next; }elsif($char_id>=0x2ff0 and $char_id<=0x2fff){ # Ideographic Description Characters print &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]}",&add_break($i); - next; }else{ if(($out_char=&get_output_char($char_id,$out_cs))){ print $out_char,&add_break($i); + }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]}",&add_break($i); + next; }else{ print &get_macro_for_ids(&get_ids($char)),&add_break($i); } @@ -550,7 +553,7 @@ sub get_macro_for_HZK{ } } if($hzk){ - return "{\\fontencoding{OT1}\\fontfamily{".sprintf("hzk%02d",$HZK)."}\\selectfont\\char".($hzk|0x8080)."}"; + return "{\\fontencoding{OT1}\\fontfamily{".sprintf("hzk%02d",$HZK)."}\\selectfont\\char".$hzk."}"; }else{ return undef; } @@ -566,7 +569,7 @@ sub get_macro_for_CDP{ } } if($cdp){ - return "{\\fontencoding{OT1}\\fontfamily{cdp}\\selectfont\\char".($cdp|0x8080)."}"; + return "{\\fontencoding{OT1}\\fontfamily{cdp}\\selectfont\\char".$cdp."}"; }else{ return undef; } -- 1.7.10.4