|
From: <doc...@us...> - 2007-09-07 23:32:47
|
Revision: 165
http://openpcl.svn.sourceforge.net/openpcl/?rev=165&view=rev
Author: documentsystems
Date: 2007-09-07 16:32:50 -0700 (Fri, 07 Sep 2007)
Log Message:
-----------
Howard Hoagland. Added 3 lines of code to fix bug 1790142 "Does not render", submitted By: David Hill of www.davesplanet.net, where if the horizontal cpi pitch is 0 in the PCL command "ESC ( s 0 h" in an input PCL file, that would cause the PCL parsing to stop.
Modified Paths:
--------------
openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java
Modified: openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java
===================================================================
--- openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java 2007-08-29 02:34:00 UTC (rev 164)
+++ openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java 2007-09-07 23:32:50 UTC (rev 165)
@@ -420,7 +420,13 @@
* @param pNumCharactersPerInch
*/
public void setFontHorizontalPitch(int pNumCharactersPerInch) {
- mCurrentHorizontalPitch = pNumCharactersPerInch;
+ if (pNumCharactersPerInch == 0) {
+ // Avoid divide by zero stops the PCL parsing when the passed in chars per inch is 0
+ mCurrentHorizontalPitch = 12;
+ } else {
+ mCurrentHorizontalPitch = pNumCharactersPerInch;
+ }
+
mCurrentHorizontalMotionIndexHMI = (120 / mCurrentHorizontalPitch);
// PriDebug.infoln(PriDebug.spacesForPclParseMsgs +
// "PriFonts set Horizontal Pitch (number of characters per inch) to " + mCurrentHorizontalPitch);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|