diff options
author | wl <wl> | 2010-06-04 05:38:49 +0000 |
---|---|---|
committer | wl <wl> | 2010-06-04 05:38:49 +0000 |
commit | f01ce5b88cbda3241c9ec45aa3951eb7f9dcc285 (patch) | |
tree | 5552b8dadbade58a937bb7f7cd6e151a14e0626c /src/utils | |
parent | 5f37cf58410bc3f8e9e08acfc889274ce4632a9c (diff) | |
download | groff-f01ce5b88cbda3241c9ec45aa3951eb7f9dcc285.tar.gz |
afmtodit: Add option `-o' to specify an output file.
* src/utils/afmtodit.pl: Implement it.
* src/utils/afmtodit.man: Document it.
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/afmtodit/afmtodit.man | 16 | ||||
-rw-r--r-- | src/utils/afmtodit/afmtodit.pl | 13 |
2 files changed, 21 insertions, 8 deletions
diff --git a/src/utils/afmtodit/afmtodit.man b/src/utils/afmtodit/afmtodit.man index b7418605..47017e19 100644 --- a/src/utils/afmtodit/afmtodit.man +++ b/src/utils/afmtodit/afmtodit.man @@ -1,5 +1,6 @@ .ig -Copyright (C) 1989-2000, 2001, 2002, 2003, 2005, 2006, 2008, 2009 +Copyright (C) 1989-2000, 2001, 2002, 2003, 2005, 2006, 2008, 2009, + 2010 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of @@ -52,6 +53,7 @@ afmtodit \- create font files for use with groff \-Tps .OP \-e enc_file .OP \-f internal_name .OP \-i n +.OP \-o out_file .I afm_file .I map_file .I font @@ -141,7 +143,10 @@ is best to access them with glyph names only. . .LP The groff font file will be output to a file called -.IR font . +.IR font , +unless the +.B \-o +option is used. . .LP If there is a downloadable font file for the font, it may be listed in @@ -277,6 +282,13 @@ The font files distributed with groff were created using an option of for italic fonts. . .TP +.BI \-o out_file +The output file is +.I out_file +instead of +.IR font . +. +.TP .B \-k Omit any kerning data from the groff font. This should be used only for mono-spaced fonts. diff --git a/src/utils/afmtodit/afmtodit.pl b/src/utils/afmtodit/afmtodit.pl index 17b461d2..b0b7dc0e 100644 --- a/src/utils/afmtodit/afmtodit.pl +++ b/src/utils/afmtodit/afmtodit.pl @@ -1,7 +1,7 @@ #! /usr/bin/perl -w # -*- Perl -*- # Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, -# 2009 +# 2009, 2010 # Free Software Foundation, Inc. # Written by James Clark (jjc@jclark.com) # @@ -30,10 +30,10 @@ $prog =~ s@.*/@@; my $groff_sys_fontdir = "@FONTDIR@"; use Getopt::Std; -getopts('a:cd:e:f:i:kmnsvx'); +getopts('a:cd:e:f:i:kmno:svx'); -our ($opt_a, $opt_c, $opt_d, $opt_e, $opt_f, $opt_i, - $opt_k, $opt_m, $opt_n, $opt_s, $opt_v, $opt_x); +our ($opt_a, $opt_c, $opt_d, $opt_e, $opt_f, $opt_i, $opt_k, + $opt_m, $opt_n, $opt_o, $opt_s, $opt_v, $opt_x); if ($opt_v) { print "GNU afmtodit (groff) version @VERSION@\n"; @@ -42,12 +42,13 @@ if ($opt_v) { if ($#ARGV != 2) { die "usage: $prog [-ckmnsvx] [-a angle] [-d DESC] [-e encoding]\n" . - " [-f name] [-i n] afmfile mapfile font\n"; + " [-f name] [-i n] [-o outfile] afmfile mapfile font\n"; } my $afm = $ARGV[0]; my $map = $ARGV[1]; my $font = $ARGV[2]; +my $outfile = $opt_o || $font; my $desc = $opt_d || "DESC"; my $sys_map = $groff_sys_fontdir . "/devps/generate/" . $map; my $sys_desc = $groff_sys_fontdir . "/devps/" . $desc; @@ -416,7 +417,7 @@ while (my ($lig, $components) = each %default_ligatures) { # print it all out -open(FONT, ">$font") || die "$prog: can't open \`$font' for output: $!\n"; +open(FONT, ">$outfile") || die "$prog: can't open \`$outfile' for output: $!\n"; select(FONT); print("# This file has been generated with " . |