Bug 3964 - Courier font not displaying/printing correctly
Summary: Courier font not displaying/printing correctly
Status: CLOSED DUPLICATE of bug 1180
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: awt renderer (show other bugs)
Version: all
Hardware: All Linux
: P3 major
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-04 03:09 UTC by rob anderson
Modified: 2012-04-01 13:47 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rob anderson 2001-10-04 03:09:05 UTC
I am trying to take an existing text report, and displaying it in a PDF 
document.
The text report is XML'd before being processed in XSL

e.g.

<?xml version="1.0"?>
<Report>
<Ln> SLR3     Customer Profitability-by a/c   ELAND ELECTRICAL LIMITED       
Period: 9 Date:04/10/01   Time: 9:20:53         Page:   1</Ln>
<Ln></Ln>
<Ln>  Print range:- FROM: A                 TO: B</Ln>
<Ln></Ln>
<Ln>Customer   Name                            Last      -------------- Period -
-------------    -------------- To Date -------------</Ln>
<Ln>Account                                    Invoiced       Sales           
Cost       %            Sales           Cost       %</Ln>
<Ln></Ln>
<Ln>A&amp;C308     A &amp; C ELECTRONICS LTD           31/05/00      ---
           ---           ---          ---           ---           ---</Ln>
<Ln>A&amp;D001     A &amp; D CARTWRIGHT DIST LTD       10/11/00      ---
           ---           ---            866.15        584.21     32.55</Ln>
<Ln>A1C312     A1 CABLE EXPRESS LTD            02/11/00      ---           ---
           ---            610.00        254.63     58.25</Ln>
<Ln>A1S147     A1 SOLO LTD                     26/07/00      ---           ---
           ---          ---           ---           ---</Ln>
<Ln>ACE888     ACESS                           25/05/99      ---           ---
           ---          ---           ---           ---</Ln>
<Ln>ACT166     ACTIFLEX FLEXIBLE TUBES LTD     15/11/99      ---           ---
           ---          ---           ---           ---</Ln>
<Ln>ADC001     ADCO INDUSTRIAL WEAR LTD        23/11/99      ---           ---
           ---          ---           ---           ---</Ln>
</Report>


The XSL script to convert this is:-

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Transform" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xml:space="preserve">
	<xsl:output method="xml" indent="no"/>
	<xsl:template match="/">
		<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
			<!-- defines the layout master -->
			<fo:layout-master-set>
				<fo:simple-page-master master-name="first" page-
width="29.7cm" page-height="21cm" margin-top="1cm" margin-bottom="1cm" margin-
left="1cm" margin-right="1cm">
					<fo:region-body margin-top="1mm"/>
					<fo:region-before extent="1mm"/>
					<fo:region-after extent="1mm"/>
				</fo:simple-page-master>
			</fo:layout-master-set>
			<!-- starts actual layout -->
			<fo:page-sequence master-name="first">
				<fo:title>Charisma Report</fo:title>
				<fo:flow flow-name="xsl-region-body">
					<!-- table start -->
					<fo:table border-width="0.1mm" border-
style="solid" border-color="light-grey">
						<fo:table-column column-
width="27.7cm"/>
						<fo:table-body>
							<xsl:for-each 
select="Report/Ln">
								<xsl:choose>
								
	<xsl:when test="contains(., 'Page')">
									
	<fo:table-row font-size="7pt" font-family="Courier" color="black" 
background-color="#e4e4e4" line-height="12pt" space-after.optimum="5pt" padding-
top="3pt">
										
	<fo:table-cell>
										
		<xsl:choose>
										
			<xsl:when test="position() = 1">
										
				<fo:block  white-space-
collapse="false"><xsl:value-of select="."/></fo:block>
										
			</xsl:when>
										
			<xsl:otherwise>
										
				<fo:block  break-before="page" keep-with-
previous="auto" white-space-collapse="false"><xsl:value-of 
select="."/></fo:block>
										
			</xsl:otherwise>
										
		</xsl:choose>
										
	</fo:table-cell>
									
	</fo:table-row>
								
	</xsl:when>
								
	<xsl:when test="contains(. , 'Customer ')">
									
	<fo:table-row font-size="7pt" font-family="Courier" color="black" 
background-color="#e4e4e4" line-height="12pt" space-after.optimum="5pt" padding-
top="3pt">
										
	<fo:table-cell>
										
		<fo:block white-space-collapse="false"><xsl:value-of 
