blob: 92b5cd151710fec3da451ded0fe42dc88744d44b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/usr/bin/env perl
# Copyright (C) 2012--2016 by Leo Liu <leoliu.pku@gmail.com>
#
# Run this script to add tfm font map for zhmCJK package.
chomp ( my $texmfdist = `kpsewhich -var-value=TEXMFDIST` ) ;
my $texfontsmap = "$texmfdist/fonts/map/fontname/texfonts.map";
my $absent = 1;
if (-r "$texfontsmap") {
open (FOO, "<$texfontsmap");
my @lines = <FOO>;
chomp(@lines);
close(FOO);
for my $line (@lines) {
if ($line =~ m/^\s*include\s+zhmCJK\.map\s*/) {
$absent = 0;
}
}
}
if ($absent) {
open (FOO, ">>$texfontsmap") || die("Cannot write $texfontsmap\n");
print FOO "include zhmCJK.map\n";
close(FOO);
}
|