PATCH: Fix for printing symbols and variable width underlining.


Subject: PATCH: Fix for printing symbols and variable width underlining.
From: Martin Sevior (msevior@kosal0.triumf.ca)
Date: Sun Jan 09 2000 - 16:09:11 CST


Hi,
        I found the Adobe "redbook" on Postscript in my colleagues office
and have been able to fix a couple of printing bugs on abiword. These were
the variable width underlining (you have issue "stroke" after the ML macro)
and printing symbol and dingbat fonts. For some reason that I don't
understand, every font was declared as a Latin1. Why? The macro "LAT" does
this. I removed it and I see no difference in the quality of regular fonts
but now "symbol" and "dingbat" fonts are printed.

The diff from my patched source (the one I sent in earlier)
follows. Just a couple of simple patches to xap_UnixPSGraphics.cpp in
directory:

src/af/xap/unix

=========================================================================
--- prev_graphics.cpp Mon Jan 10 19:56:48 2000
+++ xap_UnixPSGraphics.cpp Mon Jan 10 06:58:29 2000
@@ -347,20 +347,16 @@

 void PS_Graphics::drawLine(UT_sint32 x1, UT_sint32 y1, UT_sint32 x2, UT_sint32 y2)
 {
- // TODO This is used for lines in the document, as well as underlines
- // TODO and strikes.
         m_bNeedStroked = UT_TRUE;

         // emit a change in line width
- UT_sint32 old_linewidth = m_iLineWidth;
- m_iLineWidth = 10 + (UT_MAX(100,getFontAscent()) - 100)/30;
+
         _emit_SetLineWidth();
- // UT_DEBUGMSG(("SEVIOR m_ILineWidth= %d \n",m_iLineWidth));
         char buf[OUR_LINE_LIMIT*2];
 // UT_sint32 nA = getFontAscent();
- sprintf(buf,"%d %d %d %d ML\n", x2, y2, x1, y1);
+ sprintf(buf,"%d %d %d %d ML stroke \n", x2, y2, x1, y1);
         m_ps->writeBytes(buf);
- m_iLineWidth = old_linewidth;
+
 }

 void PS_Graphics::setLineWidth(UT_sint32 iLineWidth)
@@ -636,10 +632,12 @@
                         m_ps->writeBytes((UT_Byte *) &ch, 1);

                 unixfont->closePFA();
-
+ // What purpose does LAT serve? It just screws up printing
+ // of symbol and dingbat fonts? if LAT is useful we need to
+ // make sure it is only used for those fonts.
                 // after each font, change the encoding vector to ISO Latin1
                 g_snprintf(buf, 128, "/%s findfont\n"
- "LAT\n"
+ // "LAT\n"
                                  "/%s EXC\n",
                                  psf->getMetricsData()->gfi->fontName,
                                  psf->getMetricsData()->gfi->fontName);



This archive was generated by hypermail 2b25 : Sun Jan 09 2000 - 16:09:12 CST