select="."/></fo:block>
										
	</fo:table-cell>
									
	</fo:table-row>
								
	</xsl:when>
								
	<xsl:when test="contains(. , 'Invoiced ')">
									
	<fo:table-row font-size="7pt" font-family="Courier" color="black" 
background-color="#e4e4e4" line-height="12pt" space-after.optimum="5pt" padding-
top="3pt">
										
	<fo:table-cell>
										
		<fo:block white-space-collapse="false"><xsl:value-of 
select="."/></fo:block>
										
	</fo:table-cell>
									
	</fo:table-row>
								
	</xsl:when>
								
	<xsl:otherwise>
									
	<fo:table-row font-size="7pt" font-family="Courier" line-height="10pt" 
padding-top="2pt">
										
	<fo:table-cell>
										
		<fo:block white-space-collapse="false"><xsl:value-of 
select="."/></fo:block>
										
	</fo:table-cell>
									
	</fo:table-row>
								
	</xsl:otherwise>
								</xsl:choose>
							</xsl:for-each>
						</fo:table-body>
					</fo:table>
				</fo:flow>
			</fo:page-sequence>
		</fo:root>
	</xsl:template>
</xsl:stylesheet>

That in turn gives me the following 'fo' file...


<?xml version="1.0" encoding="UTF-8"?>

		<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
			
			<fo:layout-master-set>
				<fo:simple-page-master margin-right="1cm" 
margin-left="1cm" margin-bottom="1cm" margin-top="1cm" page-height="21cm" page-
width="29.7cm" master-name="first">
					<fo:region-body margin-top="1mm"/>
					<fo:region-before extent="1mm"/>
					<fo:region-after extent="1mm"/>
				</fo:simple-page-master>
			</fo:layout-master-set>
			
			<fo:page-sequence master-name="first">
				<fo:title>Charisma Report</fo:title>
				<fo:flow flow-name="xsl-region-body">
					
					<fo:table border-color="light-grey" 
border-style="solid" border-width="0.1mm">
						<fo:table-column column-
width="27.7cm"/>
						<fo:table-body>
							
								
									
	<fo:table-row padding-top="3pt" space-after.optimum="5pt" line-
height="12pt" background-color="#e4e4e4" color="black" font-family="Courier" 
font-size="7pt">
										
	<fo:table-cell>
										
		
										
				<fo:block white-space-collapse="false"> 
SLR3     Customer Profitability-by a/c   ELAND ELECTRICAL LIMITED       Period: 
9 Date:04/10/01   Time: 9:20:53         Page:   1</fo:block>
										
			
										
	</fo:table-cell>
									
	</fo:table-row>
									
							
								
									
	<fo:table-row padding-top="2pt" line-height="10pt" font-
family="Courier" font-size="7pt">
										
	<fo:table-cell>
										
		<fo:block white-space-collapse="false"/>
										
	</fo:table-cell>
									
	</fo:table-row>
									
							
								
									
	<fo:table-row padding-top="2pt" line-height="10pt" font-
family="Courier" font-size="7pt">
										
	<fo:table-cell>
										
		<fo:block white-space-collapse="false">  Print range:- FROM: 
A                 TO: B</fo:block>
										
	</fo:table-cell>
									
	</fo:table-row>
									
							
								
									
	<fo:table-row padding-top="2pt" line-height="10pt" font-
family="Courier" font-size="7pt">
										
	<fo:table-cell>
										
		<fo:block white-space-collapse="false"/>
										
	</fo:table-cell>
									
	</fo:table-row>
									
							
								
									
	<fo:table-row padding-top="3pt" space-after.optimum="5pt" line-
height="12pt" background-color="#e4e4e4" color="black" font-family="Courier" 
font-size="7pt">
										
	<fo:table-cell>
										
		<fo:block white-space-collapse="false">Customer   
Name                            Last      -------------- Period --------------
    -------------- To Date -------------</fo:block>
										
	</fo:table-cell>
									
	</fo:table-row>
									
							
								
									
	<fo:table-row padding-top="3pt" space-after.optimum="5pt" line-
height="12pt" background-color="#e4e4e4" color="black" font-family="Courier" 
font-size="7pt">
										
	<fo:table-cell>
										
		<fo:block white-space-
