groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff-commit] groff ChangeLog font/devps/prologue.ps src/devi...


From: Werner LEMBERG
Subject: [Groff-commit] groff ChangeLog font/devps/prologue.ps src/devi...
Date: Sun, 13 Aug 2006 12:37:20 +0000

CVSROOT:        /cvsroot/groff
Module name:    groff
Changes by:     Werner LEMBERG <wl>     06/08/13 12:37:20

Modified files:
        .              : ChangeLog 
        font/devps     : prologue.ps 
        src/devices/grops: grops.man 
        src/include    : lib.h 
        src/preproc/preconv: preconv.cpp 

Log message:
        * font/devps/prologue.ps: Add BPhook.
        
        * src/devices/grops/grops.man: Document BPHook.
        Reorder some sections for better readability.
        
        * src/include/lib.h (getlocale): New macro.
        (setlocale, LC_ALL, LC_CTYPE) [!HAVE_SETLOCALE]: Define, as
        suggested by Bruno.
        
        * src/preproc/preconv/preconv.cpp (main): Use getlocale.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/ChangeLog?cvsroot=groff&r1=1.981&r2=1.982
http://cvs.savannah.gnu.org/viewcvs/groff/font/devps/prologue.ps?cvsroot=groff&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/groff/src/devices/grops/grops.man?cvsroot=groff&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/groff/src/include/lib.h?cvsroot=groff&r1=1.40&r2=1.41
http://cvs.savannah.gnu.org/viewcvs/groff/src/preproc/preconv/preconv.cpp?cvsroot=groff&r1=1.12&r2=1.13

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/groff/groff/ChangeLog,v
retrieving revision 1.981
retrieving revision 1.982
diff -u -b -r1.981 -r1.982
--- ChangeLog   11 Aug 2006 10:27:54 -0000      1.981
+++ ChangeLog   13 Aug 2006 12:37:19 -0000      1.982
@@ -1,3 +1,18 @@
+2006-08-12  Tadziu Hoffmann  <address@hidden>
+
+       * font/devps/prologue.ps: Add BPhook.
+
+       * src/devices/grops/grops.man: Document BPHook.
+       Reorder some sections for better readability.
+
+2006-08-12  Werner LEMBERG  <address@hidden>
+
+       * src/include/lib.h (getlocale): New macro.
+       (setlocale, LC_ALL, LC_CTYPE) [!HAVE_SETLOCALE]: Define, as
+       suggested by Bruno.
+
+       * src/preproc/preconv/preconv.cpp (main): Use getlocale.
+
 2006-08-11  Werner LEMBERG  <address@hidden>
 
        Add new flag to .cflags to enable hyphenation without looking at

Index: font/devps/prologue.ps
===================================================================
RCS file: /cvsroot/groff/groff/font/devps/prologue.ps,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- font/devps/prologue.ps      14 Feb 2006 19:47:15 -0000      1.8
+++ font/devps/prologue.ps      13 Aug 2006 12:37:20 -0000      1.9
@@ -79,6 +79,7 @@
        /level0 save def
        1 setlinecap
        1 setlinejoin
