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: better linebreaks at em-dash, fb2 fixes #1160

Merged
merged 1 commit into from
Aug 18, 2020
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
3 changes: 2 additions & 1 deletion thirdparty/libunibreak/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ep_get_binary_dir(BINARY_DIR)
set(CFG_ENV_VAR "CC=\"${CC}\" CFLAGS=\"${CFLAGS}\" LDFLAGS=\"${LDFLAGS}\" ")
set(CFG_OPTS "--prefix=${BINARY_DIR} --disable-static --enable-shared --host=\"${CHOST}\"")
set(CFG_CMD sh -c "${CFG_ENV_VAR} ${SOURCE_DIR}/configure ${CFG_OPTS}")
set(PATCH_CMD1 "${KO_PATCH} ${CMAKE_CURRENT_SOURCE_DIR}/add_lb_get_char_class.patch")

if($ENV{ANDROID})
set(CFG_CMD "${CFG_CMD} && ${ISED} 's|version_type=none|version_type=linux|' libtool")
Expand All @@ -38,7 +39,7 @@ include(ExternalProject)
ExternalProject_Add(
${PROJECT_NAME}
DOWNLOAD_COMMAND ${CMAKE_COMMAND} -P ${GIT_CLONE_SCRIPT_FILENAME}
PATCH_COMMAND NOCONFIGURE=1 ./autogen.sh
PATCH_COMMAND ${PATCH_CMD1} COMMAND NOCONFIGURE=1 ./autogen.sh
CONFIGURE_COMMAND ${CFG_CMD}
BUILD_COMMAND ${KO_MAKE_RECURSIVE} -j${PARALLEL_JOBS}
INSTALL_COMMAND ${KO_MAKE_RECURSIVE} -j${PARALLEL_JOBS} install
Expand Down
28 changes: 28 additions & 0 deletions thirdparty/libunibreak/add_lb_get_char_class.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/src/linebreak.c b/src/linebreak.c
index c2ccdda..45afba2 100644
--- a/src/linebreak.c
+++ b/src/linebreak.c
@@ -751,6 +751,12 @@ int lb_process_next_char(

return brk;
}
+enum LineBreakClass lb_get_char_class(
+ struct LineBreakContext *lbpCtx,
+ utf32_t ch)
+{
+ return get_char_lb_class_lang(ch, lbpCtx->lbpLang);
+}

/**
* Sets the line breaking information for a generic input string.
diff --git a/src/linebreakdef.h b/src/linebreakdef.h
index 5bb8838..8db80a6 100644
--- a/src/linebreakdef.h
+++ b/src/linebreakdef.h
@@ -169,3 +169,6 @@ void set_linebreaks(
const char *lang,
char *brks,
get_next_char_t get_next_char);
+enum LineBreakClass lb_get_char_class(
+ struct LineBreakContext *lbpCtx,
+ utf32_t ch);