summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/fonts
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/fonts')
-rwxr-xr-xMaster/texmf-dist/source/fonts/japanese-otf/script/umkcidtfm.pl221
-rwxr-xr-xMaster/texmf-dist/source/fonts/japanese-otf/script/umkcidvf.pl160
-rwxr-xr-xMaster/texmf-dist/source/fonts/japanese-otf/umakeotf4
3 files changed, 385 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/fonts/japanese-otf/script/umkcidtfm.pl b/Master/texmf-dist/source/fonts/japanese-otf/script/umkcidtfm.pl
new file mode 100755
index 00000000000..6f830a329ca
--- /dev/null
+++ b/Master/texmf-dist/source/fonts/japanese-otf/script/umkcidtfm.pl
@@ -0,0 +1,221 @@
+#!/usr/bin/perl -s
+
+=head1 NAME
+
+umkcidtfm.pl
+
+=head1 USAGE
+
+script/umkcidtfm.pl
+script/umkcidtfm.pl -debug
+
+=head1 NOTE
+
+This software is a part of japanese-otf-uptex.
+
+=cut
+
+opendir(PL, "pl") || mkdir("pl",0755) || die "cannot mkdir pl";
+opendir(TFM, "tfm") || mkdir("tfm",0755) || die "cannot mkdir tfm";
+&make_cid_tfm;
+&make_cid_dvips_tfm;
+
+sub make_cid_tfm {
+ my ($lang, $face, $dir, $id, $filename);
+ foreach $lang (qw/j c k t/){#lang
+ foreach $dir (qw/h v/){#direction
+ $id='-';
+ $pl_name="cid$lang$id-$dir";
+ open(OUT, '>', "pl/$pl_name.pl")||die "$!";
+ &fonthead($lang,$dir);
+ &writechar($lang,$dir);
+ &fontfoot($lang,$dir);
+ close(OUT);
+ foreach $face (qw/mr gr mb gb mgr ml ge/){#face
+ $tfm_name="cid$lang$face$id-$dir";
+ system("uppltotf -kanji=uptex pl/$pl_name.pl tfm/$tfm_name.tfm");
+ }
+ unless ($debug){
+ unlink "pl/$pl_name.pl";
+ }
+ }
+ }
+}
+
+sub make_cid_dvips_tfm {
+ my ($lang, $face, $dir, $id, $filename);
+ foreach $lang (qw/j c k t/){#lang
+ foreach $dir (qw/h v/){#direction
+ $pl_name="otf-c$lang-$dir";
+ open(OUT, '>', "pl/$pl_name.pl")||die "$!";
+ &fonthead_dvips($lang,$dir);
+ &writechar($lang,$dir);
+ &fontfoot($lang,$dir);
+ close(OUT);
+ foreach $face (qw/mr gr mb gb mgr ml ge/){#face
+ $tfm_name="otf-c$lang$face-$dir";
+ system("uppltotf -kanji=uptex pl/$pl_name.pl tfm/$tfm_name.tfm");
+ }
+ unless ($debug){
+ unlink "pl/$pl_name.pl";
+ }
+ }
+ }
+}
+
+sub fonthead {
+ my ($lang,$dir) = @_;
+print OUT <<END_OF_DATA if ($dir eq 'v');
+(DIRECTION TATE)
+END_OF_DATA
+print OUT <<END_OF_DATA;
+(FAMILY OTF KANJI)
+(FACE F MRR)
+(CODINGSCHEME TEX KANJI TEXT)
+(DESIGNSIZE R 10.0)
+(CHECKSUM O 0)
+(SEVENBITSAFEFLAG TRUE)
+(FONTDIMEN
+ (SLANT R 0.0)
+ (SPACE R 0.0)
+ (STRETCH R 0.1)
+ (SHRINK R 0.0)
+ (XHEIGHT R 1.0)
+ (QUAD R 1.0)
+ (EXTRASPACE R 0.25)
+ (EXTRASTRETCH R 0.2)
+ (EXTRASHRINK R 0.125)
+ )
+END_OF_DATA
+}
+
+sub fonthead_dvips {
+ my ($lang,$dir) = @_;
+print OUT <<END_OF_DATA if ($dir eq 'v');
+(DIRECTION TATE)
+END_OF_DATA
+print OUT <<END_OF_DATA;
+(FAMILY OTF KANJI)
+(FACE F MRR)
+(CODINGSCHEME TEX KANJI TEXT)
+(DESIGNSIZE R 10.0)
+(CHECKSUM O 0)
+(SEVENBITSAFEFLAG TRUE)
+(FONTDIMEN
+ (SLANT R 0.0)
+ (SPACE R 0.0)
+ (STRETCH R 0.0)
+ (SHRINK R 0.0)
+ (XHEIGHT R 1.0)
+ (QUAD R 1.0)
+ (EXTRASPACE R 0.0)
+ (EXTRASTRETCH R 0.0)
+ (EXTRASHRINK R 0.0)
+ )
+END_OF_DATA
+}
+
+sub fontfoot {
+ my ($lang,$dir) = @_;
+ my ($ht,$dp) = $dir eq 'h' ? (0.88, 0.12) : (0.5, 0.5);
+print OUT <<END_OF_DATA;
+(TYPE O 0
+ (CHARWD R 1.0)
+ (CHARHT R $ht)
+ (CHARDP R $dp)
+ )
+(TYPE O 1
+ (CHARWD R 0.5)
+ (CHARHT R $ht)
+ (CHARDP R $dp)
+ )
+END_OF_DATA
+print OUT <<END_OF_DATA if ($lang eq 'j');
+(TYPE O 2
+ (CHARWD R 0.25)
+ (CHARHT R $ht)
+ (CHARDP R $dp)
+ )
+(TYPE O 3
+ (CHARWD R 0.333333)
+ (CHARHT R $ht)
+ (CHARDP R $dp)
+ )
+END_OF_DATA
+}
+
+sub writechar {
+ my ($lang, $dir) = @_;
+ my (@type_1ov2, @type_1ov3, @type_1ov4);
+
+ if ($lang eq "j") { # Adobe-Japan1-7
+ if ($dir eq "h") {
+ @type_1ov2 = (231 .. 632, 8718, 8719, 12063 .. 12087);
+ @type_1ov4 = (9738 .. 9757);
+ @type_1ov3 = (9758 .. 9778);
+ }
+ if ($dir eq "v") {
+ @type_1ov2 = (8950 .. 9353, 10185 .. 10195, 13295 .. 13319);
+ @type_1ov4 = (13254 .. 13273);
+ @type_1ov3 = (13274 .. 13294);
+ }
+ }
+ if ($lang eq "c") { # Adobe-GB1-5
+ if ($dir eq "h") {
+ @type_1ov2 = (814 .. 939, 7716, 22355 .. 22357);
+ }
+ if ($dir eq "v") {
+ @type_1ov2 = (22226 .. 22352, 29060 .. 29063);
+ }
+ }
+ if ($lang eq "k") { # Adobe-Korea1-2
+ if ($dir eq "h") {
+ @type_1ov2 = (8094 .. 8190);
+ }
+ if ($dir eq "v") {
+ @type_1ov2 = (18255 .. 18351);
+ }
+ }
+ if ($lang eq "t") { # Adobe-CNS1-7
+ if ($dir eq "h") {
+ @type_1ov2 = (13648 .. 13742, 17603);
+ }
+ if ($dir eq "v") {
+ @type_1ov2 = (17506 .. 17600, 17605);
+ }
+ }
+
+ if (@type_1ov2) {
+ print OUT "(CHARSINTYPE O 1\n";
+ my ($i)=0;
+ for $cid (@type_1ov2) {
+ print OUT " " if ($i % 16 == 0);
+ printf OUT " U %04X", $cid;
+ print OUT "\n" if ($i % 16 == 15);
+ $i++;
+ }
+ print OUT "\n )\n";
+ }
+ if (@type_1ov4) {
+ print OUT "(CHARSINTYPE O 2\n";
+ my ($i)=0;
+ for $cid (@type_1ov4) {
+ print OUT " " if ($i % 16 == 0);
+ printf OUT " U %04X", $cid;
+ print OUT "\n" if ($i % 16 == 15);
+ $i++;
+ }
+ print OUT "\n )\n";
+ }
+ if (@type_1ov3) {
+ print OUT "(CHARSINTYPE O 3\n";
+ my ($i)=0;
+ for $cid (@type_1ov3) {
+ print OUT " " if ($i % 16 == 0);
+ printf OUT " U %04X", $cid;
+ print OUT "\n" if ($i % 16 == 15);
+ $i++;
+ }
+ print OUT "\n )\n";
+ }
+}
diff --git a/Master/texmf-dist/source/fonts/japanese-otf/script/umkcidvf.pl b/Master/texmf-dist/source/fonts/japanese-otf/script/umkcidvf.pl
new file mode 100755
index 00000000000..9cc6e11e1da
--- /dev/null
+++ b/Master/texmf-dist/source/fonts/japanese-otf/script/umkcidvf.pl
@@ -0,0 +1,160 @@
+#!/usr/bin/perl -s
+
+=head1 NAME
+
+umkcidvf.pl
+
+=head1 USAGE
+
+script/umkcidvf.pl
+script/umkcidvf.pl -omitfw
+script/umkcidvf.pl -debug
+
+=head1 NOTE
+
+This software is a part of japanese-otf-uptex.
+
+=cut
+
+opendir(OVP, "ovp") || mkdir("ovp",0755) || die "cannot mkdir ovp";
+opendir(VF, "vf") || mkdir("vf",0755) || die "cannot mkdir vf";
+my %adobe_name = (
+ 'j' => 'Adobe-Japan1-7',
+ 'c' => 'Adobe-GB1-5',
+ 'k' => 'Adobe-Korea1-2',
+ 't' => 'Adobe-CNS1-7'
+);
+&make_new_vf;
+
+sub make_new_vf {
+ my ($lang, $face, $dir, $id, $filename);
+ foreach $lang (qw/j c k t/){#lang
+ foreach $face (qw/mr gr mb gb mgr ml ge/){#face
+ foreach $dir (qw/h v/){#direction
+ $id='-';
+ $filename="cid$lang$face$id-$dir";
+ open(OUT, '>', "ovp/$filename.ovp")||die "$!";
+ &writefont($lang,"otf-c$lang$face-$dir");
+ &writechar_cid($lang,$dir);
+ close(OUT);
+ unless ($debug){
+ system("ovp2ovf ovp/$filename.ovp vf/$filename.vf vf/$filename.ofm");
+ unlink "vf/$filename.ofm";
+ }
+ }
+ }
+ }
+}
+
+sub writefont {
+ my ($lang,$name)=@_;
+print OUT <<END_OF_DATA;
+(VTITLE JVF for $adobe_name{$lang})
+(OFMLEVEL D 0)
+(DESIGNSIZE R 10.000000)
+(CHECKSUM O 0)
+(MAPFONT D 0
+ (FONTNAME $name)
+ (FONTCHECKSUM O 0)
+ (FONTAT R 1.0)
+ (FONTDSIZE R 10.000000)
+ )
+END_OF_DATA
+}
+
+sub writechar_cid {
+ my ($lang, $dir) = @_;
+ my ($cidcode, $width, $correction);
+ my ($maxcidcode);
+ if ($lang eq "j") {
+ $maxcidcode = 23059;
+ } elsif ($lang eq "c") {
+ $maxcidcode = 30283;
+ } elsif ($lang eq "k") {
+ $maxcidcode = 18351;
+ } elsif ($lang eq "t") {
+ $maxcidcode = 19178;
+ } else {
+ die "unexpected input!";
+ }
+ foreach $cidcode (0 .. $maxcidcode){
+ $width=1.0;
+ if ($lang eq "j") { # Adobe-Japan1-7
+ if ($dir eq "h") {
+ if (($cidcode >= 231 && $cidcode <= 632)
+ || $cidcode == 8718 || $cidcode == 8719
+ || (12063 <= $cidcode && $cidcode <= 12087)){
+ $width=0.5;
+ }elsif(9738 <= $cidcode && $cidcode <= 9757){
+ $width=0.25;
+ }elsif(9758 <= $cidcode && $cidcode <= 9778){
+ $width=0.333333;
+ }
+ }
+ if ($dir eq "v") {
+ if ((8950 <= $cidcode && $cidcode <= 9353)
+ || (10185 <= $cidcode && $cidcode <= 10195)
+ || (13295 <= $cidcode && $cidcode <= 13319)){
+ $width=0.5;
+ }elsif(13254 <= $cidcode && $cidcode <= 13273){
+ $width=0.25;
+ }elsif(13274 <= $cidcode && $cidcode <= 13294){
+ $width=0.333333;
+ }
+ }
+ }
+ if ($lang eq "c") { # Adobe-GB1-5
+ if ($dir eq "h") {
+ if (($cidcode >= 814 && $cidcode <= 939)
+ || $cidcode == 7716
+ || (22355 <= $cidcode && $cidcode <= 22357)){
+ $width=0.5;
+ }
+ }
+ if ($dir eq "v") {
+ if ((22226 <= $cidcode && $cidcode <= 22352)
+ || (29060 <= $cidcode && $cidcode <= 29063)){
+ $width=0.5;
+ }
+ }
+ }
+ if ($lang eq "k") { # Adobe-Korea1-2
+ if ($dir eq "h") {
+ if (8094 <= $cidcode && $cidcode <= 8190){
+ $width=0.5;
+ }
+ }
+ if ($dir eq "v") {
+ if (18255 <= $cidcode && $cidcode <= 18351){
+ $width=0.5;
+ }
+ }
+ }
+ if ($lang eq "t") { # Adobe-CNS1-7
+ if ($dir eq "h") {
+ if (($cidcode >= 13648 && $cidcode <= 13742)
+ || $cidcode == 17603 ){
+ $width=0.5;
+ }
+ }
+ if ($dir eq "v") {
+ if (($cidcode >= 17506 && $cidcode <= 17600)
+ || $cidcode == 17605 ){
+ $width=0.5;
+ }
+ }
+ }
+ next if ($width==1.0 && defined($omitfw));
+
+ printf OUT "(CHARACTER H %X\n", $cidcode;
+ 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";
+ }
+}
diff --git a/Master/texmf-dist/source/fonts/japanese-otf/umakeotf b/Master/texmf-dist/source/fonts/japanese-otf/umakeotf
index d675f106d20..bff6a2e29eb 100755
--- a/Master/texmf-dist/source/fonts/japanese-otf/umakeotf
+++ b/Master/texmf-dist/source/fonts/japanese-otf/umakeotf
@@ -98,6 +98,10 @@ echo "making tfm for supplementary plane ..."
perl script/mktfm_sp.pl
echo "making vf for supplementary plane ..."
perl script/mkutfvf_sp.pl
+echo "making new tfm for CID ..."
+perl script/umkcidtfm.pl
+echo "making new vf for CID ..."
+perl script/umkcidvf.pl -omitfw
echo "finishing ..."