mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
This commit is contained in:
parent
ffd3ac2b21
commit
887718b331
@ -22,7 +22,7 @@ from PyQt4.QtGui import QGraphicsRectItem, QGraphicsScene, QPen, \
|
|||||||
QFont, QGraphicsItem, QGraphicsLineItem, QPixmap, \
|
QFont, QGraphicsItem, QGraphicsLineItem, QPixmap, \
|
||||||
QGraphicsPixmapItem, QTextCharFormat, QTextFrameFormat, \
|
QGraphicsPixmapItem, QTextCharFormat, QTextFrameFormat, \
|
||||||
QTextBlockFormat, QTextCursor, QTextImageFormat, \
|
QTextBlockFormat, QTextCursor, QTextImageFormat, \
|
||||||
QTextDocument
|
QTextDocument, QTextOption
|
||||||
|
|
||||||
from libprs500.ebooks.lrf.fonts import FONT_MAP
|
from libprs500.ebooks.lrf.fonts import FONT_MAP
|
||||||
from libprs500.gui2 import qstring_to_unicode
|
from libprs500.gui2 import qstring_to_unicode
|
||||||
@ -126,7 +126,7 @@ class Line(QGraphicsRectItem):
|
|||||||
'dashed' : QTextCharFormat.DashUnderline,
|
'dashed' : QTextCharFormat.DashUnderline,
|
||||||
'double' : QTextCharFormat.WaveUnderline,
|
'double' : QTextCharFormat.WaveUnderline,
|
||||||
}
|
}
|
||||||
|
dto = QTextOption(Qt.AlignJustify)
|
||||||
|
|
||||||
def __init__(self, offset, linespace, linelength, align, hyphenate, ts, block_id):
|
def __init__(self, offset, linespace, linelength, align, hyphenate, ts, block_id):
|
||||||
QGraphicsRectItem.__init__(self, 0, 0, 0, 0)
|
QGraphicsRectItem.__init__(self, 0, 0, 0, 0)
|
||||||
@ -187,7 +187,9 @@ class Line(QGraphicsRectItem):
|
|||||||
|
|
||||||
def create_text_item(self, ts):
|
def create_text_item(self, ts):
|
||||||
self.item = QGraphicsTextItem(self)
|
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()
|
f = self.cursor.currentFrame()
|
||||||
ff = QTextFrameFormat()
|
ff = QTextFrameFormat()
|
||||||
ff.setBorder(0)
|
ff.setBorder(0)
|
||||||
|
@ -169,8 +169,8 @@ def option_parser():
|
|||||||
default=False, action='store_true', dest='visual_debug')
|
default=False, action='store_true', dest='visual_debug')
|
||||||
parser.add_option('--disable-hyphenation', dest='hyphenate', default=True, action='store_false',
|
parser.add_option('--disable-hyphenation', dest='hyphenate', default=True, action='store_false',
|
||||||
help='Disable hyphenation. Should significantly speed up rendering.')
|
help='Disable hyphenation. Should significantly speed up rendering.')
|
||||||
parser.add_option('--profile', dest='profile', default='False', action='store_true',
|
parser.add_option('--profile', dest='profile', default=False, action='store_true',
|
||||||
help='Profile the LRf renderer')
|
help='Profile the LRF renderer')
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
def main(args=sys.argv, logger=None):
|
def main(args=sys.argv, logger=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user