mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
update mupdf submodule to commit bdb6b688a238df56b2cf47fa17a08a4dd4b7a122 and small modification to source code to adapt to mupdf modifications
This commit is contained in:
2
Makefile
2
Makefile
@@ -85,7 +85,7 @@ einkfb.o input.o: %.o: %.c
|
||||
$(CC) -c $(KPDFREADER_CFLAGS) $(EMU_CFLAGS) $< -o $@
|
||||
|
||||
ft.o: %.o: %.c
|
||||
$(CC) -c $(KPDFREADER_CFLAGS) -I$(FREETYPEDIR)/include $< -o $@
|
||||
$(CC) -c $(KPDFREADER_CFLAGS) -I$(FREETYPEDIR)/include -I$(MUPDFDIR)/fitz $< -o $@
|
||||
|
||||
kpdfview.o pdf.o blitbuffer.o util.o drawcontext.o: %.o: %.c
|
||||
$(CC) -c $(KPDFREADER_CFLAGS) -I$(LFSDIR)/src $< -o $@
|
||||
|
||||
11
ft.c
11
ft.c
@@ -23,8 +23,7 @@
|
||||
#include "blitbuffer.h"
|
||||
|
||||
/* for font access: */
|
||||
#include <fitz/fitz.h>
|
||||
#include <pdf/mupdf.h>
|
||||
#include <pdf/mupdf-internal.h>
|
||||
|
||||
#include "ft.h"
|
||||
|
||||
@@ -64,13 +63,13 @@ static int newBuiltinFace(lua_State *L) {
|
||||
unsigned int size;
|
||||
/* we use compiled-in font data from mupdf build */
|
||||
if(!strcmp("mono", fontname)) {
|
||||
fontdata = pdf_find_substitute_font(1, 0, 0, 0, &size);
|
||||
fontdata = pdf_lookup_substitute_font(1, 0, 0, 0, &size);
|
||||
} else if(!strcmp("sans", fontname)) {
|
||||
fontdata = pdf_find_substitute_font(0, 0, 0, 0, &size);
|
||||
fontdata = pdf_lookup_substitute_font(0, 0, 0, 0, &size);
|
||||
} else if(!strcmp("cjk", fontname)) {
|
||||
fontdata = pdf_find_substitute_cjk_font(0, 0, &size);
|
||||
fontdata = pdf_lookup_substitute_cjk_font(0, 0, &size);
|
||||
} else {
|
||||
fontdata = pdf_find_builtin_font(fontname, &size);
|
||||
fontdata = pdf_lookup_builtin_font(fontname, &size);
|
||||
}
|
||||
if(fontdata == NULL) {
|
||||
return luaL_error(L, "no such built-in font");
|
||||
|
||||
2
mupdf
2
mupdf
Submodule mupdf updated: e7bb1c4937...bdb6b688a2
13
pdf.c
13
pdf.c
@@ -15,7 +15,7 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <fitz/fitz.h>
|
||||
#include <fitz/fitz-internal.h>
|
||||
|
||||
#include "blitbuffer.h"
|
||||
#include "drawcontext.h"
|
||||
@@ -371,16 +371,15 @@ static int drawPage(lua_State *L) {
|
||||
fz_device *dev;
|
||||
fz_matrix ctm;
|
||||
fz_bbox bbox;
|
||||
fz_bbox rect;
|
||||
|
||||
PdfPage *page = (PdfPage*) luaL_checkudata(L, 1, "pdfpage");
|
||||
DrawContext *dc = (DrawContext*) luaL_checkudata(L, 2, "drawcontext");
|
||||
BlitBuffer *bb = (BlitBuffer*) luaL_checkudata(L, 3, "blitbuffer");
|
||||
rect.x0 = luaL_checkint(L, 4);
|
||||
rect.y0 = luaL_checkint(L, 5);
|
||||
rect.x1 = rect.x0 + bb->w;
|
||||
rect.y1 = rect.y0 + bb->h;
|
||||
pix = fz_new_pixmap_with_rect(page->doc->context, fz_device_gray, rect);
|
||||
bbox.x0 = luaL_checkint(L, 4);
|
||||
bbox.y0 = luaL_checkint(L, 5);
|
||||
bbox.x1 = bbox.x0 + bb->w;
|
||||
bbox.y1 = bbox.y0 + bb->h;
|
||||
pix = fz_new_pixmap_with_bbox(page->doc->context, fz_device_gray, bbox);
|
||||
fz_clear_pixmap_with_value(page->doc->context, pix, 0xff);
|
||||
|
||||
ctm = fz_scale(dc->zoom, dc->zoom);
|
||||
|
||||
Reference in New Issue
Block a user