* demo/xml2doc/templates/html/main.xsl,
* demo/xml2doc/templates/html/main_base64.xsl,
* demo/xml2doc/templates/pdf/line.xsl: Here.
---
scribo/ChangeLog | 8 ++++++
scribo/demo/xml2doc/templates/html/main.xsl | 2 +-
scribo/demo/xml2doc/templates/html/main_base64.xsl | 2 +-
scribo/demo/xml2doc/templates/pdf/line.xsl | 27 ++++++++++++++------
4 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index ab8c4c7..f6f1147 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,11 @@
+2011-09-15 Guillaume Lazzara <lazzara(a)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(a)lrde.epita.fr>
* README: Add more information.
diff --git a/scribo/demo/xml2doc/templates/html/main.xsl
b/scribo/demo/xml2doc/templates/html/main.xsl
index 0da3889..8c51ed2 100644
--- a/scribo/demo/xml2doc/templates/html/main.xsl
+++ b/scribo/demo/xml2doc/templates/html/main.xsl
@@ -10,7 +10,7 @@
.line
{
position:absolute;
- background-color:white;
+ /*background-color:white;*/
z-index:7;
/*white-space:pre;*/
diff --git a/scribo/demo/xml2doc/templates/html/main_base64.xsl
b/scribo/demo/xml2doc/templates/html/main_base64.xsl
index eb04722..79941f2 100644
--- a/scribo/demo/xml2doc/templates/html/main_base64.xsl
+++ b/scribo/demo/xml2doc/templates/html/main_base64.xsl
@@ -10,7 +10,7 @@
.line
{
position:absolute;
- background-color:white;
+ /*background-color:white;*/
z-index:7;
/* white-space:pre; */
diff --git a/scribo/demo/xml2doc/templates/pdf/line.xsl
b/scribo/demo/xml2doc/templates/pdf/line.xsl
index 66bf39a..0c1b9d7 100644
--- a/scribo/demo/xml2doc/templates/pdf/line.xsl
+++ b/scribo/demo/xml2doc/templates/pdf/line.xsl
@@ -25,6 +25,12 @@
</xsl:variable>
+ <!-- char_width -->
+ <xsl:variable name="char_width">
+ <xsl:value-of select="@charWidth" />
+ </xsl:variable>
+
+
<xsl:for-each select="Line">
<!-- x_height -->
@@ -143,6 +149,18 @@
<xsl:value-of select="$colour" />
</xsl:attribute>
+ <!-- Adjusting height if font is different from Times. -->
+ <xsl:variable name="fsize">
+ <xsl:choose>
+ <xsl:when test="($a + $d) > (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
in fo:block-->
@@ -177,14 +195,7 @@
<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:choose>
- <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:value-of select="$fsize" />px
</xsl:attribute>
<xsl:value-of select="@text"/>
--
1.7.2.5
Show replies by date