summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwl <wl>2008-07-24 12:06:24 +0000
committerwl <wl>2008-07-24 12:06:24 +0000
commit549b57a64a5090f2bbe138d0df4e586b115808bf (patch)
tree8a057da3b2a1a6c594181db1a5db5a039a3cec2c
parentf0ce0cbcf58e473b9a3207f7d8f86651277328ab (diff)
downloadgroff-549b57a64a5090f2bbe138d0df4e586b115808bf.tar.gz
New options -f and -k for afmtodit.
* src/afmtodit/afmtodit.pl: New options `-f NAME' sets the internal name of the groff font. New option `-k' disables output of kerning data. * src/afmtodit/afmtodit.man, NEWS: Document new options.
-rw-r--r--ChangeLog9
-rw-r--r--NEWS4
-rw-r--r--src/utils/afmtodit/afmtodit.man15
-rw-r--r--src/utils/afmtodit/afmtodit.pl17
4 files changed, 36 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 309d55e5..8b9879e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-07-24 Denis M. Wilson <dmw@oxytropis.plus.com>
+
+ New options -f and -k for afmtodit.
+
+ * src/afmtodit/afmtodit.pl: New options `-f NAME' sets the internal
+ name of the groff font.
+ New option `-k' disables output of kerning data.
+ * src/afmtodit/afmtodit.man, NEWS: Document new options.
+
2008-07-18 Werner LEMBERG <wl@gnu.org>
* src/preproc/tbl/table.cpp (table::compute_separation_factor): Emit
diff --git a/NEWS b/NEWS
index 633201bb..db77e119 100644
--- a/NEWS
+++ b/NEWS
@@ -156,6 +156,10 @@ Afmtodit
o New option `-c' to output more font information as comments.
+o New option `-k' to suppress output of kerning data.
+
+o New option `-f NAME' to set the internal name of the groff font.
+
Macro Packages
--------------
diff --git a/src/utils/afmtodit/afmtodit.man b/src/utils/afmtodit/afmtodit.man
index b77773f3..7ff3548e 100644
--- a/src/utils/afmtodit/afmtodit.man
+++ b/src/utils/afmtodit/afmtodit.man
@@ -1,5 +1,5 @@
.ig
-Copyright (C) 1989-2000, 2001, 2002, 2003, 2005, 2006
+Copyright (C) 1989-2000, 2001, 2002, 2003, 2005, 2006, 2008
Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
@@ -46,10 +46,11 @@ afmtodit \- create font files for use with groff \-Tps
.in +\w'\fBafmtodit 'u
.ti \niu
.B afmtodit
-.OP \-cmnsvx
+.OP \-ckmnsvx
.OP \-a n
.OP \-d desc_file
.OP \-e enc_file
+.OP \-f internal_name
.OP \-i n
.I afm_file
.I map_file
@@ -230,6 +231,11 @@ If not found in the current directory, the `devps' subdirectory of the
default font directory is searched.
.
.TP
+.BI \-f name
+The internal name of the groff font is set to
+.IR name .
+.
+.TP
.BI \-i n
Generate an italic correction for each character so that
the character's width plus the character's italic correction
@@ -271,6 +277,11 @@ The font files distributed with groff were created using an option of
for italic fonts.
.
.TP
+.B \-k
+Omit any kerning data from the groff font.
+This should be used only for mono-spaced fonts.
+.
+.TP
.B \-m
Prevent negative left italic correction values.
.
diff --git a/src/utils/afmtodit/afmtodit.pl b/src/utils/afmtodit/afmtodit.pl
index b1323363..a77153f7 100644
--- a/src/utils/afmtodit/afmtodit.pl
+++ b/src/utils/afmtodit/afmtodit.pl
@@ -1,6 +1,6 @@
#! /usr/bin/perl -w
# -*- Perl -*-
-# Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+# Copyright (C) 1989-2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# 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:i:mnsvx');
+getopts('a:cd:e:f:i:kmnsvx');
-our ($opt_a, $opt_c, $opt_d, $opt_e, $opt_i,
- $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_s, $opt_v, $opt_x);
if ($opt_v) {
print "GNU afmtodit (groff) version @VERSION@\n";
@@ -41,8 +41,8 @@ if ($opt_v) {
}
if ($#ARGV != 2) {
- die "usage: $prog [-cmnsvx] [-a angle] [-d DESC] [-e encoding]\n" .
- " [-i n] afmfile mapfile font\n";
+ die "usage: $prog [-ckmnsvx] [-a angle] [-d DESC] [-e encoding]\n" .
+ " [-f name] [-i n] afmfile mapfile font\n";
}
my $afm = $ARGV[0];
@@ -75,6 +75,9 @@ while (<AFM>) {
next if $#field < 0;
if ($field[0] eq "FontName") {
$psname = $field[1];
+ if($opt_f) {
+ $psname = $opt_f;
+ }
}
elsif($field[0] eq "Notice") {
$notice = $_;
@@ -460,7 +463,7 @@ if (!$opt_n && %ligatures) {
print(" 0\n");
}
-if ($#kern1 >= 0) {
+if (!$opt_k && $#kern1 >= 0) {
print("\n");
print("kernpairs\n");