diff options
author | Norbert Preining <preining@logic.at> | 2011-11-08 00:22:48 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2011-11-08 00:22:48 +0000 |
commit | 530ce1ac20a99c6e867a595901b5d66c3c85ccc8 (patch) | |
tree | 5046d3fc0451063d10abd34ab83032db75bbd599 /Master/texmf-dist/source/fonts/japanese-otf/script/mkmlcidvf.pl | |
parent | b8e34142e16a40e227b48dff7ad2f8c2d4b8c958 (diff) |
move japanese-otf to better places
git-svn-id: svn://tug.org/texlive/trunk@24538 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/fonts/japanese-otf/script/mkmlcidvf.pl')
-rwxr-xr-x | Master/texmf-dist/source/fonts/japanese-otf/script/mkmlcidvf.pl | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/fonts/japanese-otf/script/mkmlcidvf.pl b/Master/texmf-dist/source/fonts/japanese-otf/script/mkmlcidvf.pl new file mode 100755 index 00000000000..7cb0dd7515a --- /dev/null +++ b/Master/texmf-dist/source/fonts/japanese-otf/script/mkmlcidvf.pl @@ -0,0 +1,114 @@ +#!/usr/bin/perl +opendir(OVP, "ovp") || mkdir("ovp",0755) || die "cannot mkdir ovp"; +opendir(VF, "vf") || mkdir("vf",0755) || die "cannot mkdir vf"; +&makevf; + +sub makevf { + for ($l=1; $l<=3; $l++){ + if ($l==1){$lang="c";$max_hex=7;}elsif ($l==2){$lang="k";$max_hex=4;}elsif ($l==3){$lang="t";$max_hex=4;} + for ($k=0; $k<=1; $k++){#face + if ($k==0) {$face="mr";}elsif ($k==1){$face="gr";} + for ($i=0; $i<=1; $i++){#direction + if ($i==0) {$dir="h";}elsif ($i==1){$dir="v";} + $cidcode=0; + for ($first_hex=0x0; $first_hex <= $max_hex; $first_hex++){ + $filename="cid$lang$face".sprintf("%x",$first_hex)."-$dir"; + open(OUT, ">ovp/$filename.ovp")||die "$!"; + &fonthead; + print OUT " (FONTNAME otf-c$lang$face-$dir)\n"; + &fontfoot; + &writechar; + close(OUT); + system("ovp2ovf ovp/$filename.ovp vf/$filename.vf vf/$filename.ofm"); + unlink "vf/$filename.ofm"; + } + } + } + } +} + +sub fonthead { +if ($lang eq "c"){ + print OUT "(VTITLE JVF for Adobe-GB1-4)\n" +}elsif ($lang eq "t"){ + print OUT "(VTITLE JVF for Adobe-CNS1-4)\n" +}elsif ($lang eq "k"){ + print OUT "(VTITLE JVF for Adobe-Korea1-2)\n" +} +print OUT <<END_OF_DATA; +(OFMLEVEL D 0) +(DESIGNSIZE R 10.000000) +(CHECKSUM O 0) +(MAPFONT D 0 +END_OF_DATA +} + +sub fontfoot { +print OUT <<END_OF_DATA; + (FONTCHECKSUM O 0) + (FONTAT R 1.0) + (FONTDSIZE R 10.000000) + ) +END_OF_DATA +}#2003/10/22 FONTAT 1.0->1.0 +sub printchar { + $jiscode=($_[1]+0x20)*256+($_[2]+0x20); +# &determine_width; + $width=1.0; + printf OUT "(CHARACTER H %X\n", $jiscode; + printf OUT " (CHARWD R %f)\n", $width; + print OUT " (MAP\n"; + printf OUT " (SETCHAR H %X)\n", $cidcode; + if (($dir eq "v")&&($width!=1.0)){ + $correction=1.0-$width; + printf OUT " (MOVERIGHT R -%f)\n", $correction; + } + print OUT " )\n"; + print OUT " )\n"; +} + +sub determine_width{ + if ($lang eq "c"){#simplified chinese + if ($dir eq "h"){ + if ($cidcode==0){$width=0.5;} + }elsif($dir eq "v"){ + if ($cidcode==0){$width=0.5;} + } + }elsif ($lang eq "t"){#traditional chinese + if ($dir eq "h"){ + if ($cidcode==0){$width=0.5;} + }elsif($dir eq "v"){ + if ($cidcode==0){$width=0.5;} + } + }elsif ($lang eq "k"){#korean + if ($dir eq "h"){ + if ($cidcode==0){$width=0.5;} + }elsif($dir eq "v"){ + if ($cidcode==0){$width=0.5;} + } + } + if($width==0){$width=1.0;} +} + +sub printgeta { + $jiscode=($_[1]+0x20)*256+($_[2]+0x20); + printf OUT "(CHARACTER H %X\n", $jiscode; + print OUT " (CHARWD R 1.0)\n"; + print OUT " (MAP\n"; + print OUT " (SETCHAR H 0)\n"; + print OUT " )\n"; + print OUT " )\n"; +} + +sub writechar { + for ($ku=1; $ku <= 79; $ku++){ + for ($ten=1; $ten <= 94; $ten++){ + if ($ku>=16 && $ku<=79 && $ten>=16 && $ten<=79){ + &printchar($first_hex,$ku,$ten); + $cidcode++; + } else { + &printgeta($first_hex,$ku,$ten); + } + } + } +} |