Commit 0edc0063 authored by Kan-Ru Chen's avatar Kan-Ru Chen

Update upstream source from tag 'upstream/1.12.0+ds1'

Update to upstream version '1.12.0+ds1'
with Debian dir 4d6fcbf006c8e0274cc319239d1340003fee1835
parents c01a2d76 0fdbf3bc
......@@ -27,14 +27,11 @@ cscope.*
*.xps
*.epub
*.fb2
*.xhtml
*.css
*.svg
*.pam
*.pbm
*.pgm
*.ppm
*.png
*.jpg
*.jpeg
*.pcl
......
......@@ -13,15 +13,18 @@
[submodule "thirdparty/jpeg"]
path = thirdparty/libjpeg
url = ../thirdparty-libjpeg.git
[submodule "thirdparty/lcms2"]
path = thirdparty/lcms2
url = ../thirdparty-lcms2.git
[submodule "thirdparty/openjpeg"]
path = thirdparty/openjpeg
url = ../thirdparty-openjpeg.git
[submodule "thirdparty/zlib"]
path = thirdparty/zlib
url = ../thirdparty-zlib.git
[submodule "thirdparty/glfw"]
path = thirdparty/glfw
url = ../thirdparty-glfw.git
[submodule "thirdparty/curl"]
path = thirdparty/curl
url = ../thirdparty-curl.git
[submodule "thirdparty/freeglut"]
path = thirdparty/freeglut
url = ../thirdparty-freeglut.git
List of changes in MuPDF 1.12.0
* New Android SDK:
New git repositories for the SDK projects:
* mupdf-android-fitz.git has the JNI bindings in a library.
* mupdf-android-viewer.git has the viewer as an activity in a library.
* mupdf-android-viewer-mini.git has the minimalist viewer as an activity in a library.
Binary packages in our Maven repository at http://maven.ghostscript.com:
* com.artifex.mupdf:fitz:1.12.+
* com.artifex.mupdf:viewer:1.12.+
* com.artifex.mupdf:mini:1.12.+
* Color management:
* LCMS2 library for color management.
* CMYK rendering with overprint simulation.
* Spot color rendering.
* Transparency rendering fixes.
* Structured text output improvements:
* Reworked structured text API.
* Faster text searching.
* Highlight and copy text by selecting lines instead of by area.
* New semantic XHTML output format.
* New layout preserving HTML output format.
* Features and improvements:
* Improved non-AA rendering with new scan converter.
* Improved LARGEFILE support.
* Improved TIFF support.
* Improved documentation.
* PCLm output.
* PSD output.
* New "mutool trace" tool.
* New "mutool sign" tool (work in progress).
* Text redaction (work in progress).
* Lots of bug fixes.
List of changes in MuPDF 1.11
* This is primarily a bug fix release.
......
This diff is collapsed.
......@@ -8,8 +8,7 @@ OS := $(OS:Darwin=MACOS)
HAVE_LIBDL ?= yes
CFLAGS += -Wall
CFLAGS += -Wall -Wdeclaration-after-statement
ifeq (,$(findstring -fembed-bitcode,$(XCFLAGS)))
# clang does not support these in combination with -fembed-bitcode
......@@ -35,8 +34,11 @@ else ifeq "$(build)" "valgrind"
CFLAGS += -pipe -O2 -DNDEBUG -DPACIFY_VALGRIND -fno-omit-frame-pointer
LDFLAGS += $(LDREMOVEUNREACH) -Wl,-s
else ifeq "$(build)" "sanitize"
CFLAGS += -pipe -g -fsanitize=address -fno-omit-frame-pointer
LDFLAGS += -fsanitize=address
CFLAGS += -pipe -g -fno-omit-frame-pointer -fsanitize=address
LDFLAGS += -g -fsanitize=address
else ifeq "$(build)" "sanitize-release"
CFLAGS += -pipe -O2 -DNDEBUG -fno-omit-frame-pointer -fsanitize=address
LDFLAGS += $(LDREMOVEUNREACH) -Wl,-s -fsanitize=address
else ifeq "$(build)" "profile"
CFLAGS += -pipe -O2 -DNDEBUG -pg
LDFLAGS += -pg
......@@ -60,10 +62,6 @@ else
$(error unknown build setting: '$(build)')
endif
ifeq "$(largefile)" "yes"
CFLAGS += -DFZ_LARGEFILE
endif
# Windows (MINGW) build doesn't use system libraries.
ifeq "$(OS)" "MINGW"
......@@ -79,35 +77,14 @@ else ifeq "$(OS)" "MACOS"
HAVE_X11 ?= no
HAVE_PTHREAD := yes
SYS_PTHREAD_CFLAGS :=
SYS_PTHREAD_LIBS := -lpthread
# Mac OS X deprecated libcrypto, so the default is to not include it.
HAVE_LIBCRYTO := no
SYS_LIBCRYPTO_CFLAGS :=
SYS_LIBCRYPTO_LIBS :=
ifeq "$(HAVE_LIBCRYPTO)" "yes"
SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO
SYS_LIBCRYPTO_LIBS := -lcrypto
endif
SYS_CURL_DEPS := -lpthread
SYS_X11_CFLAGS := -I/usr/X11R6/include
SYS_X11_LIBS := -L/usr/X11R6/lib -lX11 -lXext
HAVE_GLUT ?= yes
SYS_GLUT_CFLAGS := -Wno-deprecated-declarations
SYS_GLUT_LIBS := -framework GLUT -framework OpenGL
SYS_FREETYPE_CFLAGS := $(shell freetype-config --cflags)
SYS_FREETYPE_LIBS := $(shell freetype-config --libs)
SYS_OPENJPEG_LIBS := -lopenjpeg
SYS_JBIG2DEC_LIBS := -ljbig2dec
SYS_LIBJPEG_LIBS := -ljpeg
SYS_ZLIB_LIBS := -lz
CC := xcrun cc
AR := xcrun ar
LD := xcrun ld
RANLIB_CMD := xcrun ranlib $@
CC = xcrun cc
AR = xcrun ar
LD = xcrun ld
RANLIB_CMD = xcrun ranlib $@
# Linux uses pkg-config for system libraries.
else ifeq "$(OS)" "Linux"
......@@ -116,6 +93,10 @@ HAVE_PTHREAD := yes
SYS_PTHREAD_CFLAGS :=
SYS_PTHREAD_LIBS := -lpthread
HAVE_GLUT := yes
SYS_GLUT_CFLAGS :=
SYS_GLUT_LIBS := -lglut -lGL
ifeq "$(shell pkg-config --exists 'libcrypto <= 1.0.1t' && echo yes)" "yes"
HAVE_LIBCRYPTO := yes
SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO $(shell pkg-config --cflags libcrypto)
......@@ -277,5 +258,5 @@ endif
# TODO: If crosscompiling, why not just call "make libs" instead of this exception?
ifeq "$(CROSSCOMPILE)" "yes"
HAVE_X11 ?= no
HAVE_GLFW ?= no
HAVE_GLUT ?= no
endif
......@@ -10,6 +10,7 @@ FREETYPE_DIR := thirdparty/freetype
HARFBUZZ_DIR := thirdparty/harfbuzz
JBIG2DEC_DIR := thirdparty/jbig2dec
JPEGXR_DIR := thirdparty/jpegxr
LCMS2_DIR := thirdparty/lcms2
LIBJPEG_DIR := thirdparty/libjpeg
LURATECH_DIR := thirdparty/luratech
MUJS_DIR := thirdparty/mujs
......@@ -17,7 +18,7 @@ OPENJPEG_DIR := thirdparty/openjpeg/src/lib/openjp2
ZLIB_DIR := thirdparty/zlib
CURL_DIR := thirdparty/curl
GLFW_DIR := thirdparty/glfw
GLUT_DIR := thirdparty/freeglut
# --- MuJS ---
......@@ -164,8 +165,8 @@ $(HARFBUZZ_OUT):
$(MKDIR_CMD)
$(HARFBUZZ_OUT)/%.o: $(HARFBUZZ_DIR)/src/%.cc | $(HARFBUZZ_OUT)
$(CC_CMD) -DHAVE_OT -DHAVE_UCDN -DHB_NO_MT $(FREETYPE_CFLAGS) \
-Dhb_malloc_impl=hb_malloc -Dhb_calloc_impl=hb_calloc \
-Dhb_free_impl=hb_free -Dhb_realloc_impl=hb_realloc \
-Dhb_malloc_impl=fz_hb_malloc -Dhb_calloc_impl=fz_hb_calloc \
-Dhb_free_impl=fz_hb_free -Dhb_realloc_impl=fz_hb_realloc \
-fno-rtti -fno-exceptions -fvisibility-inlines-hidden --std=c++0x
HARFBUZZ_CFLAGS := -I$(HARFBUZZ_DIR)/src
......@@ -532,6 +533,51 @@ ZLIB_CFLAGS := $(SYS_ZLIB_CFLAGS)
ZLIB_LIBS := $(SYS_ZLIB_LIBS)
endif
# --- LCMS2 ---
ifneq "$(wildcard $(LCMS2_DIR)/INSTALL)" ""
LCMS2_OUT := $(OUT)/lcms2
LCMS2_SRC := \
cmsalpha.c \
cmscam02.c \
cmscgats.c \
cmscnvrt.c \
cmserr.c \
cmsgamma.c \
cmsgmt.c \
cmshalf.c \
cmsintrp.c \
cmsio0.c \
cmsio1.c \
cmslut.c \
cmsmd5.c \
cmsmtrx.c \
cmsnamed.c \
cmsopt.c \
cmspack.c \
cmspcs.c \
cmsplugin.c \
cmsps2.c \
cmssamp.c \
cmssm.c \
cmstypes.c \
cmsvirt.c \
cmswtpnt.c \
cmsxform.c \
LCMS2_OBJ := $(addprefix $(LCMS2_OUT)/, $(LCMS2_SRC:%.c=%.o))
$(LCMS2_OUT):
$(MKDIR_CMD)
$(LCMS2_OUT)/%.o: $(LCMS2_DIR)/src/%.c | $(LCMS2_OUT)
$(CC_CMD) -I$(LCMS2_DIR)/include
LCMS2_CFLAGS := -I$(LCMS2_DIR)/include
else
LCMS2_CFLAGS := -DNO_ICC
endif
# --- cURL ---
ifneq "$(wildcard $(CURL_DIR)/README)" ""
......@@ -612,93 +658,84 @@ CURL_CFLAGS := $(SYS_CURL_CFLAGS)
CURL_LIBS := $(SYS_CURL_LIBS)
endif
# --- GLFW ---
# --- FreeGLUT ---
ifneq "$(wildcard $(GLFW_DIR)/README.md)" ""
GLFW_LIB := $(OUT)/libglfw.a
GLFW_OUT := $(OUT)/thirdparty/glfw
ifneq "$(wildcard $(GLUT_DIR)/README)" ""
ifeq "$(OS)" "MACOS"
GLFW_SRC := \
cocoa_time.c \
cocoa_init.m \
cocoa_monitor.m \
cocoa_window.m \
context.c \
init.c \
input.c \
iokit_joystick.m \
mach_time.m \
monitor.c \
nsgl_context.m \
posix_tls.c \
vulkan.c \
window.c
$(GLFW_OUT)/%.o: $(GLFW_DIR)/src/%.m | $(GLFW_OUT)
$(CC_CMD) -D_GLFW_COCOA -D_GLFW_USE_MENUBAR -D_GLFW_USE_RETINA -Wno-deprecated-declarations
$(GLFW_OUT)/%.o: $(GLFW_DIR)/src/%.c | $(GLFW_OUT)
$(CC_CMD) -D_GLFW_COCOA -D_GLFW_USE_MENUBAR -D_GLFW_USE_RETINA
GLFW_OBJ := $(addprefix $(GLFW_OUT)/, $(GLFW_SRC))
GLFW_OBJ := $(GLFW_OBJ:%.c=%.o)
GLFW_OBJ := $(GLFW_OBJ:%.m=%.o)
$(GLFW_LIB): $(GLFW_OBJ)
GLFW_LIBS := -framework OpenGL -framework IOKit -framework CoreVideo -framework Cocoa
GLUT_CFLAGS := $(SYS_GLUT_CFLAGS)
GLUT_LIBS := $(SYS_GLUT_LIBS)
else
GLFW_SRC := \
context.c \
egl_context.c \
glx_context.c \
init.c \
input.c \
linux_joystick.c \
monitor.c \
posix_time.c \
posix_tls.c \
vulkan.c \
window.c \
x11_init.c \
x11_monitor.c \
x11_window.c \
xkb_unicode.c
$(GLFW_OUT)/%.o: $(GLFW_DIR)/src/%.c | $(GLFW_OUT)
$(CC_CMD) -D_GLFW_X11
$(GLFW_LIB): $(addprefix $(GLFW_OUT)/, $(GLFW_SRC:%.c=%.o))
GLFW_LIBS := -lGL -ldl -lX11 -lXcursor -lXrandr -lXinerama -lpthread
endif
GLFW_CFLAGS := -I$(GLFW_DIR)/include
$(GLFW_OUT):
HAVE_GLUT := yes
GLUT_LIB := $(OUT)/libfreeglut.a
GLUT_OUT := $(OUT)/thirdparty/freeglut
GLUT_SRC := \
fg_callbacks.c \
fg_cursor.c \
fg_display.c \
fg_ext.c \
fg_font.c \
fg_font_data.c \
fg_gamemode.c \
fg_geometry.c \
fg_gl2.c \
fg_init.c \
fg_input_devices.c \
fg_joystick.c \
fg_main.c \
fg_menu.c \
fg_misc.c \
fg_overlay.c \
fg_spaceball.c \
fg_state.c \
fg_stroke_mono_roman.c \
fg_stroke_roman.c \
fg_structure.c \
fg_teapot.c \
fg_videoresize.c \
fg_window.c
GLUT_X11_SRC := \
fg_cursor_x11.c \
fg_display_x11_glx.c \
fg_ext_x11.c \
fg_gamemode_x11.c \
fg_glutfont_definitions_x11.c \
fg_init_x11.c \
fg_input_devices_x11.c \
fg_joystick_x11.c \
fg_main_x11.c \
fg_menu_x11.c \
fg_spaceball_x11.c \
fg_state_x11.c \
fg_state_x11_glx.c \
fg_structure_x11.c \
fg_window_x11.c \
fg_window_x11_glx.c \
fg_xinput_x11.c
GLUT_OBJ := $(addprefix $(GLUT_OUT)/, $(GLUT_SRC:%.c=%.o))
GLUT_OBJ += $(addprefix $(GLUT_OUT)/, $(GLUT_X11_SRC:%.c=%.o))
$(GLUT_LIB): $(GLUT_OBJ)
$(GLUT_OUT):
$(MKDIR_CMD)
$(GLUT_OUT)/%.o: $(GLUT_DIR)/src/%.c | $(GLUT_OUT)
$(CC_CMD) -I$(GLUT_DIR)/include -I$(GLUT_DIR)/src -Wno-unused-function -Wno-unused-const-variable \
-DHAVE_UNISTD_H -DHAVE_STDINT_H -DHAVE_X11_EXTENSIONS_XRANDR_H
$(GLUT_OUT)/%.o: $(GLUT_DIR)/src/x11/%.c | $(GLUT_OUT)
$(CC_CMD) -I$(GLUT_DIR)/include -I$(GLUT_DIR)/src -Wno-unused-function \
-DHAVE_UNISTD_H -DHAVE_STDINT_H -DHAVE_X11_EXTENSIONS_XRANDR_H
GLUT_CFLAGS := -I$(GLUT_DIR)/include
GLUT_LIBS := -lGL -lX11 -lXrandr
GLFW_SRC_UNUSED := \
mir_init.c \
mir_monitor.c \
mir_window.c \
wgl_context.c \
win32_init.c \
win32_joystick.c \
win32_monitor.c \
win32_time.c \
win32_tls.c \
win32_window.c \
wl_init.c \
wl_monitor.c \
wl_window.c \
HAVE_GLFW := yes
else ifeq "$(HAVE_GLFW)" "yes"
GLFW_CFLAGS := $(SYS_GLFW_CFLAGS)
GLFW_LIBS := $(SYS_GLFW_LIBS)
endif
else
GLUT_CFLAGS := $(SYS_GLUT_CFLAGS)
GLUT_LIBS := $(SYS_GLUT_LIBS)
endif
# --- X11 ---
......@@ -717,7 +754,9 @@ endif
# --- pthread ---
#ifeq "$(HAVE_PTHREAD)" "yes"
PTHREAD_CFLAGS := $(SYS_PTHREAD_CFLAGS)
PTHREAD_LIBS := $(SYS_PTHREAD_LIBS)
#endif
ifneq "$(threading)" "no"
ifeq "$(HAVE_PTHREAD)" "yes"
THREADING_CFLAGS := $(SYS_PTHREAD_CFLAGS) -DHAVE_PTHREAD
THREADING_LIBS := $(SYS_PTHREAD_LIBS)
endif
endif
ABOUT
MuPDF is a lightweight PDF, XPS, EPUB and CBZ viewer and parser/rendering
library.
MuPDF is a lightweight open source software framework for viewing and converting
PDF, XPS, and E-book documents.
The renderer in MuPDF is tailored for high quality anti-aliased graphics. It
renders text with metrics and spacing accurate to within fractions of a pixel
for the highest fidelity in reproducing the look of a printed page on screen.
See the documentation in docs/index.html for an overview.
MuPDF is also small, fast, and yet complete. We support PDF 1.7 with
transparency, encryption, hyperlinks, annotations, search and many other bells
and whistles. MuPDF can also read XPS documents (OpenXPS / ECMA-388),
EPUB and CBZ (Comic Book archive) files.
MuPDF is written to be both modular and portable; the example applications
are merely thin layers on top of the functionality offered by the library,
so custom viewers can be easily built for a wide range of platforms. Example
viewer applications are supplied for Windows, Linux, MacOS, iOS and Android.
MuPDF is deliberately designed to be threading library agnostic, while still
supporting multi-threaded operation. In the absence of a thread library
it will run single-threaded, but by adding one significant benefits in
rendering speed on multi-core platforms can be obtained.
Interactive features such as form filling, javascript and transitions
are in development and partially supported by the Android application.
Build instructions can be found in docs/building.html.
LICENSE
......@@ -44,46 +26,13 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
For commercial licensing, including our "Indie Dev" friendly options,
please contact sales@artifex.com.
COMPILING
If you are compiling from source you will need several third party libraries:
freetype2, jbig2dec, libjpeg, openjpeg, and zlib. These libraries are contained
in the source archive. If you are using git, they are included as git
submodules.
You will also need the X11 headers and libraries if you're building on Linux.
These can typically be found in the xorg-dev package. Alternatively, if you
only want the command line tools, you can build with HAVE_X11=no.
The new OpenGL-based viewer also needs OpenGL headers and libraries. If you're
building on Linux, install the mesa-common-dev and libgl1-mesa-dev packages.
You'll also need several X11 development packages: xorg-dev, libxcursor-dev,
libxrandr-dev, and libxinerama-dev. To skip building the OpenGL viewer, build
with HAVE_GLFW=no.
DOWNLOAD
The latest development source is available directly from the git repository:
git clone --recursive git://git.ghostscript.com/mupdf.git
In the mupdf directory, update the third party libraries:
git submodule update --init
INSTALLING (UNIX)
Typing "make prefix=/usr/local install" will install the binaries, man-pages,
static libraries and header files on your system.
REPORTING BUGS AND PROBLEMS
The MuPDF developers hang out on IRC in the #ghostscript channel on
irc.freenode.net.
The MuPDF developers hang out on IRC in the #mupdf channel on irc.freenode.net.
Report bugs on the ghostscript bugzilla, with MuPDF as the selected component.
http://bugs.ghostscript.com/
If you are reporting a problem with PDF parsing, please include the problematic
file as an attachment.
If you are reporting a problem with a specific file, please include the file as
an attachment.
<!DOCTYPE html>
<html>
<head>
<title>MuPDF Android SDK</title>
<link rel="stylesheet" href="style.css" type="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {counter-reset: h2}
h2 {counter-reset: h3}
h3 {counter-reset: h4}
h4 {counter-reset: h5}
h5 {counter-reset: h6}
h2:before {counter-increment: h2; content: counter(h2) ". "}
h3:before {counter-increment: h3; content: counter(h2) "." counter(h3) ". "}
h4:before {counter-increment: h4; content: counter(h2) "." counter(h3) "." counter(h4) ". "}
h5:before {counter-increment: h5; content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". "}
h6:before {counter-increment: h6; content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) ". "}
</style>
</head>
<body>
<header>
<h1>MuPDF Android SDK</h1>
</header>
<nav>
<a href="http://mupdf.com/index.html">About</a>
<a href="http://mupdf.com/news.html">News</a>
<a href="index.html">Documentation</a>
<a href="http://mupdf.com/downloads/">Downloads</a>
<a href="http://git.ghostscript.com/?p=mupdf.git;a=summary">Source</a>
<a href="https://bugs.ghostscript.com/">Bugs</a>
</nav>
<article>
<p>
This document outlines the steps necessary to use the MuPDF Android SDK in various ways.
<p>
First, we show you how to embed the SDK in your app. Then, we explain how to
customize the viewer if you need to change how it looks or behaves. Finally, we
tell you where to go if you need to do work on the SDK itself.
<p>
Embedding the viewer in your app provides an activity that you can start to
view PDF documents from within your app. This should be enough for most use
cases.
<h2 id="acquire-license">
Acquire a valid license
</h2>
<p>
Before using MuPDF, please make sure that you have a valid license to do so.
There are two available licenses; make sure you pick the one whose terms you can comply with.
<h3>
Open Source license
</h3>
<p>
If your software is open source, you may use MuPDF under the terms of the
<a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU Affero General Public License</a>.
<p>
This means that <i>all of the source code</i> for your <i>complete</i> app must be
released under a compatible open source license!
<p>
It also means that you may <i>not</i> use any proprietary closed source libraries or
components in your app. This includes (but is not limited to)
Google Play Services,
Google Mobile Services,
AdMob by Google,
Crashlytics,
Answers,
etc.
<p>
Just because a library ships with Android or is made by Google does <i>not</i> make it AGPL compatible!
<p>
If you cannot or do not want to comply with these restrictions,
you <i><b>must</b></i> acquire a commercial license instead.
<h3>
Commercial license
</h3>
<p>
If your software is not open source, Artifex Software can sell you a license to use MuPDF in closed source software.
Go and fill out the <a href="http://artifex.com/contact-us/">product inquiry form</a>
for commercial licensing terms and pricing.
<h2 id="setup-build">
Add the MuPDF SDK to your project
</h2>
<p>