diff --git a/Makefile b/Makefile index 8d9fb99b0..b09fd5120 100644 --- a/Makefile +++ b/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 $@ diff --git a/ft.c b/ft.c index 151ba4c48..e356c1a4e 100644 --- a/ft.c +++ b/ft.c @@ -23,8 +23,7 @@ #include "blitbuffer.h" /* for font access: */ -#include -#include +#include #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"); diff --git a/mupdf b/mupdf index e7bb1c493..bdb6b688a 160000 --- a/mupdf +++ b/mupdf @@ -1 +1 @@ -Subproject commit e7bb1c4937593c95065dbbbdd7eb15a73996c470 +Subproject commit bdb6b688a238df56b2cf47fa17a08a4dd4b7a122 diff --git a/pdf.c b/pdf.c index 5583e09a0..6c904030f 100644 --- a/pdf.c +++ b/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 . */ -#include +#include #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);