+       DEFS /BPhook known { DEFS begin BPhook end } if
        72 RES div dup scale
        LS {
                90 rotate

Index: src/devices/grops/grops.man
===================================================================
RCS file: /cvsroot/groff/groff/src/devices/grops/grops.man,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- src/devices/grops/grops.man 31 Jul 2006 09:48:57 -0000      1.33
+++ src/devices/grops/grops.man 13 Aug 2006 12:37:20 -0000      1.34
@@ -204,7 +204,7 @@
 for older printers which don't understand PostScript LanguageLevel\~2.
 .
 It is also necessary if the output is further processed to get an
-encapsulated PS (EPS) file -- see below.
+encapsulated PS (EPS) file \[en] see below.
 .
 .IP
 The default value can be specified by a
@@ -244,15 +244,15 @@
 centered on the page.
 .
 This option allows you to generate documents that can be printed
-both on letter (8.5\(mu11) paper and on A4 paper without change.
+both on letter (8.5\[mu]11) paper and on A4 paper without change.
 .
 .TP
 .BI \-I dir
 This option may be used to specify a directory to search for
 files on the command line and files named in 
-.B \eX'ps: import'
+.B \[rs]X'ps: import'
 and
-.B \eX'ps: file'
+.B \[rs]X'ps: file'
 escapes.
 .
 The current directory is always searched first.
@@ -313,7 +313,216 @@
 .
 .
 .SH USAGE
-There are styles called
+The input to
+.B grops
+must be in the format output by
+.BR @address@hidden (@MAN1EXT@).
+.
+This is described in
+.BR groff_out (@MAN5EXT@).
+.
+.LP
+In addition, the device and font description files for the device used
+must meet certain requirements:
+.
+The resolution must be an integer multiple of\~72 times the
+.BR sizescale .
+.
+The
+.B ps
+device uses a resolution of 72000 and a sizescale of 1000.
+.
+.LP
+The device description file must contain a valid paper size; see
+.BR groff_font (@MAN5EXT@)
+for more information.
+.
+.LP
+Each font description file must contain a command
+.IP
+.BI internalname\  psname
+.LP
+which says that the PostScript name of the font is
+.IR psname .
+.
+It may also contain a command
+.IP
+.BI encoding\  enc_file
+.LP
+which says that
+the PostScript font should be reencoded using the encoding described in
+.IR enc_file ;
+this file should consist of a sequence of lines of the form:
+.IP
+.I
+pschar code
+.LP
+where
+.I pschar
+is the PostScript name of the character,
+and
+.I code
+is its position in the encoding expressed as a decimal integer; valid
+values are in the range 0 to\~255.
+.
+Lines starting with
+.B #
+and blank lines are ignored.
+.
+The code for each character given in the font file must correspond
+to the code for the character in encoding file, or to the code in the default
+encoding for the font if the PostScript font is not to be reencoded.
+.
+This code can be used with the
+.B \[rs]N
+escape sequence in
+.B troff
+to select the character,
+even if the character does not have a groff name.
+.
+Every character in the font file must exist in the PostScript font, and
+the widths given in the font file must match the widths used
+in the PostScript font.
+.
+.B grops
+assumes that a character with a groff name of
+.B space
+is blank (makes no marks on the page);
+it can make use of such a character to generate more efficient and
+compact PostScript output.
+.
+.LP
+Note that
+.B grops
+is able to display all glyphs in a PostScript font, not only 256.
+.I enc_file
+(or the default encoding if no encoding file specified) just defines the
+order of glyphs for the first 256 characters; all other glyphs are
+accessed with additional encoding vectors which
+.B grops
+produces on the fly.
+.
+.LP
+.B grops
+can automatically include the downloadable fonts necessary
+to print the document.
+.
+Such fonts must be in PFA format.
+.
+Use
+.BR \%pfbtops (@MAN1EXT@)
+to convert a Type\~1 font in PFB format.
+.
+Any downloadable fonts which should, when required, be included by
+.B grops
+must be listed in the file
+.BR @FONTDIR@/devps/download ;
+this should consist of lines of the form
+.
+.IP
+.I
+font filename
+.
+.LP
+where
+.I font
+is the PostScript name of the font,
+and
+.I filename
+is the name of the file containing the font;
+lines beginning with
+.B #
+and blank lines are ignored;
+fields may be separated by tabs or spaces;
+.I filename
+is searched for using the same mechanism that is used
+for groff font metric files.
+.
+The
+.B download
+file itself is also searched for using this mechanism;
+currently, only the first found file in the font path is used.
+.
+.LP
+If the file containing a downloadable font or imported document
+conforms to the Adobe Document Structuring Conventions,
+then
+.B grops
+interprets any comments in the files sufficiently to ensure that its
+own output is conforming.
+.
+It also supplies any needed font resources that are listed in the
+.B download
+file
+as well as any needed file resources.
+.
+It is also able to handle inter-resource dependencies.
+.
+For example, suppose that you have a downloadable font called Garamond,
+and also a downloadable font called Garamond-Outline
+which depends on Garamond
+(typically it would be defined to copy Garamond's font dictionary,
+and change the PaintType),
+then it is necessary for Garamond to appear before Garamond-Outline
+in the PostScript document.
+.
+.B grops
+handles this automatically
+provided that the downloadable font file for Garamond-Outline
+indicates its dependence on Garamond by means of
+the Document Structuring Conventions,
+for example by beginning with the following lines
+.
+.IP
+.B
+%!PS-Adobe-3.0 Resource-Font
+.br
+.B
+%%DocumentNeededResources: font Garamond
+.br
+.B
+%%EndComments
+.br
+.B
+%%IncludeResource: font Garamond
+.
+.LP
+In this case both Garamond and Garamond-Outline would need to be listed
+in the
+.B download
+file.
+.
+A downloadable font should not include its own name in a
+.B %%Document\%Supplied\%Resources
+comment.
+.
+.LP
+.B grops
+does not interpret
+.B %%Document\%Fonts
+comments.
+.
+The
+.BR %%Document\%Needed\%Resources ,
+.BR %%Document\%Supplied\%Resources ,
+.BR %%Include\%Resource ,
+.BR %%Begin\%Resource ,
+and
+.BR %%End\%Resource
+comments
+(or possibly the old
+.BR %%Document\%Needed\%Fonts ,
+.BR %%Document\%Supplied\%Fonts ,
+.BR %%Include\%Font ,
+.BR %%Begin\%Font ,
+and
+.BR %%End\%Font
+comments)
+should be used.
+.
+.LP
+In the default setup
+there are styles called
 .BR R ,
 .BR I ,
 .BR B ,
@@ -853,219 +1062,63 @@
 .RE
 .
 .LP
-The input to
-.B grops
-must be in the format output by
-.BR @address@hidden (@MAN1EXT@).
-.
-This is described in
-.BR groff_out (@MAN5EXT@).
-.
-.LP
-In addition, the device and font description files for the device used
-must meet certain requirements:
-.
-The resolution must be an integer multiple of\~72 times the
-.BR sizescale .
-.
-The
-.B ps
-device uses a resolution of 72000 and a sizescale of 1000.
-.
-.LP
-The device description file must contain a valid paper size; see
-.BR groff_font (@MAN5EXT@)
-for more information.
-.
-.LP
-Each font description file must contain a command
-.IP
-.BI internalname\  psname
-.LP
-which says that the PostScript name of the font is
-.IR psname .
-.
-It may also contain a command
-.IP
-.BI encoding\  enc_file
-.LP
-which says that
-the PostScript font should be reencoded using the encoding described in
-.IR enc_file ;
-this file should consist of a sequence of lines of the form:
-.IP
-.I
-pschar code
-.LP
-where
-.I pschar
-is the PostScript name of the character,
-and
-.I code
-is its position in the encoding expressed as a decimal integer; valid
-values are in the range 0 to\~255.
-.
-Lines starting with
-.B #
-and blank lines are ignored.
-.
-The code for each character given in the font file must correspond
-to the code for the character in encoding file, or to the code in the default
-encoding for the font if the PostScript font is not to be reencoded.
-.
-This code can be used with the
-.B \[rs]N
-escape sequence in
-.B troff
-to select the character,
-even if the character does not have a groff name.
-.
-Every character in the font file must exist in the PostScript font, and 
-the widths given in the font file must match the widths used
-in the PostScript font.
-.
-.B grops
-assumes that a character with a groff name of
-.B space
-is blank (makes no marks on the page);
-it can make use of such a character to generate more efficient and
-compact PostScript output.
-.
-.LP
-Note that
-.B grops
-is able to display all glyphs in a PostScript font, not only 256.
-.I enc_file
-(or the default encoding if no encoding file specified) just defines the
-order of glyphs for the first 256 characters; all other glyphs are
-accessed with additional encoding vectors which
-.B grops
-produces on the fly.
-.
-.LP
-.B grops
-can automatically include the downloadable fonts necessary
-to print the document.
-.
-Such fonts must be in PFA format.
-.
-Use
-.BR \%pfbtops (@MAN1EXT@)
-to convert a Type\~1 font in PFB format.
-.
-Any downloadable fonts which should, when required, be included by
-.B grops
-must be listed in the file
-.BR @FONTDIR@/devps/download ;
-this should consist of lines of the form
-.
-.IP
-.I
-font filename
-.
+If a PostScript procedure
+.B BPhook
+has been defined via a
+.RB ` ps:\ def '
+or
+.RB ` ps:\ mdef '
+device command, it is executed at the beginning
+of every page (before anything is drawn or written by groff).
+For example, to underlay the page contents with the word
+`DRAFT' in light gray, you might use
+.RS
 .LP
-where
-.I font
-is the PostScript name of the font,
-and
-.I filename
-is the name of the file containing the font;
-lines beginning with
-.B #
-and blank lines are ignored;
-fields may be separated by tabs or spaces;
-.I filename
-is searched for using the same mechanism that is used
-for groff font metric files.
-.
-The
-.B download
-file itself is also searched for using this mechanism;
-currently, only the first found file in the font path is used.
-.
+.nf
+.ft B
+\&.de XX
+ps: def
+/BPhook
+{ gsave .9 setgray clippath pathbbox exch 2 copy
+  .5 mul exch .5 mul translate atan rotate pop pop
+  /NewCenturySchlbk-Roman findfont 200 scalefont setfont
+  (DRAFT) dup stringwidth pop \-.5 mul \-70 moveto show
+  grestore }
+def
+\&..
+\&.devicem XX
+.ft R
+.fi
+.RE
 .LP
-If the file containing a downloadable font or imported document
-conforms to the Adobe Document Structuring Conventions,
-then
-.B grops
-interprets any comments in the files sufficiently to ensure that its
-own output is conforming.
-.
-It also supplies any needed font resources that are listed in the
-.B download
-file
-as well as any needed file resources.
-.
-It is also able to handle inter-resource dependencies.
-.
-For example, suppose that you have a downloadable font called Garamond,
-and also a downloadable font called Garamond-Outline
-which depends on Garamond
-(typically it would be defined to copy Garamond's font dictionary,
-and change the PaintType),
-then it is necessary for Garamond to appear before Garamond-Outline
-in the PostScript document.
-.
-.B grops
-handles this automatically
-provided that the downloadable font file for Garamond-Outline
-indicates its dependence on Garamond by means of
-the Document Structuring Conventions,
-for example by beginning with the following lines
-.
-.IP
-.B
-%!PS-Adobe-3.0 Resource-Font
-.br
-.B
-%%DocumentNeededResources: font Garamond
-.br
-.B
-%%EndComments
-.br
-.B
-%%IncludeResource: font Garamond
-.
+Or, to cause lines and polygons to be drawn with square linecaps
+and mitered linejoins instead of the round linecaps and linejoins
+normally used by
+.BR grops ,
+use
+.RS
 .LP
-In this case both Garamond and Garamond-Outline would need to be listed
-in the
-.B download
-file.
-.
-A downloadable font should not include its own name in a
-.B %%Document\%Supplied\%Resources
-comment.
-.
+.nf
+.ft B
+\&.de XX
+ps: def
+/BPhook { 2 setlinecap 0 setlinejoin } def
+\&..
+\&.devicem XX
+.ft R
+.fi
+.RE
 .LP
-.B grops
-does not interpret 
-.B %%Document\%Fonts
-comments.
-.
-The
-.BR %%Document\%Needed\%Resources ,
-.BR %%Document\%Supplied\%Resources ,
-.BR %%Include\%Resource ,
-.BR %%Begin\%Resource ,
-and
-.BR %%End\%Resource
-comments
-(or possibly the old
-.BR %%Document\%Needed\%Fonts ,
-.BR %%Document\%Supplied\%Fonts ,
-.BR %%Include\%Font ,
-.BR %%Begin\%Font ,
-and
-.BR %%End\%Font
-comments)
-should be used.
+(square linecaps, as opposed to butt linecaps (0 setlinecap),
+give true corners in boxed tables even though the lines are
+drawn unconnected).
 .
 .
 .SS Encapsulated PostScript
 .B grops
 itself doesn't emit bounding box information.
 .
-With the help of GhostScript the following simple script,
+With the help of Ghostscript the following simple script,
 .BR groff2eps ,
 produces an encapsulated PS file.
 .
@@ -1074,11 +1127,11 @@
 .nf
 .ft B
 #! /bin/sh
-groff -P-b16 $1 > $1.ps
-gs -dNOPAUSE -sDEVICE=bbox -- $1.ps 2> $1.bbox
+groff \-P\-b16 $1 >$1.ps
+gs \-dNOPAUSE \-sDEVICE=bbox \-\- $1.ps 2>$1.bbox
 cat $1.ps \[rs]
-| sed \-e "/^%%Orientation/r$1.bbox" \[rs]
-      \-e "/^%!PS-Adobe-3.0/s/$/ EPSF-3.0/" > $1.eps
+| sed \-e "/\[ha]%%Orientation/r$1.bbox" \[rs]
+      \-e "/\[ha]%!PS-Adobe-3.0/s/$/ EPSF-3.0/" >$1.eps
 rm $1.ps $1.bbox
 .ft R
 .fi
@@ -1103,13 +1156,13 @@
 .B grops 
 if converted first to 
 .B "Type\~42"
-format, an especial PostScript wrapper equivalent to the
+format, a special PostScript wrapper equivalent to the
 PFA format mentioned in
 .BR \%pfbtops (@MAN1EXT@).
 .
 There are several different methods to generate a type42 
 wrapper and most of them involve the use of a PostScript
-interpreter such as Ghostscript \(em see
+interpreter such as Ghostscript \[en] see
 .BR gs (1).
 .
 .LP
@@ -1146,7 +1199,12 @@
 as a step-by-step font installation guide for
 .BR grops .
 .
-.IP \(bu 4
+.ds BU \[bu]\ \ \"
+.de LI
+.IP "" 4
+\h'-\w'\*[BU]'u'\*[BU]\c
+..
+.LI
 Convert your font to something groff understands.
 .
 This is either a PostScript Type\~1 font in PFA format or a
@@ -1192,7 +1250,7 @@
 .B fontforge
 which can convert most outline font formats.
 .
-.IP \(bu 4
+.LI
 Convert the AFM file to a groff font description file with the
 .BR \%afmtodit (@MAN1EXT@)
 program.
@@ -1228,7 +1286,7 @@
 and
 .BR TBI .
 .
-.IP \(bu 4
+.LI
 Install both the groff font description files and the fonts in a
 `devps' subdirectory of the font path which groff finds.
 .
@@ -1241,7 +1299,7 @@
 Note that groff doesn't use the AFM files (but it is a good idea to
 store them anyway).
 .
-.IP \(bu 4
+.LI
 Register all fonts which must be downloaded to the printer in the
 `devps/download' file.
 .

Index: src/include/lib.h
===================================================================
RCS file: /cvsroot/groff/groff/src/include/lib.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -b -r1.40 -r1.41
--- src/include/lib.h   23 Jun 2005 11:33:00 -0000      1.40
+++ src/include/lib.h   13 Aug 2006 12:37:20 -0000      1.41
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-/* Copyright (C) 1989-2000, 2001, 2002, 2003, 2005
+/* Copyright (C) 1989-2000, 2001, 2002, 2003, 2005, 2006
    Free Software Foundation, Inc.
      Written by James Clark (address@hidden)
 
@@ -37,9 +37,13 @@
 
 #ifdef HAVE_SETLOCALE
 #include <locale.h>
-#else
-#define setlocale(category, locale) do {} while(0)
-#endif
+#define getlocale(category) setlocale(category, NULL)
+#else /* !HAVE_SETLOCALE */
+#define LC_ALL 0
+#define LC_CTYPE 0
+#define setlocale(category, locale) (void)(category, locale)
+#define getlocale(category) ((void)(category), (char *)"C")
+#endif /* !HAVE_SETLOCALE */
 
 char *strsave(const char *s);
 int is_prime(unsigned);
@@ -106,7 +110,7 @@
 // Ultrix4.3's string.h fails to declare this.
 extern "C" { int strcasecmp(const char *, const char *); }
 #endif /* NEED_DECLARATION_STRCASECMP */
-#else /* not HAVE_STRCASECMP */
+#else /* !HAVE_STRCASECMP */
 extern "C" { int strcasecmp(const char *, const char *); }
 #endif /* HAVE_STRCASECMP */
 
@@ -116,16 +120,16 @@
 // SunOS's string.h fails to declare this.
 extern "C" { int strncasecmp(const char *, const char *, int); }
 #endif /* NEED_DECLARATION_STRNCASECMP */
-#else /* not HAVE_STRNCASECMP */
+#else /* !HAVE_STRNCASECMP */
 extern "C" { int strncasecmp(const char *, const char *, size_t); }
 #endif /* HAVE_STRNCASECMP */
 #endif /* !_AIX && !sinix && !__sinix__ */
 
 #ifdef HAVE_CC_LIMITS_H
 #include <limits.h>
-#else /* not HAVE_CC_LIMITS_H */
+#else /* !HAVE_CC_LIMITS_H */
 #define INT_MAX 2147483647
-#endif /* not HAVE_CC_LIMITS_H */
+#endif /* !HAVE_CC_LIMITS_H */
 
 /* It's not safe to rely on people getting INT_MIN right (ie signed). */
 
@@ -139,14 +143,14 @@
 
 #define INT_MIN ((long)(-INT_MAX-1))
 
-#else /* not CFRONT_ANSI_BUG */
+#else /* !CFRONT_ANSI_BUG */
 
 #define INT_MIN (-INT_MAX-1)
 
-#endif /* not CFRONT_ANSI_BUG */
+#endif /* !CFRONT_ANSI_BUG */
 
 /* Maximum number of digits in the decimal representation of an int
-(not including the -). */
+   (not including the -). */
 
 #define INT_DIGITS 10
 
@@ -157,14 +161,14 @@
 const double PI = 3.14159265358979323846;
 
 /* ad_delete deletes an array of objects with destructors;
-a_delete deletes an array of objects without destructors */
+   a_delete deletes an array of objects without destructors */
 
 #ifdef ARRAY_DELETE_NEEDS_SIZE
 /* for 2.0 systems */
 #define ad_delete(size) delete [size]
 #define a_delete delete
-#else /* not ARRAY_DELETE_NEEDS_SIZE */
+#else /* !ARRAY_DELETE_NEEDS_SIZE */
 /* for ARM systems */
 #define ad_delete(size) delete []
 #define a_delete delete []
-#endif /* not ARRAY_DELETE_NEEDS_SIZE */
+#endif /* !ARRAY_DELETE_NEEDS_SIZE */

Index: src/preproc/preconv/preconv.cpp
===================================================================
RCS file: /cvsroot/groff/groff/src/preproc/preconv/preconv.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- src/preproc/preconv/preconv.cpp     25 Apr 2006 18:51:29 -0000      1.12
+++ src/preproc/preconv/preconv.cpp     13 Aug 2006 12:37:20 -0000      1.13
@@ -1110,7 +1110,7 @@
   // getopt() is called since the usage message shows the default
   // encoding.
   setlocale(LC_ALL, "");
-  char *locale = setlocale(LC_CTYPE, NULL);
+  char *locale = getlocale(LC_CTYPE);
   if (!locale || !strcmp(locale, "C") || !strcmp(locale, "POSIX"))
     default_encoding = "latin1";
   else




reply via email to

[Prev in Thread] Current Thread [Next in Thread]