Commit bb574388 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Adjust font size in PDF reconstruction.

	* demo/xml2doc/templates/html/main.xsl,
	* demo/xml2doc/templates/html/main_base64.xsl,
	* demo/xml2doc/templates/pdf/line.xsl: Here.
parent 167d972d
2011-09-15 Guillaume Lazzara <lazzara@caroussel.lrde.epita.fr>
Adjust font size in PDF reconstruction.
* demo/xml2doc/templates/html/main.xsl,
* demo/xml2doc/templates/html/main_base64.xsl,
* demo/xml2doc/templates/pdf/line.xsl: Here.
2011-09-13 Guillaume Lazzara <z@lrde.epita.fr> 2011-09-13 Guillaume Lazzara <z@lrde.epita.fr>
* README: Add more information. * README: Add more information.
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
.line .line
{ {
position:absolute; position:absolute;
background-color:white; /*background-color:white;*/
z-index:7; z-index:7;
/*white-space:pre;*/ /*white-space:pre;*/
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
.line .line
{ {
position:absolute; position:absolute;
background-color:white; /*background-color:white;*/
z-index:7; z-index:7;
/* white-space:pre; */ /* white-space:pre; */
......
...@@ -25,6 +25,12 @@ ...@@ -25,6 +25,12 @@
</xsl:variable> </xsl:variable>
<!-- char_width -->
<xsl:variable name="char_width">
<xsl:value-of select="@charWidth" />
</xsl:variable>
<xsl:for-each select="Line"> <xsl:for-each select="Line">
<!-- x_height --> <!-- x_height -->
...@@ -143,6 +149,18 @@ ...@@ -143,6 +149,18 @@
<xsl:value-of select="$colour" /> <xsl:value-of select="$colour" />
</xsl:attribute> </xsl:attribute>
<!-- Adjusting height if font is different from Times. -->
<xsl:variable name="fsize">
<xsl:choose>
<xsl:when test="($a + $d) &gt; (1.16 * (37 * $char_width) div 17)">
<xsl:value-of select="((37 * $char_width) div 17)" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="($a + $d)" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- if necessary, put letter-spacing="-Npt" ~ -3 <= N <= -1 <!-- if necessary, put letter-spacing="-Npt" ~ -3 <= N <= -1
in fo:block--> in fo:block-->
...@@ -177,14 +195,7 @@ ...@@ -177,14 +195,7 @@
<fo:block font-family="Times" wrap-option="no-wrap" white-space-collapse="true" text-align-last="justify" text-align="justify"> <fo:block font-family="Times" wrap-option="no-wrap" white-space-collapse="true" text-align-last="justify" text-align="justify">
<xsl:attribute name="font-size"> <xsl:attribute name="font-size">
<xsl:choose> <xsl:value-of select="$fsize" />px
<xsl:when test="($a + $d) > 50">
<xsl:value-of select="0.82 * ($a + $d)" />px
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="0.95 * ($a + $d)" />px
</xsl:otherwise>
</xsl:choose>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="@text"/> <xsl:value-of select="@text"/>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment