3
* - a vflibcap entry generator for TeX PK fonts
5
* - This program prints vflibcap entries to standard output.
7
* - Useful for generating vflibcap for TeX DVI drivers
10
* by Hirotsugu Kakugawa
15
* Copyright (C) 2001 Hirotsugu Kakugawa.
16
* All rights reserved.
18
* This program is free software; you can redistribute it and/or modify
19
* it under the terms of the GNU General Public License as published by
20
* the Free Software Foundation; either version 2, or (at your option)
23
* This program is distributed in the hope that it will be useful,
24
* but WITHOUT ANY WARRANTY; without even the implied warranty of
25
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26
* GNU General Public License for more details.
28
* You should have received a copy of the GNU General Public License
29
* along with this program; if not, write to the Free Software
30
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
40
#include <sys/param.h>
43
#include "VFlib-3_6.h"
53
void gen_class_deafult(void);
56
char *mode = DEFAULT_KPS_MODE;
58
int dpi_i = DEFAULT_KPS_DPI;
62
char *pk_fontdirs[NDIRS];
64
int gen_missing_glyph = 0;
70
main(int argc, char **argv)
77
sprintf(dpi, "%d", dpi_i);
79
cmdline = copy_cmdline(argc, argv);
82
for (i = 0; i < NDIRS; i++){
83
pk_fontdirs[i] = NULL;
89
for (xargc--,xargv++; xargc > 0; xargc--,xargv++){
90
if ((strcmp(*xargv, "--help") == 0)
91
|| (strcmp(*xargv, "-help") == 0)){
92
printf("vflmkpk: generates vflibcap entries for PK fonts\n");
93
printf("Usage: vflmkpk [options]\n");
95
printf(" -d DIR : PK font file directory\n");
96
printf(" -n MODE : Device mode name for kpathsea\n");
97
printf(" -r DPI : Default device resolution\n");
98
printf(" -g : Emit code to generate PK file on-the-fly\n");
100
printf("Example: vflmkpk -d TEXMF -d /usr/tex/fonts -g \n");
103
} else if (strcmp(*xargv, "-d") == 0){
106
fprintf(stderr, "Too many PK font directories\n");
111
pk_fontdirs[n_pkf++] = x_strdup(*xargv);
113
} else if (strcmp(*xargv, "-r") == 0){
116
dpi = strdup(*xargv);
118
} else if (strcmp(*xargv, "-n") == 0){
122
mode = x_strdup(*xargv);
124
} else if (strcmp(*xargv, "-g") == 0){
125
gen_missing_glyph = 1;
128
if (*xargv[0] == '-'){
129
fprintf(stderr, "vflmkpk: unknown option %s\n", *xargv);
137
banner("PK", "vflmkpk", cmdline);
147
gen_class_deafult(void)
152
VF_CAPE_VFLIBCAP_CLASS_DEFAULT_DEFINITION, FONTCLASS_NAME_PK);
153
printf("\n (%s", VF_CAPE_FONT_DIRECTORIES);
154
for (i = 0; i < n_pkf; i++)
155
printf("\n \"%s\"", pk_fontdirs[i]);
157
printf("\n (%s %s)", VF_CAPE_DPI, dpi);
159
printf("\n (%s \"%s\")", VF_CAPE_MAKE_MISSING_GLYPH,
160
(gen_missing_glyph==1) ? "yes" : "no");