X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=outCMAP;h=dd9411dbe86998d47fe2c6c95265bac8db3ed31d;hb=c3c84854ca6c922d09cb5cde53fcd13365bd7b0d;hp=19a893bff8ffe39b841651544fbfd151a936dbdd;hpb=c7ccd53ca4cdd9cd7771478c59af4d0e775b82e0;p=chise%2Fomega.git diff --git a/outCMAP b/outCMAP index 19a893b..dd9411d 100755 --- a/outCMAP +++ b/outCMAP @@ -12,7 +12,6 @@ use vars qw($omegadb_path $char $char_id $out_char $ids $ids_argc %ids $idsdb $idsdata_file $ids_start $font_start - %utf8mcs_map_from $inotp $perl56 $perl58 @CDP @HZK @GT ); @@ -25,7 +24,8 @@ my $omegadb_path="/usr/local/lib/chise/omega"; ### Options ### -$opt_order='jtcgkh'; +$opt_order='jcgk'; +#$opt_order='jtcgkhd'; $opt_protrude=0;# 1=true, 0=false. ### @@ -139,12 +139,11 @@ $ids=""; 'k'=>'UniKS', 't'=>'GT', 'h'=>'HZK', - # not implemented yet. - # 'd'=>'CDP', + 'd'=>'CDP', ); if(defined($opt_order)){ - if($opt_order=~/^[cgjkth]*$/){ + if($opt_order=~/^[cgjkthd]*$/){ @order=split(//,$opt_order); @order=map {$order{$_}} @order; }else{ @@ -176,7 +175,7 @@ while(<>){ if($char_id<=0x20){ print $chars[$i]; next; - }elsif($char_id>0x20 and $char_id<=0x02ff){ + }elsif($char_id>0x20 and $char_id<=0x02af){ # Basic Latin # Latin-1 Supplement # Latin Extended-A @@ -207,7 +206,11 @@ while(<>){ "}\\selectfont\\char$ids{$char}[1]}",&add_break($i); next; }else{ - print &get_macro_for_ids(&get_ids($char)),&add_break($i); + if($ids=&get_ids($char)){ + print &get_macro_for_ids($ids),&add_break($i); + }else{ + print '\rule{1ex}{1ex}',&add_break($i); + } } } } @@ -277,7 +280,7 @@ sub latin_parse{ $i++; while($i<=$#chars){ $char_id=unpack("U",$chars[$i]); - if($char_id<=0xff){ + if($char_id>0x20 and $char_id<=0x02af){ $out_str.=pack("U",$char_id); }else{ $i--; @@ -393,7 +396,7 @@ sub get_output_char{ $char=pack('U',$char_id); if($out_cs eq 'UniJIS' - and &get_char_attribute($char,"adobe-unijis-utf16-h")){ + and &get_char_attribute($char,"vnd-adobe-cid-unijis-utf16-h")){ if($out_char_id=&get_char_attribute($char,'=ucs@jis') or $out_char_id=&get_char_attribute($char,'=ucs') or $out_char_id=&get_char_attribute($char,'=>ucs@jis') @@ -402,7 +405,7 @@ sub get_output_char{ return pack("U",$out_char_id); } }elsif($out_cs eq 'UniGB' - and &get_char_attribute($char,"adobe-unigb-ucs2-h")){ + and &get_char_attribute($char,"vnd-adobe-cid-unigb-ucs2-h")){ if($out_char_id=&get_char_attribute($char,'=ucs@gb') or $out_char_id=&get_char_attribute($char,'=ucs') or $out_char_id=&get_char_attribute($char,'=>ucs@gb') @@ -411,7 +414,7 @@ sub get_output_char{ return pack("U",$out_char_id); } }elsif($out_cs eq 'UniCNS' - and &get_char_attribute($char,"adobe-unicns-ucs2-h")){ + and &get_char_attribute($char,"vnd-adobe-cid-unicns-ucs2-h")){ if($out_char_id=&get_char_attribute($char,'=ucs@cns') or $out_char_id=&get_char_attribute($char,'=ucs') or $out_char_id=&get_char_attribute($char,'=>ucs@cns') @@ -420,7 +423,7 @@ sub get_output_char{ return pack("U",$out_char_id); } }elsif($out_cs eq 'UniKS' - and &get_char_attribute($char,"adobe-uniks-ucs2-h")){ + and &get_char_attribute($char,"vnd-adobe-cid-uniks-ucs2-h")){ if($out_char_id=&get_char_attribute($char,'=ucs@ks') or $out_char_id=&get_char_attribute($char,'=ucs') or $out_char_id=&get_char_attribute($char,'=>ucs@ks') @@ -432,7 +435,7 @@ sub get_output_char{ foreach $out_cs (@order){ if($out_cs eq 'UniJIS' - and &get_char_attribute($char,"adobe-unijis-utf16-h")){ + and &get_char_attribute($char,"vnd-adobe-cid-unijis-utf16-h")){ if($out_char_id=&get_char_attribute($char,'=ucs@jis') or $out_char_id=&get_char_attribute($char,'=ucs') or $out_char_id=&get_char_attribute($char,'=>ucs@jis') @@ -441,7 +444,7 @@ sub get_output_char{ return '{\selectjisfont\char'.$out_char_id.'}'; } }elsif($out_cs eq 'UniGB' - and &get_char_attribute($char,"adobe-unigb-ucs2-h")){ + and &get_char_attribute($char,"vnd-adobe-cid-unigb-ucs2-h")){ if($out_char_id=&get_char_attribute($char,'=ucs@gb') or $out_char_id=&get_char_attribute($char,'=ucs') or $out_char_id=&get_char_attribute($char,'=>ucs@gb') @@ -450,7 +453,7 @@ sub get_output_char{ return '{\selectgbsfont\char'.$out_char_id.'}'; } }elsif($out_cs eq 'UniCNS' - and &get_char_attribute($char,"adobe-unicns-ucs2-h")){ + and &get_char_attribute($char,"vnd-adobe-cid-unicns-ucs2-h")){ if($out_char_id=&get_char_attribute($char,'=ucs@cns') or $out_char_id=&get_char_attribute($char,'=ucs') or $out_char_id=&get_char_attribute($char,'=>ucs@cns') @@ -459,7 +462,7 @@ sub get_output_char{ return '{\selectcnsfont\char'.$out_char_id.'}'; } }elsif($out_cs eq 'UniKS' - and &get_char_attribute($char,"adobe-uniks-ucs2-h")){ + and &get_char_attribute($char,"vnd-adobe-cid-uniks-ucs2-h")){ if($out_char_id=&get_char_attribute($char,'=ucs@ks') or $out_char_id=&get_char_attribute($char,'=ucs') or $out_char_id=&get_char_attribute($char,'=>ucs@ks') @@ -485,8 +488,8 @@ sub get_ids{ my($char)=@_; my $ids=""; $ids=&get_char_attribute($char,"ids-aggregated") - or &get_char_attribute($char,"ids"); -# or &get_char_attribute($char,"ideographic-structure"); + or $ids=&get_char_attribute($char,"ids"); +# or $ids=&get_char_attribute($char,"ideographic-structure"); $ids=decode('utf8', $ids) if($perl58); # $ids=~s/[? ()]//g; return $ids; @@ -561,7 +564,7 @@ sub get_macro_for_HZK{ sub get_macro_for_CDP{ my($char_id)=@_; - my($char,$cdp); + my($char,$cdp,$ucs); $char=pack("U",$char_id); foreach (@CDP){ if($cdp=&get_char_attribute($char,$_)){ @@ -569,7 +572,15 @@ sub get_macro_for_CDP{ } } if($cdp){ - return "{\\fontencoding{OT1}\\fontfamily{cdp}\\selectfont\\char".$cdp."}"; + $ucs=&get_char_attribute(&get_chars_matching("=big5-pua",$cdp),"=ucs"); + if($ucs){ + return "{\\fontencoding{OT1}\\fontfamily{cdp}\\selectfont\\char" + .$ucs. + "}"; + }else{ + print STDERR "This hould not happen.\n"; + print STDERR "ucs code point of CDP: $cdp not found.\n"; + } }else{ return undef; }