my $slightly_forbidden_before
= '\x{000a}\#\-‐−‰′″℃゛゜ゝゞヽヾ"%-゙゚';
-my $asian = '\x{1100}-\x{11FF}\x{2E80}-\x{D7AF}\x{F900}-\x{FAFF}\x{FE30}-\x{FE4F}\x{FF00}-\x{FFFFFF}';
+my $asian = '\x{1100}-\x{11FF}\x{2E80}-\x{D7AF}\x{F900}-\x{FAFF}\x{FE30}-\x{FE4F}\x{FF00}-\x{FFFFFF}'; # need to fix.
my $space = '\x{0020}\x{0009}\x{000A}\x{000C}\x{000D}';
while(<>){
utf8::decode($_);
+
+ s/([$asian])\s+([$asian])/$1$2/g unless($out_cs eq 'UniKS');
+ s/([$asian])\s*([^$asian])/$1 $2/g;
+ s/([^$asian])\s*([$asian])/$1 $2/g;
if($in_cs ne 'ucs@mcs'){
s/(.)/&get_char_in_mcs($1,$in_cs)/ge;
}
$char_id=unpack("U",$char);
if($char_id<=0x20){
- print $chars[$i];
+ # add quarter space between asian and non-asian.
+ if($i>0 and $i<$#chars){
+ if((($chars[$i-1]=~/[$asian]/)
+ and($chars[$i+1]=~/[^$asian]/))
+ or(($chars[$i-1]=~/[^$asian]/)
+ and($chars[$i+1]=~/[$asian]/))){
+ print '{\selectjisfont\hspace{.25ex}}';
+ }else{
+ print " ";
+ }
+ }
next CHAR;
}elsif($char=~m/($tex_meta_re)/o){
print $tex_meta{$1};
}
}
if(($i<$#chars)
+ and($chars[$i+1]eq" ")){
+ # preserve space.
+ return "";
+ }
+ if(($i<$#chars)
and($chars[$i+1]=~m/[$strictly_forbidden_before]/o)){
return "\\CJKunbreakablekernone ";
}