adapt ui to loadDocument before setFont

This commit is contained in:
Qingping Hou
2013-01-13 10:22:33 +08:00
parent 71514001b0
commit 687aabc173
5 changed files with 42 additions and 15 deletions

View File

@@ -147,7 +147,7 @@ function CreDocument:init()
-- @TODO check the default view_mode to a global user configurable
-- variable 22.12 2012 (houqp)
ok, self._document = pcall(cre.openDocument, self.file, style_sheet,
ok, self._document = pcall(cre.newDocView, style_sheet,
Screen:getWidth(), Screen:getHeight(), self.PAGE_VIEW_MODE)
if not ok then
self.error_message = self.doc -- will contain error message
@@ -162,6 +162,10 @@ function CreDocument:init()
--self._document:setDefaultInterlineSpace(self.line_space_percent)
end
function CreDocument:loadDocument()
self._document:loadDocument(self.file)
end
function CreDocument:drawCurrentView(target, x, y, rect, pos)
tile_bb = Blitbuffer.new(rect.w, rect.h)
self._document:drawCurrentPage(tile_bb)