diff options
Diffstat (limited to 'Master/texmf-dist/source/fonts/japanese-otf-uptex/script/mkutfvf_sp.pl')
-rwxr-xr-x | Master/texmf-dist/source/fonts/japanese-otf-uptex/script/mkutfvf_sp.pl | 55 |
1 files changed, 49 insertions, 6 deletions
diff --git a/Master/texmf-dist/source/fonts/japanese-otf-uptex/script/mkutfvf_sp.pl b/Master/texmf-dist/source/fonts/japanese-otf-uptex/script/mkutfvf_sp.pl index 8392b7b686e..97ea89f2af1 100755 --- a/Master/texmf-dist/source/fonts/japanese-otf-uptex/script/mkutfvf_sp.pl +++ b/Master/texmf-dist/source/fonts/japanese-otf-uptex/script/mkutfvf_sp.pl @@ -43,7 +43,15 @@ my %font_id = qw/1b g 1d h 1e i 1f j &makeunivf; sub makejvf { - foreach $lang ($lang[0]){ #language + foreach $lang ($lang[0]){ #language, japanase + foreach $newjis ('', 'n') { + foreach $face (@face){ #face + $face0 = $face.$newjis; + foreach $dir (@dir){ #direction + &make_ucs_vf_body($face0, $dir, $lang); + } + } + } foreach $face (@face){ #face foreach $dir (@dir){ #direction &makevf_body($face, $dir, $lang); @@ -52,7 +60,12 @@ sub makejvf { } } sub makemlvf { - foreach $lang (@lang[1..$multi]){ #language + foreach $lang (@lang[1..$multi]){ #language, t c k + foreach $face (@face){ #face + foreach $dir (@dir){ #direction + &make_ucs_vf_body($face, $dir, $lang); + } + } foreach $face (@face[0..1]){ #face foreach $dir (@dir){ #direction &makevf_body($face, $dir, $lang); @@ -75,8 +88,8 @@ sub makevf_body { foreach $first_hex (0x1b, 0x1d .. 0x2f) { # U+1Cxxx : not defined yet next if (!$exist_head[$first_hex]); - $HEX = sprintf("%X", $first_hex); - $id = $font_id{sprintf("%x", $first_hex)}; + $HEX = sprintf("%02X", $first_hex); + $id = $font_id{sprintf("%02x", $first_hex)}; warn "now processing (face:$face, dir:$dir, lang:$lang, first_hex:$HEX, ID:$id) ...\n"; $filename="utf$lang$face$id-$dir"; open(OUT, ">ovp/$filename.ovp")||die "$!"; @@ -100,8 +113,8 @@ sub make_uni_vf_body { foreach $first_hex (0x1b, 0x1d .. 0x2f) { # U+1Cxxx : not defined yet next if (!$exist_head[$first_hex]); - $HEX = sprintf("%X", $first_hex); - $id = $font_id{sprintf("%x", $first_hex)}; + $HEX = sprintf("%02X", $first_hex); + $id = $font_id{sprintf("%02x", $first_hex)}; warn "now processing (face:$face, dir:$dir, lang:MULTI, first_hex:$HEX, ID:$id) ...\n"; $filename="utf$face$id-$dir"; open(OUT, ">ovp/$filename.ovp")||die "$!"; @@ -120,6 +133,26 @@ sub make_uni_vf_body { } } +sub make_ucs_vf_body { + my ($face, $dir, $lang)=@_; + + { + $id = '-'; + warn "now processing (face:$face, dir:$dir, lang:$lang, ucs vf, ID:$id) ...\n"; + $filename="utf$lang$face$id-$dir"; + open(OUT, ">ovp/$filename.ovp")||die "$!"; + &fonthead; + print OUT "(MAPFONT D 0\n (FONTNAME otf-u$lang$face-$dir)\n"; + &fontfoot; + &writechar_ucs($dir) if ($lang eq 'j'); + close(OUT); + unless ($debug){ + system("$ovp2ovf ovp/$filename.ovp vf/$filename.vf vf/$filename.ofm"); + unlink "vf/$filename.ofm"; + } + } +} + sub fonthead { print OUT <<END_OF_DATA; (VTITLE JVF for UTF16) @@ -164,3 +197,13 @@ sub writechar { } } } + +sub writechar_ucs { + my ($dir) = @_; + my $wd = $dir eq 'h' ? '0.5' : '1.0'; + foreach $uni (0xFF61 .. 0xFF9F){ + my $uniX = sprintf("%X", $uni); + print OUT "(CHARACTER H $uniX (CHARWD R $wd) (MAP \n"; + print OUT " (SETCHAR H $uniX)))\n"; + } +} |