collapse="false">Account                                    Invoiced       
Sales           Cost       %            Sales           Cost       %</fo:block>
										
	</fo:table-cell>
									
	</fo:table-row>
									
							
								
									
	<fo:table-row padding-top="2pt" line-height="10pt" font-
family="Courier" font-size="7pt">
										
	<fo:table-cell>
										
		<fo:block white-space-collapse="false"/>
										
	</fo:table-cell>
									
	</fo:table-row>
									
							
								
									
	<fo:table-row padding-top="2pt" line-height="10pt" font-
family="Courier" font-size="7pt">
										
	<fo:table-cell>
										
		<fo:block white-space-collapse="false">A&amp;C308     A &amp; C 
ELECTRONICS LTD           31/05/00      ---           ---           ---
          ---           ---           ---</fo:block>
										
	</fo:table-cell>
									
	</fo:table-row>
									
							
								
									
	<fo:table-row padding-top="2pt" line-height="10pt" font-
family="Courier" font-size="7pt">
										
	<fo:table-cell>
										
		<fo:block white-space-collapse="false">A&amp;D001     A &amp; D 
CARTWRIGHT DIST LTD       10/11/00      ---           ---           ---
            866.15        584.21     32.55</fo:block>
										
	</fo:table-cell>
									
	</fo:table-row>
									
							
								
									
	<fo:table-row padding-top="2pt" line-height="10pt" font-
family="Courier" font-size="7pt">
										
	<fo:table-cell>
										
		<fo:block white-space-collapse="false">A1C312     A1 CABLE 
EXPRESS LTD            02/11/00      ---           ---           ---            
610.00        254.63     58.25</fo:block>
										
	</fo:table-cell>
									
	</fo:table-row>
									
							
								
									
	<fo:table-row padding-top="2pt" line-height="10pt" font-
family="Courier" font-size="7pt">
										
	<fo:table-cell>
										
		<fo:block white-space-collapse="false">A1S147     A1 SOLO 
LTD                     26/07/00      ---           ---           ---          -
--           ---           ---</fo:block>
										
	</fo:table-cell>
									
	</fo:table-row>
									
							
								
									
	<fo:table-row padding-top="2pt" line-height="10pt" font-
family="Courier" font-size="7pt">
										
	<fo:table-cell>
										
		<fo:block white-space-collapse="false">ACE888     
ACESS                           25/05/99      ---           ---           ---
          ---           ---           ---</fo:block>
										
	</fo:table-cell>
									
	</fo:table-row>
									
							
								
									
	<fo:table-row padding-top="2pt" line-height="10pt" font-
family="Courier" font-size="7pt">
										
	<fo:table-cell>
										
		<fo:block white-space-collapse="false">ACT166     ACTIFLEX 
FLEXIBLE TUBES LTD     15/11/99      ---           ---           ---          --
-           ---           ---</fo:block>
										
	</fo:table-cell>
									
	</fo:table-row>
									
							
								
									
	<fo:table-row padding-top="2pt" line-height="10pt" font-
family="Courier" font-size="7pt">
										
	<fo:table-cell>
										
		<fo:block white-space-collapse="false">ADC001     ADCO 
INDUSTRIAL WEAR LTD        23/11/99      ---           ---           ---
          ---           ---           ---</fo:block>
										
	</fo:table-cell>
									
	</fo:table-row>
									
							
						</fo:table-body>
					</fo:table>
				</fo:flow>
			</fo:page-sequence>
		</fo:root>
	

Viewed in Acrobat Reader (3 or 5) this gives me the expected result of neatly 
aligned columns (cannot send the screen dump here)
However, if I use the Fop viewer/print, the columns are not vertically aligned -
 (more vertically challenged!)

Q:\merisma\repfo>java org.apache.fop.apps.Fop a.fo a.pdf
[INFO]: FOP 0.20.2
[INFO]: building formatting object tree
[INFO]: [1]
[INFO]: Parsing of document complete, stopping renderer

java org.apache.fop.apps.Fop a.fo -awt


Many thanks.


Rob Anderson
Comment 1 Oleg Tkachenko 2002-11-14 21:52:01 UTC

*** This bug has been marked as a duplicate of 1180 ***
Comment 2 Glenn Adams 2012-04-01 13:47:51 UTC
batch transition to closed remaining pre-FOP1.0 resolved bugs