update to unrtf 0.21.8, fixing some issues discovered with afl

This commit is contained in:
sthen 2014-12-30 15:02:32 +00:00
parent b6daa37c34
commit f92365a87e
9 changed files with 34 additions and 876 deletions

View File

@ -1,29 +1,37 @@
# $OpenBSD: Makefile,v 1.13 2013/11/09 23:19:03 naddy Exp $
# $OpenBSD: Makefile,v 1.14 2014/12/30 15:02:32 sthen Exp $
COMMENT= RTF document converter
VERSION= 0.19.3
DISTNAME= unrtf-${VERSION}
REVISION= 1
DISTNAME= unrtf-0.21.8
CATEGORIES= textproc
HOMEPAGE= https://www.gnu.org/software/unrtf/unrtf.html
MASTER_SITES= ${MASTER_SITE_GNU:=unrtf/}
# GPL
# GPLv3+
PERMIT_PACKAGE_CDROM= Yes
WANTLIB= c
MAKE_FLAGS= CFLAGS='${CFLAGS}' CC='${CC}'
WANTLIB += c
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/unrtf ${PREFIX}/bin
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/unrtf
${INSTALL_DATA} ${WRKSRC}/doc/unrtf.html ${PREFIX}/share/doc/unrtf/unrtf.html
${INSTALL_MAN} ${WRKSRC}/unrtf.1 ${PREFIX}/man/man1
MODULES= converters/libiconv
TEST_TARGET= tests
TEST_FLAGS= PATH=${WRKSRC}
CONFIGURE_STYLE= gnu
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib -liconv"
# rm/bootstrap are only done because of symlinks to /usr/share/auto*
# in ${WRKSRC}/config for missing/etc.
#
BUILD_DEPENDS= ${MODGNU_AUTOCONF_DEPENDS} \
${MODGNU_AUTOMAKE_DEPENDS}
AUTOCONF_VERSION= 2.69
AUTOMAKE_VERSION= 1.11
post-patch:
rm ${WRKSRC}/config/*
cd ${WRKSRC}; AUTOCONF_VERSION=${AUTOCONF_VERSION} \
AUTOMAKE_VERSION=${AUTOMAKE_VERSION} ./bootstrap
.include <bsd.port.mk>

View File

@ -1,5 +1,2 @@
MD5 (unrtf-0.19.3.tar.gz) = 5+7cpVnv2Uuvb5VB11EKmw==
RMD160 (unrtf-0.19.3.tar.gz) = EnOXEq7NO8vXMMtn5/x+37wyECQ=
SHA1 (unrtf-0.19.3.tar.gz) = r2VLKnmk+gYI26RRofLQsVk5mKU=
SHA256 (unrtf-0.19.3.tar.gz) = Wq7egLr3M6ed6xMhD/MywTjwrdlhGlHxLvdSKYg44k8=
SIZE (unrtf-0.19.3.tar.gz) = 127770
SHA256 (unrtf-0.21.8.tar.gz) = BXhrxew2Sxd+qP8eF2a6CUosgbD3Do6IGi6wIZBuaVY=
SIZE (unrtf-0.21.8.tar.gz) = 773920

View File

@ -1,21 +0,0 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2002/08/21 15:43:37 espie Exp $
--- Makefile.orig Wed Oct 3 06:45:59 2001
+++ Makefile Wed Aug 21 17:29:51 2002
@@ -35,7 +35,7 @@ OBJS=convert.o word.o error.o main.o has
TARGET=unrtf
${TARGET}: ${OBJS}
- gcc ${OBJS} -o ${TARGET}
+ $(CC) $(CFLAGS) ${OBJS} -o ${TARGET}
clean:
rm -f ${OBJS} ${TARGET} bcount bcount.o
@@ -46,7 +46,7 @@ tidy:
tests:
${TARGET} test/table.rtf > test/table.html
- ${TARGET} test/slashnewline.rtf > test/slashnewline.html
+ ${TARGET} test/slashnew.rtf > test/slashnew.html
${TARGET} test/fontface.rtf > test/fontface.html
${TARGET} test/fontsize.rtf > test/fontsize.html

View File

@ -1,84 +0,0 @@
$OpenBSD: patch-convert_c,v 1.2 2005/05/15 18:09:41 db Exp $
--- convert.c.orig Thu Feb 19 00:35:03 2004
+++ convert.c Thu May 12 13:03:29 2005
@@ -341,7 +341,7 @@ process_font_table (Word *w)
while(w2) {
tmp = word_string (w2);
if (tmp && tmp[0] != '\\')
- strcat(name,tmp);
+ strlcat(name,tmp,sizeof(name) - strlen(name) - 1);
w2=w2->next;
}
@@ -676,7 +676,7 @@ cmd_cf (Word *w, int align, char has_par
}
else
{
- sprintf (str,"#%02x%02x%02x",
+ snprintf (str, sizeof(str), "#%02x%02x%02x",
color_table[num].r,
color_table[num].g,
color_table[num].b);
@@ -703,7 +703,7 @@ cmd_cb (Word *w, int align, char has_par
}
else
{
- sprintf (str,"#%02x%02x%02x",
+ snprintf (str, sizeof(str), "#%02x%02x%02x",
color_table[num].r,
color_table[num].g,
color_table[num].b);
@@ -728,7 +728,7 @@ cmd_fs (Word *w, int align, char has_par
/* Note, fs20 means 10pt */
points /= 2;
- sprintf (str,"%d",points);
+ snprintf (str, sizeof(str), "%d",points);
attr_push(ATTR_FONTSIZE,str);
return FALSE;
@@ -862,7 +862,7 @@ cmd_highlight (Word *w, int align, char
}
else
{
- sprintf (str,"#%02x%02x%02x",
+ snprintf (str, sizeof(str), "#%02x%02x%02x",
color_table[num].r,
color_table[num].g,
color_table[num].b);
@@ -1019,7 +1019,7 @@ static int
cmd_expand (Word *w, int align, char has_param, short param) {
char str[10];
if (has_param) {
- sprintf (str, "%d", param/4);
+ snprintf (str, sizeof(str), "%d", param/4);
if (!param)
attr_pop(ATTR_EXPAND);
else
@@ -1043,7 +1043,7 @@ cmd_emboss (Word *w, int align, char has
attr_pop(ATTR_EMBOSS);
else
{
- sprintf (str, "%d", param);
+ snprintf (str, sizeof(str), "%d", param);
attr_push(ATTR_EMBOSS, str);
}
return FALSE;
@@ -1064,7 +1064,7 @@ cmd_engrave (Word *w, int align, char ha
attr_pop(ATTR_ENGRAVE);
else
{
- sprintf (str, "%d", param);
+ snprintf (str, sizeof(str), "%d", param);
attr_push(ATTR_ENGRAVE, str);
}
return FALSE;
@@ -2610,7 +2610,7 @@ word_print_core (Word *w)
case PICT_DI: ext="dib"; break; /* Device independent bitmap=??? */
case PICT_PM: ext="pmm"; break; /* OS/2 metafile=??? */
}
- sprintf (picture_path, "pict%03d.%s",
+ snprintf (picture_path, sizeof(picture_path), "pict%03d.%s",
picture_file_number++,ext);
f=fopen(picture_path,"w");
}

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-defs_h,v 1.1 2005/05/15 18:09:41 db Exp $
--- defs.h.orig Thu May 12 13:07:16 2005
+++ defs.h Thu May 12 13:07:26 2005
@@ -37,7 +37,7 @@
*--------------------------------------------------------------------*/
-#define PROGRAM_VERSION "0.19.2"
+#define PROGRAM_VERSION "0.19.3"
#define PROGRAM_NAME "UnRTF"
#define PROGRAM_WEBSITE "http://www.gnu.org/software/unrtf/unrtf.html"

View File

@ -1,19 +0,0 @@
$OpenBSD: patch-malloc_c,v 1.1 2005/05/15 18:09:41 db Exp $
--- malloc.c.orig Thu Feb 19 00:35:03 2004
+++ malloc.c Thu May 12 12:51:46 2005
@@ -39,14 +39,8 @@
#include <stdio.h>
#include <string.h>
-#if linux /* daved - 0.19.0 */
+#if linux || defined(__OpenBSD__) /* daved - 0.19.0 */
#include <stdlib.h>
-#endif
-
-#if AMIGA
-#include <stdlib.h>
-#else
-#include <malloc.h>
#endif
#include "error.h"

View File

@ -1,21 +0,0 @@
$OpenBSD: patch-output_c,v 1.1 2005/05/15 18:09:41 db Exp $
--- output.c.orig Thu May 12 13:04:27 2005
+++ output.c Thu May 12 13:04:57 2005
@@ -218,7 +218,7 @@ op_begin_std_fontsize (OutputPersonality
if (!found_std_expr) {
if (op->fontsize_begin) {
char expr[16];
- sprintf (expr, "%d", size);
+ snprintf (expr, sizeof(expr), "%d", size);
printf (op->fontsize_begin, expr);
} else {
/* If we cannot write out a change for the exact
@@ -347,7 +347,7 @@ op_end_std_fontsize (OutputPersonality *
if (!found_std_expr) {
if (op->fontsize_end) {
char expr[16];
- sprintf (expr, "%d", size);
+ snprintf (expr, sizeof(expr), "%d", size);
printf (op->fontsize_end, expr);
} else {
/* If we cannot write out a change for the exact

View File

@ -1,696 +0,0 @@
$OpenBSD: patch-ps_c,v 1.2 2005/05/15 18:09:41 db Exp $
--- ps.c.orig Thu Feb 19 00:35:03 2004
+++ ps.c Thu May 12 12:46:35 2005
@@ -116,352 +116,350 @@ static char* cp850 [] = {
-#define PS_END "\
-%% --------- \n\n\
- didShowPage not { \n\
- showpage \n\
- } if\n\n\
-%%%%EOF\n"
+#define PS_END \
+"%% --------- \n\n"\
+" didShowPage not { \n"\
+" showpage \n"\
+" } if\n\n"\
+"%%%%EOF\n"
-#define PS_START "\
-%%%%!PS\n\
-%%--------------------------------------------------------------------------\n\
-%% GNU UnRTF, a command-line program to convert RTF documents to other formats.\n\
-%% Copyright (C) 2000,2001 Zachary Thayer Smith\n\
-%%\n\
-%% This program is free software; you can redistribute it and/or modify\n\
-%% it under the terms of the GNU General Public License as published by\n\
-%% the Free Software Foundation; either version 2 of the License, or\n\
-%% (at your option) any later version.\n\
-%%\n\
-%% This program is distributed in the hope that it will be useful,\n\
-%% but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
-%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
-%% GNU General Public License for more details.\n\
-%%\n\
-%% You should have received a copy of the GNU General Public License\n\
-%% along with this program; if not, write to the Free Software\n\
-%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n\
-%%\n\
-%% The author is reachable by electronic mail at tuorfa@yahoo.com.\n\
-%%--------------------------------------------------------------------------\n\
-%%%%EndComments \n\
-%%\n\
-%% --------- Note, this PS code is unfinished -------- \n\
-%% --------- Note, this PS code is unfinished -------- \n\
-%% --------- Note, this PS code is unfinished -------- \n\
-%% --------- Note, this PS code is unfinished -------- \n\
-%% --------- Note, this PS code is unfinished -------- \n\
-%%\n\
-%% ----------- Variables ------------\n\
-/fontFamily /Times def\n\
-/fontAscent 0 def %% ascent for current font\n\
-/fontDescent 0 def %% descent for current font\n\
-/lineAscent 0 def \n\
-/lineDescent 0 def \n\
-/pageWidthInches 8.5 def \n\
-/pageHeightInches 11 def \n\
-/leftMargin 20 def \n\
-/rightMargin 20 def \n\
-/topMargin 20 def \n\
-/bottomMargin 20 def \n\
-/DPI 72 def \n\
-/pageWidth pageWidthInches DPI mul def \n\
-/rightLimit pageWidth rightMargin sub def \n\
-/pageHeight pageHeightInches DPI mul def \n\
-/x 0 def \n\
-/y 0 def \n\
-/bold false def \n\
-/italic false def \n\
-/underline false def \n\
-/overline false def \n\
-/intercharSpace 0 def \n\
-/strike false def \n\
-/outline false def \n\
-/shadow false def \n\
-/fontSize 12 def \n\
-/didBR false def \n\
-/didParSkip false def \n\
-/didShowPage false def \n\
-%%------------------------------------------------------\n\
-%% Set up the ISO fonts \n\
-\n\
-%% Times \n\
-%% ----- \n\
-/Times-Roman findfont dup length dict begin { \n\
- 1 index /FID ne { def } { pop pop } ifelse \n\
-} forall \n\
-/Encoding ISOLatin1Encoding def \n\
-currentdict end \n\
-/TRomanISO exch definefont pop \n\n\
-/Times-Bold findfont dup length dict begin { \n\
- 1 index /FID ne { def } { pop pop } ifelse \n\
-} forall \n\
-/Encoding ISOLatin1Encoding def \n\
-currentdict end \n\
-/TBoldISO exch definefont pop \n\n\
-/Times-BoldItalic findfont dup length dict begin { \n\
- 1 index /FID ne { def } { pop pop } ifelse \n\
-} forall \n\
-/Encoding ISOLatin1Encoding def \n\
-currentdict end \n\
-/TBoldItalicISO exch definefont pop \n\n\
-/Times-Italic findfont dup length dict begin { \n\
- 1 index /FID ne { def } { pop pop } ifelse \n\
-} forall \n\
-/Encoding ISOLatin1Encoding def \n\
-currentdict end \n\
-/TItalicISO exch definefont pop \n\n\
-%% Courier \n\
-%% ----- \n\
-/Courier-Roman findfont dup length dict begin { \n\
- 1 index /FID ne { def } { pop pop } ifelse \n\
-} forall \n\
-/Encoding ISOLatin1Encoding def \n\
-currentdict end \n\
-/CRomanISO exch definefont pop \n\n\
-/Courier-Bold findfont dup length dict begin { \n\
- 1 index /FID ne { def } { pop pop } ifelse \n\
-} forall \n\
-/Encoding ISOLatin1Encoding def \n\
-currentdict end \n\
-/CBoldISO exch definefont pop \n\n\
-/Courier-BoldItalic findfont dup length dict begin { \n\
- 1 index /FID ne { def } { pop pop } ifelse \n\
-} forall \n\
-/Encoding ISOLatin1Encoding def \n\
-currentdict end \n\
-/CBoldItalicISO exch definefont pop \n\n\
-/Courier-Italic findfont dup length dict begin { \n\
- 1 index /FID ne { def } { pop pop } ifelse \n\
-} forall \n\
-/Encoding ISOLatin1Encoding def \n\
-currentdict end \n\
-/CItalicISO exch definefont pop \n\n\
-%% Symbol \n\
-%% ----- \n\
-/Symbol-Roman findfont dup length dict begin { \n\
- 1 index /FID ne { def } { pop pop } ifelse \n\
-} forall \n\
-/Encoding ISOLatin1Encoding def \n\
-currentdict end \n\
-/SRomanISO exch definefont pop \n\n\
-/Symbol-Bold findfont dup length dict begin { \n\
- 1 index /FID ne { def } { pop pop } ifelse \n\
-} forall \n\
-/Encoding ISOLatin1Encoding def \n\
-currentdict end \n\
-/SBoldISO exch definefont pop \n\n\
-/Symbol-BoldItalic findfont dup length dict begin { \n\
- 1 index /FID ne { def } { pop pop } ifelse \n\
-} forall \n\
-/Encoding ISOLatin1Encoding def \n\
-currentdict end \n\
-/SBoldItalicISO exch definefont pop \n\n\
-/Symbol-Italic findfont dup length dict begin { \n\
- 1 index /FID ne { def } { pop pop } ifelse \n\
-} forall \n\
-/Encoding ISOLatin1Encoding def \n\
-currentdict end \n\
-/SItalicISO exch definefont pop \n\n\
-%% Helvetica \n\
-%% --------- \n\
-/Helvetica-Roman findfont dup length dict begin { \n\
- 1 index /FID ne { def } { pop pop } ifelse \n\
-} forall \n\
-/Encoding ISOLatin1Encoding def \n\
-currentdict end \n\
-/HRomanISO exch definefont pop \n\n\
-/Helvetica-Bold findfont dup length dict begin { \n\
- 1 index /FID ne { def } { pop pop } ifelse \n\
-} forall \n\
-/Encoding ISOLatin1Encoding def \n\
-currentdict end \n\
-/HBoldISO exch definefont pop \n\n\
-/Helvetica-BoldOblique findfont dup length dict begin { \n\
- 1 index /FID ne { def } { pop pop } ifelse \n\
-} forall \n\
-/Encoding ISOLatin1Encoding def \n\
-currentdict end \n\
-/HBoldItalicISO exch definefont pop \n\n\
-/Helvetica-Oblique findfont dup length dict begin { \n\
- 1 index /FID ne { def } { pop pop } ifelse \n\
-} forall \n\
-/Encoding ISOLatin1Encoding def \n\
-currentdict end \n\
-/HItalicISO exch definefont pop \n\n\
-%% \n\
-%% Ideally, before we can draw a line of text, we need to collect all the\n\
-%% words that will be on it, just as I do in my Beest HTML viewer, as well\n\
-%% as character attributes for each word. But for now, this implementation \n\
-%% does not bother. It determines the maximize ascent and descent after\n\
-%% drawing the text, not before. XX\n\
-%% \n\
-%% ----------- Functions ------------\n\
-/updateFont { \n\
- /f0 null def \n\
- (Times) fontFamily eq (Times New Roman) fontFamily eq or { \n\
- bold { \n\
- italic { /TBoldItalicISO } { /TBoldISO } ifelse \n\
- } { \n\
- italic { /TItalicISO } { /TRomanISO } ifelse \n\
- } \n\
- ifelse \n\
- } if \n\
- (Helvetica) fontFamily eq (Arial) fontFamily eq or { \n\
- bold { \n\
- italic { /HBoldItalicISO } { /HBoldISO } ifelse \n\
- } { \n\
- italic { /HItalicISO } { /HRomanISO } ifelse \n\
- } \n\
- ifelse \n\
- } if \n\
- (Courier) fontFamily eq (Courier New) fontFamily eq or { \n\
- bold { \n\
- italic { /CBoldItalicISO } { /CBoldISO } ifelse \n\
- } { \n\
- italic { /CItalicISO } { /CRomanISO } ifelse \n\
- } \n\
- ifelse \n\
- } if \n\
- (Symbol) fontFamily eq { \n\
- bold { \n\
- italic { /SBoldItalicISO } { /SBoldISO } ifelse \n\
- } { \n\
- italic { /SItalicISO } { /SRomanISO } ifelse \n\
- } \n\
- ifelse \n\
- } if \n\n\
- findfont /f0 exch def \n\
- /bboxBottom f0 /FontBBox get 1 get 1000 div fontSize mul -1 mul def \n\
- /bboxTop f0 /FontBBox get 3 get 1000 div fontSize mul def \n\
- f0 fontSize scalefont setfont \n\
- lineAscent bboxTop lt { /lineAscent bboxTop def } if \n\
- lineDescent bboxBottom lt { /lineDescent bboxBottom def } if \n\
- /fontAscent bboxTop def \n\
- /fontDescent bboxBottom def \n\
-} def\n\
-/FS { \n\
- /fontSize exch def updateFont \n\
-} def \n\
-/F { \n\
- /fontFamily exch def updateFont \n\
-} def \n\
-/resetX { \n\
- /x leftMargin def\n\
-} def \n\
-/resetY { \n\
- /y pageHeight topMargin sub def \n\
-} def \n\
-/BR { \n\
- /oldx x def \n\
- /y y lineAscent lineDescent add sub def \n\
- resetX \n\
- y bottomMargin lt { \n\
- showpage \n\
- /didShowPage true \n\
- resetY \n\
- } if \n\
- oldx 0 eq didBR and { /didParSkip true def } if \n\
- /didBR true def \n\
- % /lineAscent 0 def \n\
- % /lineDescent 0 def \n\
-} def \n\
-/P { \n\
- didParSkip not { BR } if \n\
- didParSkip not { BR } if \n\
-} \n\
-def \n\
-/acharpath { \n\
- /acstr exch def pop /acsp exch def \n\
- newpath \n\
- str { \n\
- /ch exch def \n\
- 1 string 0 ch put false charpath \n\
- acsp 0 rmoveto \n\
- } forall \n\
-} def \n\
-/A { \n\
- /str exch def \n\
- /w str stringwidth pop \n\
- str length intercharSpace mul add \n\
- def \n\
- x w add rightLimit ge { BR } if \n\
- x y moveto \n\
- outline { \n\
- shadow { \n\
- 1 -0.1 0 { \n\
- /offset exch def \n\
- offset setgray \n\
- x offset 3 mul add y offset 3 mul sub moveto \n\
- intercharSpace 0 str acharpath \n\
- %% str false charpath \n\
- fontSize 30 div setlinewidth stroke \n\
- } for \n\
- 0 setgray \n\
- } { \n\
- intercharSpace 0 str acharpath \n\
- %% str false charpath \n\
- fontSize 30 div setlinewidth stroke \n\
- } ifelse \n\
- } { \n\
- shadow { \n\
- 1 -0.1 0 { \n\
- /offset exch def \n\
- offset setgray \n\
- x offset 3 mul add y offset 3 mul sub moveto \n\
- intercharSpace 0 str ashow \n\
- %% str show \n\
- } for \n\
- 0 setgray \n\
- } { \n\
- intercharSpace 0 str ashow \n\
- %% str show \n\
- } ifelse \n\
- } ifelse \n\
- strike { \n\
- newpath fontSize 20 div setlinewidth \n\
- x y fontAscent 0.32 mul add dup /y2 exch def moveto \n\
- x w add y2 lineto stroke \n\
- } if \n\
- underline { \n\
- newpath fontSize 20 div setlinewidth \n\
- x y fontAscent 0.2 mul sub dup /y2 exch def moveto \n\
- x w add y2 lineto stroke \n\
- } if \n\
- overline { \n\
- %% I don't think RTF supports this, but it can be used later. \n\
- newpath fontSize 20 div setlinewidth \n\
- x y fontAscent 1.2 mul add dup /y2 exch def moveto \n\
- x w add y2 lineto stroke \n\
- } if \n\
- /x x w add def \n\
- /didBR false def \n\
- /didShowPage false def \n\
-} def \n\
-\n\
-%% These are only binary for now \n\
-/X1 { /intercharSpace exch def } def\n\
-/X0 { /intercharSpace 0 def } def\n\
-/O1 { /outline false def } def\n\
-/O0 { /outline false def } def\n\
-/H1 { /shadow true def } def\n\
-/H0 { /shadow false def } def\n\
-/S1 { /strike true def } def\n\
-/S0 { /strike false def } def\n\
-/B1 { /bold true def updateFont } def\n\
-/B0 { /bold false def updateFont } def\n\
-/I1 { /italic true def updateFont } def\n\
-/I0 { /italic false def updateFont } def\n\
-/U1 { /underline true def } def\n\
-/U0 { /underline false def } def\n\
-updateFont \n\
-resetX resetY \n\
-\n\
-"
+#define PS_START \
+"%%%%!PS\n"\
+"%%--------------------------------------------------------------------------\n"\
+"%% GNU UnRTF, a command-line program to convert RTF documents to other formats.\n"\
+"%% Copyright (C) 2000,2001 Zachary Thayer Smith\n"\
+"%%\n"\
+"%% This program is free software; you can redistribute it and/or modify\n"\
+"%% it under the terms of the GNU General Public License as published by\n"\
+"%% the Free Software Foundation; either version 2 of the License, or\n"\
+"%% (at your option) any later version.\n"\
+"%%\n"\
+"%% This program is distributed in the hope that it will be useful,\n"\
+"%% but WITHOUT ANY WARRANTY; without even the implied warranty of\n"\
+"%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"\
+"%% GNU General Public License for more details.\n"\
+"%%\n"\
+"%% You should have received a copy of the GNU General Public License\n"\
+"%% along with this program; if not, write to the Free Software\n"\
+"%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n"\
+"%%\n"\
+"%% The author is reachable by electronic mail at tuorfa@yahoo.com.\n"\
+"%%--------------------------------------------------------------------------\n"\
+"%%%%EndComments \n"\
+"%%\n"\
+"%% --------- Note, this PS code is unfinished -------- \n"\
+"%% --------- Note, this PS code is unfinished -------- \n"\
+"%% --------- Note, this PS code is unfinished -------- \n"\
+"%% --------- Note, this PS code is unfinished -------- \n"\
+"%%\n"\
+"%% ----------- Variables ------------\n"\
+"/fontFamily /Times def\n"\
+"/fontAscent 0 def %% ascent for current font\n"\
+"/fontDescent 0 def %% descent for current font\n"\
+"/lineAscent 0 def \n"\
+"/lineDescent 0 def \n"\
+"/pageWidthInches 8.5 def \n"\
+"/pageHeightInches 11 def \n"\
+"/leftMargin 20 def \n"\
+"/rightMargin 20 def \n"\
+"/topMargin 20 def \n"\
+"/bottomMargin 20 def \n"\
+"/DPI 72 def \n"\
+"/pageWidth pageWidthInches DPI mul def \n"\
+"/rightLimit pageWidth rightMargin sub def \n"\
+"/pageHeight pageHeightInches DPI mul def \n"\
+"/x 0 def \n"\
+"/y 0 def \n"\
+"/bold false def \n"\
+"/italic false def \n"\
+"/underline false def \n"\
+"/overline false def \n"\
+"/intercharSpace 0 def \n"\
+"/strike false def \n"\
+"/outline false def \n"\
+"/shadow false def \n"\
+"/fontSize 12 def \n"\
+"/didBR false def \n"\
+"/didParSkip false def \n"\
+"/didShowPage false def \n"\
+"%%------------------------------------------------------\n"\
+"%% Set up the ISO fonts \n"\
+"\n"\
+"%% Times \n"\
+"%% ----- \n"\
+"/Times-Roman findfont dup length dict begin { \n"\
+" 1 index /FID ne { def } { pop pop } ifelse \n"\
+"} forall \n"\
+"/Encoding ISOLatin1Encoding def \n"\
+"currentdict end \n"\
+"/TRomanISO exch definefont pop \n\n"\
+"/Times-Bold findfont dup length dict begin { \n"\
+" 1 index /FID ne { def } { pop pop } ifelse \n"\
+"} forall \n"\
+"/Encoding ISOLatin1Encoding def \n"\
+"currentdict end \n"\
+"/TBoldISO exch definefont pop \n\n"\
+"/Times-BoldItalic findfont dup length dict begin { \n"\
+" 1 index /FID ne { def } { pop pop } ifelse \n"\
+"} forall \n"\
+"/Encoding ISOLatin1Encoding def \n"\
+"currentdict end \n"\
+"/TBoldItalicISO exch definefont pop \n\n"\
+"/Times-Italic findfont dup length dict begin { \n"\
+" 1 index /FID ne { def } { pop pop } ifelse \n"\
+"} forall \n"\
+"/Encoding ISOLatin1Encoding def \n"\
+"currentdict end \n"\
+"/TItalicISO exch definefont pop \n\n"\
+"%% Courier \n"\
+"%% ----- \n"\
+"/Courier-Roman findfont dup length dict begin { \n"\
+" 1 index /FID ne { def } { pop pop } ifelse \n"\
+"} forall \n"\
+"/Encoding ISOLatin1Encoding def \n"\
+"currentdict end \n"\
+"/CRomanISO exch definefont pop \n\n"\
+"/Courier-Bold findfont dup length dict begin { \n"\
+" 1 index /FID ne { def } { pop pop } ifelse \n"\
+"} forall \n"\
+"/Encoding ISOLatin1Encoding def \n"\
+"currentdict end \n"\
+"/CBoldISO exch definefont pop \n\n"\
+"/Courier-BoldItalic findfont dup length dict begin { \n"\
+" 1 index /FID ne { def } { pop pop } ifelse \n"\
+"} forall \n"\
+"/Encoding ISOLatin1Encoding def \n"\
+"currentdict end \n"\
+"/CBoldItalicISO exch definefont pop \n\n"\
+"/Courier-Italic findfont dup length dict begin { \n"\
+" 1 index /FID ne { def } { pop pop } ifelse \n"\
+"} forall \n"\
+"/Encoding ISOLatin1Encoding def \n"\
+"currentdict end \n"\
+"/CItalicISO exch definefont pop \n\n"\
+"%% Symbol \n"\
+"%% ----- \n"\
+"/Symbol-Roman findfont dup length dict begin { \n"\
+" 1 index /FID ne { def } { pop pop } ifelse \n"\
+"} forall \n"\
+"/Encoding ISOLatin1Encoding def \n"\
+"currentdict end \n"\
+"/SRomanISO exch definefont pop \n\n"\
+"/Symbol-Bold findfont dup length dict begin { \n"\
+" 1 index /FID ne { def } { pop pop } ifelse \n"\
+"} forall \n"\
+"/Encoding ISOLatin1Encoding def \n"\
+"currentdict end \n"\
+"/SBoldISO exch definefont pop \n\n"\
+"/Symbol-BoldItalic findfont dup length dict begin { \n"\
+" 1 index /FID ne { def } { pop pop } ifelse \n"\
+"} forall \n"\
+"/Encoding ISOLatin1Encoding def \n"\
+"currentdict end \n"\
+"/SBoldItalicISO exch definefont pop \n\n"\
+"/Symbol-Italic findfont dup length dict begin { \n"\
+" 1 index /FID ne { def } { pop pop } ifelse \n"\
+"} forall \n"\
+"/Encoding ISOLatin1Encoding def \n"\
+"currentdict end \n"\
+"/SItalicISO exch definefont pop \n\n"\
+"%% Helvetica \n"\
+"%% --------- \n"\
+"/Helvetica-Roman findfont dup length dict begin { \n"\
+" 1 index /FID ne { def } { pop pop } ifelse \n"\
+"} forall \n"\
+"/Encoding ISOLatin1Encoding def \n"\
+"currentdict end \n"\
+"/HRomanISO exch definefont pop \n\n"\
+"/Helvetica-Bold findfont dup length dict begin { \n"\
+" 1 index /FID ne { def } { pop pop } ifelse \n"\
+"} forall \n"\
+"/Encoding ISOLatin1Encoding def \n"\
+"currentdict end \n"\
+"/HBoldISO exch definefont pop \n\n"\
+"/Helvetica-BoldOblique findfont dup length dict begin { \n"\
+" 1 index /FID ne { def } { pop pop } ifelse \n"\
+"} forall \n"\
+"/Encoding ISOLatin1Encoding def \n"\
+"currentdict end \n"\
+"/HBoldItalicISO exch definefont pop \n\n"\
+"/Helvetica-Oblique findfont dup length dict begin { \n"\
+" 1 index /FID ne { def } { pop pop } ifelse \n"\
+"} forall \n"\
+"/Encoding ISOLatin1Encoding def \n"\
+"currentdict end \n"\
+"/HItalicISO exch definefont pop \n\n"\
+"%% \n"\
+"%% Ideally, before we can draw a line of text, we need to collect all the\n"\
+"%% words that will be on it, just as I do in my Beest HTML viewer, as well\n"\
+"%% as character attributes for each word. But for now, this implementation \n"\
+"%% does not bother. It determines the maximize ascent and descent after\n"\
+"%% drawing the text, not before. XX\n"\
+"%% \n"\
+"%% ----------- Functions ------------\n"\
+"/updateFont { \n"\
+" /f0 null def \n"\
+" (Times) fontFamily eq (Times New Roman) fontFamily eq or { \n"\
+" bold { \n"\
+" italic { /TBoldItalicISO } { /TBoldISO } ifelse \n"\
+" } { \n"\
+" italic { /TItalicISO } { /TRomanISO } ifelse \n"\
+" } \n"\
+" ifelse \n"\
+" } if \n"\
+" (Helvetica) fontFamily eq (Arial) fontFamily eq or { \n"\
+" bold { \n"\
+" italic { /HBoldItalicISO } { /HBoldISO } ifelse \n"\
+" } { \n"\
+" italic { /HItalicISO } { /HRomanISO } ifelse \n"\
+" } \n"\
+" ifelse \n"\
+" } if \n"\
+" (Courier) fontFamily eq (Courier New) fontFamily eq or { \n"\
+" bold { \n"\
+" italic { /CBoldItalicISO } { /CBoldISO } ifelse \n"\
+" } { \n"\
+" italic { /CItalicISO } { /CRomanISO } ifelse \n"\
+" } \n"\
+" ifelse \n"\
+" } if \n"\
+" (Symbol) fontFamily eq { \n"\
+" bold { \n"\
+" italic { /SBoldItalicISO } { /SBoldISO } ifelse \n"\
+" } { \n"\
+" italic { /SItalicISO } { /SRomanISO } ifelse \n"\
+" } \n"\
+" ifelse \n"\
+" } if \n\n"\
+" findfont /f0 exch def \n"\
+" /bboxBottom f0 /FontBBox get 1 get 1000 div fontSize mul -1 mul def \n"\
+" /bboxTop f0 /FontBBox get 3 get 1000 div fontSize mul def \n"\
+" f0 fontSize scalefont setfont \n"\
+" lineAscent bboxTop lt { /lineAscent bboxTop def } if \n"\
+" lineDescent bboxBottom lt { /lineDescent bboxBottom def } if \n"\
+" /fontAscent bboxTop def \n"\
+" /fontDescent bboxBottom def \n"\
+"} def\n"\
+"/FS { \n"\
+" /fontSize exch def updateFont \n"\
+"} def \n"\
+"/F { \n"\
+" /fontFamily exch def updateFont \n"\
+"} def \n"\
+"/resetX { \n"\
+" /x leftMargin def\n"\
+"} def \n"\
+"/resetY { \n"\
+" /y pageHeight topMargin sub def \n"\
+"} def \n"\
+"/BR { \n"\
+" /oldx x def \n"\
+" /y y lineAscent lineDescent add sub def \n"\
+" resetX \n"\
+" y bottomMargin lt { \n"\
+" showpage \n"\
+" /didShowPage true \n"\
+" resetY \n"\
+" } if \n"\
+" oldx 0 eq didBR and { /didParSkip true def } if \n"\
+" /didBR true def \n"\
+" % /lineAscent 0 def \n"\
+" % /lineDescent 0 def \n"\
+"} def \n"\
+"/P { \n"\
+" didParSkip not { BR } if \n"\
+" didParSkip not { BR } if \n"\
+"} \n"\
+"def \n"\
+"/acharpath { \n"\
+" /acstr exch def pop /acsp exch def \n"\
+" newpath \n"\
+" str { \n"\
+" /ch exch def \n"\
+" 1 string 0 ch put false charpath \n"\
+" acsp 0 rmoveto \n"\
+" } forall \n"\
+"} def \n"\
+"/A { \n"\
+" /str exch def \n"\
+" /w str stringwidth pop \n"\
+" str length intercharSpace mul add \n"\
+" def \n"\
+" x w add rightLimit ge { BR } if \n"\
+" x y moveto \n"\
+" outline { \n"\
+" shadow { \n"\
+" 1 -0.1 0 { \n"\
+" /offset exch def \n"\
+" offset setgray \n"\
+" x offset 3 mul add y offset 3 mul sub moveto \n"\
+" intercharSpace 0 str acharpath \n"\
+" %% str false charpath \n"\
+" fontSize 30 div setlinewidth stroke \n"\
+" } for \n"\
+" 0 setgray \n"\
+" } { \n"\
+" intercharSpace 0 str acharpath \n"\
+" %% str false charpath \n"\
+" fontSize 30 div setlinewidth stroke \n"\
+" } ifelse \n"\
+" } { \n"\
+" shadow { \n"\
+" 1 -0.1 0 { \n"\
+" /offset exch def \n"\
+" offset setgray \n"\
+" x offset 3 mul add y offset 3 mul sub moveto \n"\
+" intercharSpace 0 str ashow \n"\
+" %% str show \n"\
+" } for \n"\
+" 0 setgray \n"\
+" } { \n"\
+" intercharSpace 0 str ashow \n"\
+" %% str show \n"\
+" } ifelse \n"\
+" } ifelse \n"\
+" strike { \n"\
+" newpath fontSize 20 div setlinewidth \n"\
+" x y fontAscent 0.32 mul add dup /y2 exch def moveto \n"\
+" x w add y2 lineto stroke \n"\
+" } if \n"\
+" underline { \n"\
+" newpath fontSize 20 div setlinewidth \n"\
+" x y fontAscent 0.2 mul sub dup /y2 exch def moveto \n"\
+" x w add y2 lineto stroke \n"\
+" } if \n"\
+" overline { \n"\
+" %% I don't think RTF supports this, but it can be used later. \n"\
+" newpath fontSize 20 div setlinewidth \n"\
+" x y fontAscent 1.2 mul add dup /y2 exch def moveto \n"\
+" x w add y2 lineto stroke \n"\
+" } if \n"\
+" /x x w add def \n"\
+" /didBR false def \n"\
+" /didShowPage false def \n"\
+"} def \n"\
+"\n"\
+"%% These are only binary for now \n"\
+"/X1 { /intercharSpace exch def } def\n"\
+"/X0 { /intercharSpace 0 def } def\n"\
+"/O1 { /outline false def } def\n"\
+"/O0 { /outline false def } def\n"\
+"/H1 { /shadow true def } def\n"\
+"/H0 { /shadow false def } def\n"\
+"/S1 { /strike true def } def\n"\
+"/S0 { /strike false def } def\n"\
+"/B1 { /bold true def updateFont } def\n"\
+"/B0 { /bold false def updateFont } def\n"\
+"/I1 { /italic true def updateFont } def\n"\
+"/I0 { /italic false def updateFont } def\n"\
+"/U1 { /underline true def } def\n"\
+"/U0 { /underline false def } def\n"\
+"updateFont \n"\
+"resetX resetY \n"\
+"\n"

View File

@ -1,5 +1,11 @@
@comment $OpenBSD: PLIST,v 1.2 2004/09/15 18:44:08 espie Exp $
bin/unrtf
@comment $OpenBSD: PLIST,v 1.3 2014/12/30 15:02:33 sthen Exp $
@bin bin/unrtf
@man man/man1/unrtf.1
share/doc/unrtf/
share/doc/unrtf/unrtf.html
share/unrtf/
share/unrtf/SYMBOL.charmap
share/unrtf/html.conf
share/unrtf/latex.conf
share/unrtf/rtf.conf
share/unrtf/text.conf
share/unrtf/troff_mm.conf
share/unrtf/vt.conf