This commit is contained in:
Kovid Goyal 2007-09-23 06:37:54 +00:00
parent ffd3ac2b21
commit 887718b331
2 changed files with 7 additions and 5 deletions

View File

@ -22,7 +22,7 @@ from PyQt4.QtGui import QGraphicsRectItem, QGraphicsScene, QPen, \
QFont, QGraphicsItem, QGraphicsLineItem, QPixmap, \
QGraphicsPixmapItem, QTextCharFormat, QTextFrameFormat, \
QTextBlockFormat, QTextCursor, QTextImageFormat, \
QTextDocument
QTextDocument, QTextOption
from libprs500.ebooks.lrf.fonts import FONT_MAP
from libprs500.gui2 import qstring_to_unicode
@ -126,7 +126,7 @@ class Line(QGraphicsRectItem):
'dashed' : QTextCharFormat.DashUnderline,
'double' : QTextCharFormat.WaveUnderline,
}
dto = QTextOption(Qt.AlignJustify)
def __init__(self, offset, linespace, linelength, align, hyphenate, ts, block_id):
QGraphicsRectItem.__init__(self, 0, 0, 0, 0)
@ -187,7 +187,9 @@ class Line(QGraphicsRectItem):
def create_text_item(self, ts):
self.item = QGraphicsTextItem(self)
self.cursor = QTextCursor(self.item.document())
doc = self.item.document()
doc.setDefaultTextOption(self.__class__.dto)
self.cursor = QTextCursor(doc)
f = self.cursor.currentFrame()
ff = QTextFrameFormat()
ff.setBorder(0)

View File

@ -169,8 +169,8 @@ def option_parser():
default=False, action='store_true', dest='visual_debug')
parser.add_option('--disable-hyphenation', dest='hyphenate', default=True, action='store_false',
help='Disable hyphenation. Should significantly speed up rendering.')
parser.add_option('--profile', dest='profile', default='False', action='store_true',
help='Profile the LRf renderer')
parser.add_option('--profile', dest='profile', default=False, action='store_true',
help='Profile the LRF renderer')
return parser
def main(args=sys.argv, logger=None):