Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump crengine: add support for MathML #1337

Merged
merged 1 commit into from
Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile.defs
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,8 @@ CRENGINE_DIR=$(CURDIR)/$(CRENGINE_BUILD_DIR)
CRENGINE_SRC_DIR=$(CURDIR)/$(THIRDPARTY_DIR)/kpvcrlib/crengine
CRENGINE_SRC_FILES=$(wildcard $(CRENGINE_SRC_DIR)/crengine/src/*.cpp)
CRENGINE_SRC_FILES+=$(wildcard $(CRENGINE_SRC_DIR)/crengine/include/*.h)
CRENGINE_SRC_FILES+=$(wildcard $(CRENGINE_SRC_DIR)/crengine/src/*.h)
CRENGINE_SRC_FILES+=$(wildcard $(CRENGINE_SRC_DIR)/crengine/src/*_h.*)
CRENGINE_LIB=$(OUTPUT_DIR)/libs/libcrengine$(LIB_EXT)

LUAJIT_BUILD_DIR=$(THIRDPARTY_DIR)/luajit/build/$(MACHINE)
Expand Down
10 changes: 8 additions & 2 deletions cre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ static int readDefaults(lua_State *L) {
doc->text_view->propsApply(props);
} else {
// Tweak the default settings to be slightly less random
props->setString(PROP_FALLBACK_FONT_FACE, "Noto Sans CJK SC");
props->setString(PROP_FALLBACK_FONT_FACES, "Noto Sans CJK SC");
props->setString(PROP_HYPHENATION_DICT, "English_US.pattern");
props->setString(PROP_STATUS_FONT_FACE, "Noto Sans");
props->setString(PROP_FONT_FACE, "Noto Serif");
Expand Down Expand Up @@ -1634,14 +1634,20 @@ static int getVisiblePageNumberCount(lua_State *L) {
static int adjustFontSizes(lua_State *L) {
CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument");
int dpi = luaL_checkint(L, 2);
/* Previously used (when the hardcoded default was similar to USE_LIMITED_FONT_SIZES_SET=1):
static int fontSizes[] = { 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 78, 84, 90, 110, 130, 150, 170, 200, 230, 260, 300, 340};
LVArray<int> sizes( fontSizes, sizeof(fontSizes)/sizeof(int) );
doc->text_view->setFontSizes(sizes, false); // text
*/
// Now, with crengine compiled with USE_LIMITED_FONT_SIZES_SET=0:
doc->text_view->setMinFontSize(12);
doc->text_view->setMaxFontSize(340);
// Top status bar font size
if (dpi < 170) {
doc->text_view->setStatusFontSize(20); // header
doc->text_view->setStatusFontSize(20);
} else if (dpi > 250) {
doc->text_view->setStatusFontSize(28);
} else {
Expand Down
2 changes: 2 additions & 0 deletions thirdparty/kpvcrlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ add_definitions(
-DUSE_ZSTD=1
-DALLOW_KERNING=1
-DCR3_PATCH=1
-DMATHML_SUPPORT=1
)

if(${CMAKE_BUILD_TYPE} STREQUAL Debug)
Expand Down Expand Up @@ -163,6 +164,7 @@ set (CRENGINE_SOURCES
${CRE_DIR}/src/lvpagesplitter.cpp
${CRE_DIR}/src/lvtextfm.cpp
${CRE_DIR}/src/lvrend.cpp
${CRE_DIR}/src/mathml.cpp
${CRE_DIR}/src/wolutil.cpp
${CRE_DIR}/src/hist.cpp
${CRE_DIR}/src/cri18n.cpp
Expand Down