summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-01-15 22:58:54 +0000
committerKarl Berry <karl@freefriends.org>2016-01-15 22:58:54 +0000
commita4196ac5e752b04120d468dc9960cf9e109b65e5 (patch)
treeb3d8b587e7b46ca03038644cbd0feee908ecbd2f /Master
parent4aa4a8acd5997703cf6bd250eee1fd45c5430790 (diff)
cjk-gs-integrate (15jan16)
git-svn-id: svn://tug.org/texlive/trunk@39391 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/fonts/cjk-gs-integrate/ChangeLog64
-rw-r--r--Master/texmf-dist/doc/fonts/cjk-gs-integrate/README.md (renamed from Master/texmf-dist/doc/fonts/cjk-gs-integrate/README)0
-rw-r--r--Master/texmf-dist/doc/fonts/cjk-gs-integrate/macosx-filelist45
-rwxr-xr-xMaster/texmf-dist/doc/fonts/cjk-gs-integrate/tools/release.sh3
-rwxr-xr-xMaster/texmf-dist/scripts/cjk-gs-integrate/cjk-gs-integrate.pl155
5 files changed, 176 insertions, 91 deletions
diff --git a/Master/texmf-dist/doc/fonts/cjk-gs-integrate/ChangeLog b/Master/texmf-dist/doc/fonts/cjk-gs-integrate/ChangeLog
index c973e827363..67676d5c93d 100644
--- a/Master/texmf-dist/doc/fonts/cjk-gs-integrate/ChangeLog
+++ b/Master/texmf-dist/doc/fonts/cjk-gs-integrate/ChangeLog
@@ -1,6 +1,66 @@
+2016-01-15 Norbert Preining <norbert@preining.info>
+
+ * Release 20160115.0 (HEAD -> master) [bfb2c76]
+
+2016-01-15 Norbert Preining <norbert@preining.info>
+
+ * ship README.md as is, supported by CTAN now [ad27d2b]
+
+2016-01-15 Norbert Preining <norbert@preining.info>
+
+ * remove unrelated file [5f10f56]
+
+2016-01-15 Norbert Preining <norbert@preining.info>
+
+ * Release 20160115.0 [5a42230]
+
+2016-01-14 Norbert Preining <norbert@preining.info>
+
+ * if --link-texmf is passed without argument use TEXMFLOCAL again (origin/master, origin/HEAD) [a4a8228]
+
+2015-10-21 Norbert Preining <norbert@preining.info>
+
+ * remove cleanup_link and bruteforce [1f9649d]
+
+2015-10-21 Norbert Preining <norbert@preining.info>
+
+ * fix TTFONT env name [2eee0ce]
+
+2015-10-20 Norbert Preining <norbert@preining.info>
+
+ * resolve symlinks to make sure we don't catch the wrong files [9f68007]
+
+2015-10-20 Norbert Preining <norbert@preining.info>
+
+ * put OSFONTDIR before OPENTYPEFONTS and TTFFONTS [c28684d]
+
+2015-10-19 Norbert Preining <norbert@preining.info>
+
+ * fix problems with links pointing to itself [76e5f82]
+
+2015-10-19 Norbert Preining <norbert@preining.info>
+
+ * fix name of otf font links in texmf dir [0fc6e58]
+
+2015-10-11 Norbert Preining <norbert@preining.info>
+
+ * rework link_font to warn only if necessary [c2b986d]
+
+2015-10-11 Norbert Preining <norbert@preining.info>
+
+ * remove end-of-lines of gs output [157a150]
+
+2015-10-10 Norbert Preining <norbert@preining.info>
+
+ * better extraction of gs resource (Issue: #6) [c01d79e]
+
+2015-10-10 Norbert Preining <norbert@preining.info>
+
+ * list other candidates for --list-fonts and --info [bb03240]
+
2015-10-02 Norbert Preining <norbert@preining.info>
- * Release 20151002.0 (HEAD -> master) [0cab259]
+ * Release 20151002.0 (tag: 20151002.0) [0cab259]
2015-10-02 Norbert Preining <norbert@preining.info>
@@ -8,7 +68,7 @@
2015-09-28 Norbert Preining <norbert@preining.info>
- * update README.md for current status (origin/master, origin/HEAD) [789f124]
+ * update README.md for current status [789f124]
2015-09-28 Norbert Preining <norbert@preining.info>
diff --git a/Master/texmf-dist/doc/fonts/cjk-gs-integrate/README b/Master/texmf-dist/doc/fonts/cjk-gs-integrate/README.md
index 8742f2d890f..8742f2d890f 100644
--- a/Master/texmf-dist/doc/fonts/cjk-gs-integrate/README
+++ b/Master/texmf-dist/doc/fonts/cjk-gs-integrate/README.md
diff --git a/Master/texmf-dist/doc/fonts/cjk-gs-integrate/macosx-filelist b/Master/texmf-dist/doc/fonts/cjk-gs-integrate/macosx-filelist
deleted file mode 100644
index 1dcba5e404e..00000000000
--- a/Master/texmf-dist/doc/fonts/cjk-gs-integrate/macosx-filelist
+++ /dev/null
@@ -1,45 +0,0 @@
-/Library/Fonts/Yu Mincho Medium.otf
-/Library/Fonts/Yu Mincho Demibold.otf
-/Library/Fonts/Yu Gothic Medium.otf
-/Library/Fonts/Yu Gothic Bold.otf
-/System/Library/Fonts/ヒラギノ明朝 ProN W6.otf
-/System/Library/Fonts/ヒラギノ明朝 ProN W3.otf
-/Library/Fonts/ヒラギノ明朝 Pro W6.otf
-/Library/Fonts/ヒラギノ明朝 Pro W3.otf
-/Library/Fonts/ヒラギノ丸ゴ ProN W4.otf
-/Library/Fonts/ヒラギノ丸ゴ Pro W4.otf
-/Library/Fonts/ヒラギノ角ゴ StdN W8.otf
-/Library/Fonts/ヒラギノ角ゴ Std W8.otf
-/System/Library/Fonts/ヒラギノ角ゴ ProN W6.otf
-/System/Library/Fonts/ヒラギノ角ゴ ProN W3.otf
-/Library/Fonts/ヒラギノ角ゴ Pro W6.otf
-/Library/Fonts/ヒラギノ角ゴ Pro W3.otf
-/Library/Fonts/Hiragino Sans GB W6.otf
-/Library/Fonts/Hiragino Sans GB W3.otf
-/Library/Fonts/AppleSDGothicNeo-UltraLight.otf
-/Library/Fonts/AppleSDGothicNeo-Thin.otf
-/Library/Fonts/AppleSDGothicNeo-SemiBold.otf
-/System/Library/Fonts/AppleSDGothicNeo-Regular.otf
-/Library/Fonts/AppleSDGothicNeo-Medium.otf
-/Library/Fonts/AppleSDGothicNeo-Light.otf
-/Library/Fonts/AppleSDGothicNeo-Heavy.otf
-/Library/Fonts/AppleSDGothicNeo-ExtraBold.otf
-/System/Library/Fonts/AppleSDGothicNeo-Bold.otf
-/Library/Fonts/华文细黑.ttf
-/Library/Fonts/华文黑体.ttf
-/System/Library/Fonts/STHeiti Medium.ttc
-/System/Library/Fonts/STHeiti Light.ttc
-/Library/Fonts/华文仿宋.ttf
-/Library/Fonts/Songti.ttc
-/Library/Fonts/NanumScript.ttc
-/Library/Fonts/NanumMyeongjo.ttc
-/Library/Fonts/NanumGothic.ttc
-/Library/Fonts/儷宋 Pro.ttf
-/Library/Fonts/儷黑 Pro.ttf
-/Library/Fonts/Kaiti.ttc
-/Library/TeX/Root/texmf-dist/fonts/truetype/public/ipaex/ipam.ttf
-/Library/TeX/Root/texmf-dist/fonts/truetype/public/ipaex/ipag.ttf
-/Library/TeX/Root/texmf-dist/fonts/truetype/public/ipaex/ipaexm.ttf
-/Library/TeX/Root/texmf-dist/fonts/truetype/public/ipaex/ipaexg.ttf
-/Library/Fonts/AppleMyungjo.ttf
-/Library/Fonts/AppleGothic.ttf
diff --git a/Master/texmf-dist/doc/fonts/cjk-gs-integrate/tools/release.sh b/Master/texmf-dist/doc/fonts/cjk-gs-integrate/tools/release.sh
index 4ca8afc93c3..7871fba69de 100755
--- a/Master/texmf-dist/doc/fonts/cjk-gs-integrate/tools/release.sh
+++ b/Master/texmf-dist/doc/fonts/cjk-gs-integrate/tools/release.sh
@@ -37,7 +37,8 @@ for i in cjk-gs-integrate.pl ; do
rm -f ${i}.bak
done
# rename README.md to README for CTAN
-mv README.md README
+# not necessary anymore, README.md is acceptable
+#mv README.md README
cd ..
diff -urN $PROJECT-$VER-orig $PROJECT-$VER
tar zcf $DIR/$PROJECT-$VER.tar.gz $PROJECT-$VER
diff --git a/Master/texmf-dist/scripts/cjk-gs-integrate/cjk-gs-integrate.pl b/Master/texmf-dist/scripts/cjk-gs-integrate/cjk-gs-integrate.pl
index 7641cbcb26b..5a8abcd471d 100755
--- a/Master/texmf-dist/scripts/cjk-gs-integrate/cjk-gs-integrate.pl
+++ b/Master/texmf-dist/scripts/cjk-gs-integrate/cjk-gs-integrate.pl
@@ -23,10 +23,11 @@ $^W = 1;
use Getopt::Long qw(:config no_autoabbrev ignore_case_always);
use File::Basename;
use File::Path qw(make_path);
+use Cwd 'abs_path';
use strict;
(my $prg = basename($0)) =~ s/\.pl$//;
-my $version = '20151002.0';
+my $version = '20160115.0';
if (win32()) {
print_error("Sorry, currently not supported on Windows!\n");
@@ -216,6 +217,12 @@ my %encode_list = (
UniKS-UTF8-H
UniKS-UTF8-V/ ] );
+#
+# location where links to fonts in texmf are created, relative to TEXMF
+my $otf_pathpart = "fonts/opentype/cjk-gs-integrate";
+my $ttf_pathpart = "fonts/truetype/cjk-gs-integrate";
+
+
my $dry_run = 0;
my $opt_help = 0;
my $opt_quiet = 0;
@@ -289,7 +296,6 @@ if (defined($opt_texmflink)) {
$opt_texmflink = $foo;
}
-
main(@ARGV);
#
@@ -451,7 +457,7 @@ sub do_otf_fonts {
my $ciddest = "$opt_output/CIDFont";
make_dir($fontdest, "cannot create CID snippets there!");
make_dir($ciddest, "cannot link CID fonts there!");
- make_dir("$opt_texmflink/fonts/opentype/cjk-gs-integrate",
+ make_dir("$opt_texmflink/$otf_pathpart",
"cannot link fonts to it!")
if $opt_texmflink;
for my $k (keys %fontdb) {
@@ -459,7 +465,7 @@ sub do_otf_fonts {
generate_font_snippet($fontdest,
$k, $fontdb{$k}{'class'}, $fontdb{$k}{'target'});
link_font($fontdb{$k}{'target'}, $ciddest, $k);
- link_font($fontdb{$k}{'target'}, "$opt_texmflink/fonts/opentype/cjk-gs-integrate")
+ link_font($fontdb{$k}{'target'}, "$opt_texmflink/$otf_pathpart", "$k.otf")
if $opt_texmflink;
}
}
@@ -491,6 +497,35 @@ pop
}
}
+#
+# link_font operation
+# $opt_force is *not* treated first to warn only
+# at really critical cases
+# case 1:
+# exists, is link, link targets agree
+# $opt_force is ignored
+# remove or remove+add according to $opt_remove
+# case 2:
+# exists, is link, dangling symlink
+# $opt_force is ignored
+# remove or remove+add according to $opt_remove
+# case 3:
+# exists, is link, link target different
+# if $opt_force
+# warn, remove or remove+add according to $opt_remove
+# else
+# error message
+# case 4:
+# exists, not a link
+# if $opt_force
+# warn, remove or remove+add according to $opt_remove
+# else
+# error message
+# case 5:
+# not exists
+# $opt_force is ignored
+# do nothing or add according to $opt_remove
+#
sub link_font {
my ($f, $cd, $n) = @_;
return if $dry_run;
@@ -498,36 +533,47 @@ sub link_font {
$n = basename($f);
}
my $target = "$cd/$n";
- if ($opt_force && -e $target) {
- print_info("Removing $target prior to recreation due to --force\n");
- unlink($target) || die "Cannot unlink $target prior to recreation under --force: $!";
- return if $opt_remove;
- }
+ my $do_unlink = 0;
if (-l $target) {
my $linkt = readlink($target);
- if ($linkt && -r $linkt) {
+ if ($linkt) {
if ($linkt eq $f) {
- unlink($target) if $opt_remove;
- # do nothing, it is the same link
+ # case 1: exists, link, targets agree
+ $do_unlink = 1;
+ } elsif (-r $linkt) {
+ # case 3: exists, link, targets different
+ if ($opt_force) {
+ print_info("Removing link $target due to --force!\n");
+ $do_unlink = 1;
+ } else {
+ print_error("Link $target already existing, but different target then $target, exiting!\n");
+ exit(1);
+ }
} else {
- print_error("link $target already existing, but different target then $target, exiting!\n");
- exit(1);
+ # case 2: dangling symlink
+ print_warning("Removing dangling symlink $target to $linkt\n");
+ $do_unlink = 1;
}
} else {
- print_warning("removing dangling symlink $target to $linkt\n");
- unlink($target);
- }
- } else {
- if (-e $target) {
- print_error("$target already existing, but not a link, exiting!\n");
+ print_error("This should not happen, we have a link but cannot read the target?\n");
exit(1);
+ }
+ } elsif (-r $target) {
+ # case 4: exists, but not link
+ if ($opt_force) {
+ print_info("Removing $target due to --force!\n");
+ $do_unlink = 1;
} else {
- if ($opt_remove) {
- unlink($target);
- } else {
- symlink($f, $target) || die("Cannot link font $f to $target: $!");
- }
+ print_error("$target already existing, exiting!\n");
+ exit(1);
}
+ } # otherwise it is not existing!
+
+ # if we are still here and $do_unlink is set, remove it
+ unlink($target) if $do_unlink;
+ # recreate link if we are not in the remove case
+ if (! $opt_remove) {
+ symlink($f, $target) || die("Cannot link font $f to $target: $!");
}
}
@@ -537,7 +583,7 @@ sub do_ttf_fonts {
my $outp = '';
make_dir($fontdest, "cannot create CID snippets there!");
make_dir($cidfsubst, "cannot link TTF fonts there!");
- make_dir("$opt_texmflink/fonts/truetype/cjk-gs-integrate",
+ make_dir("$opt_texmflink/$ttf_pathpart",
"cannot link fonts to it!")
if $opt_texmflink;
for my $k (keys %fontdb) {
@@ -546,7 +592,7 @@ sub do_ttf_fonts {
$k, $fontdb{$k}{'class'}, $fontdb{$k}{'target'});
$outp .= generate_cidfmap_entry($k, $fontdb{$k}{'class'}, $fontdb{$k}{'ttfname'}, $fontdb{$k}{'subfont'});
link_font($fontdb{$k}{'target'}, $cidfsubst, $fontdb{$k}{'ttfname'});
- link_font($fontdb{$k}{'target'}, "$opt_texmflink/fonts/truetype/cjk-gs-integrate", $fontdb{$k}{'ttfname'})
+ link_font($fontdb{$k}{'target'}, "$opt_texmflink/$ttf_pathpart", $fontdb{$k}{'ttfname'})
if $opt_texmflink;
}
}
@@ -689,6 +735,18 @@ sub info_found_fonts {
if ($fontdb{$k}{'type'} eq 'TTF') {
print "Link: $fontdb{$k}{'ttfname'}\n";
}
+ my @ks = sort { $fontdb{$k}{'files'}{$a}{'priority'}
+ <=>
+ $fontdb{$k}{'files'}{$b}{'priority'} }
+ keys %{$fontdb{$k}{'files'}};
+ # remove the top element which is the winner and shown above
+ shift @ks;
+ if (@ks) {
+ print "Other candidates in decreasing order:\n";
+ for my $f (@ks) {
+ print " ", $fontdb{$k}{'files'}{$f}{'target'}, "\n";
+ }
+ }
print "\n";
}
}
@@ -741,16 +799,22 @@ sub check_for_files {
}
#
if (@extradirs) {
- # final dummy directory
- push @extradirs, "/this/does/not/really/exists/unless/you/are/stupid";
+ # we want that files in OSFONTDIR are found first, before
+ # links that we have created in TEXMFLOCAL
+ # Thus, instead of setting OSFONTDIR which is at the *END* of
+ # the kpsewhich variables OPENTYPEFONTS and TTFONTS, we put
+ # all these fonts at the front of them
# push current value of OSFONTDIR
push @extradirs, $ENV{'OSFONTDIR'} if $ENV{'OSFONTDIR'};
- # compose OSFONTDIR
- my $osfontdir = join ':', @extradirs;
- $ENV{'OSFONTDIR'} = $osfontdir;
- }
- if ($ENV{'OSFONTDIR'}) {
- print_debug("final setting of OSFONTDIR: $ENV{'OSFONTDIR'}\n");
+ # update OPENTYPEFONTS and TTFONTS
+ if (@extradirs) {
+ my $newotf = join(':', @extradirs) . ':';
+ my $newttf = $newotf;
+ $newotf .= $ENV{'OPENTYPEFONTS'} if ($ENV{'OPENTYPEFONTS'});
+ $newttf .= $ENV{'TTFONTS'} if ($ENV{'TTFONTS'});
+ $ENV{'OPENTYPEFONTS'} = $newotf;
+ $ENV{'TTFONTS'} = $newttf;
+ }
}
# prepare for kpsewhich call, we need to do quoting
my $cmdl = 'kpsewhich ';
@@ -766,8 +830,13 @@ sub check_for_files {
# map basenames to filenames
my %bntofn;
for my $f (@foundfiles) {
+ my $realf = abs_path($f);
+ if (!$realf) {
+ print_warning("dead link or strange file found: $f - ignored!\n");
+ next;
+ }
my $bn = basename($f);
- $bntofn{$bn} = $f;
+ $bntofn{$bn} = $realf;
}
if ($opt_debug > 0) {
print_debug("dumping font database before file check:\n");
@@ -814,7 +883,7 @@ sub check_for_files {
$fontdb{$k}{'subfont'} = $sf if ($fontdb{$k}{'type'} eq 'TTF');
}
# not needed anymore
- delete $fontdb{$k}{'files'};
+ # delete $fontdb{$k}{'files'};
}
if ($opt_debug > 0) {
print_debug("dumping font database:\n");
@@ -973,7 +1042,7 @@ sub read_font_database {
sub find_gs_resource {
# we assume that gs is in the path
# on Windows we probably have to try something else
- my @ret = `gs --help 2>$nul`;
+ chomp( my @ret = `gs --help 2>$nul` );
my $foundres = '';
if ($?) {
print_error("Cannot find gs ...\n");
@@ -982,9 +1051,9 @@ sub find_gs_resource {
for (@ret) {
if (m!Resource/Font!) {
$foundres = $_;
- $foundres =~ s/^\s*//;
- $foundres =~ s/\s*:\s*$//;
- $foundres =~ s!/Font!!;
+ # extract the first substring of non-space chars
+ # up to Resource/Font and drop the /Font part
+ $foundres =~ s!^.*\s(\S*Resource)/Font.*$!$1!;
last;
}
}
@@ -1018,9 +1087,9 @@ sub Usage {
--filelist FILE read list of available font files from FILE
instead of searching with kpathsea
--link-texmf [DIR] link fonts into
- DIR/fonts/opentype/cjk-gs-integrate
+ DIR/$otf_pathpart
and
- DIR/fonts/truetype/cjk-gs-integrate
+ DIR/$ttf_pathpart
where DIR defaults to TEXMFLOCAL
--machine-readable output of --list-aliases is machine readable
--force do not bail out if linked fonts already exist