$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
);
### Options ###
-$opt_order='jtcgkh';
+$opt_order='jcgk';
+#$opt_order='jtcgkhd';
$opt_protrude=0;# 1=true, 0=false.
###
'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{
$i++;
while($i<=$#chars){
$char_id=unpack("U",$chars[$i]);
- if($char_id<=0x02af){
+ if($char_id>0x20 and $char_id<=0x02af){
$out_str.=pack("U",$char_id);
}else{
$i--;
$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')
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')
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')
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')
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')
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')
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')
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')
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;
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,$_)){
}
}
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;
}