From 73c09fbdbf2ced70e1ec43208085c0b4e34798ad Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 23 May 2007 18:19:59 +0000 Subject: [PATCH] Adjust baselineskip on font-delta. Use baselineskip rather than linespace in table code. --- src/libprs500/__init__.py | 2 +- src/libprs500/ebooks/lrf/__init__.py | 4 +++- src/libprs500/ebooks/lrf/html/convert_from.py | 3 ++- src/libprs500/ebooks/lrf/html/table.py | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/libprs500/__init__.py b/src/libprs500/__init__.py index b3cfc8adab..738279ab33 100644 --- a/src/libprs500/__init__.py +++ b/src/libprs500/__init__.py @@ -33,7 +33,7 @@ You may have to adjust the GROUP and the location of the rules file to suit your distribution. """ -__version__ = "0.3.38" +__version__ = "0.3.39" __docformat__ = "epytext" __author__ = "Kovid Goyal " diff --git a/src/libprs500/ebooks/lrf/__init__.py b/src/libprs500/ebooks/lrf/__init__.py index c792407f8a..8aab6e7c38 100644 --- a/src/libprs500/ebooks/lrf/__init__.py +++ b/src/libprs500/ebooks/lrf/__init__.py @@ -91,6 +91,8 @@ def Book(font_delta=0, header=None, profile=PRS500_PROFILE, **settings): ps['header'] = header ps['header'] = hdr ps['topmargin'] = 10 + baselineskip = (12 + 2*font_delta)*10 return _Book(textstyledefault=dict(fontsize=100+font_delta*20, - parindent=80, linespace=12), \ + parindent=80, linespace=12, + baselineskip=baselineskip), \ pagestyledefault=ps, **settings) \ No newline at end of file diff --git a/src/libprs500/ebooks/lrf/html/convert_from.py b/src/libprs500/ebooks/lrf/html/convert_from.py index 7c9158f810..8169253b84 100644 --- a/src/libprs500/ebooks/lrf/html/convert_from.py +++ b/src/libprs500/ebooks/lrf/html/convert_from.py @@ -1238,7 +1238,8 @@ def parse_options(argv=None, cli=True): laf.add_option('--cover', action='store', dest='cover', default=None, \ help='Path to file containing image to be used as cover') laf.add_option('--font-delta', action='store', type='int', default=0, \ - help="""Increase the font size by 2 * FONT_DELTA pts. + help="""Increase the font size by 2 * FONT_DELTA pts and + the line spacing by FONT_DELTA pts. If FONT_DELTA is negative, the font size is decreased.""", dest='font_delta') laf.add_option('--disable-autorotation', action='store_true', default=False, diff --git a/src/libprs500/ebooks/lrf/html/table.py b/src/libprs500/ebooks/lrf/html/table.py index 153f98e359..f47d21068c 100644 --- a/src/libprs500/ebooks/lrf/html/table.py +++ b/src/libprs500/ebooks/lrf/html/table.py @@ -163,7 +163,7 @@ class Cell(object): ts = tb.textStyle.attrs default_font = get_font(ts['fontfacename'], self.pts_to_pixels(ts['fontsize'])) parindent = self.pts_to_pixels(ts['parindent']) - ls, ws = self.pts_to_pixels(ts['linespace']), self.pts_to_pixels(ts['wordspace']) + ls, ws = self.pts_to_pixels(ts['baselineskip']), self.pts_to_pixels(ts['wordspace']) top, bottom, left, right = 0, 0, parindent, parindent def add_word(width, height, left, right, top, bottom):