mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add column detection in koptconfig
Conflicts: koptconfig.lua koptreader.lua
This commit is contained in:
6
djvu.c
6
djvu.c
@@ -483,9 +483,11 @@ static int reflowPage(lua_State *L) {
|
||||
double word_spacing = luaL_checknumber(L, 9);
|
||||
int text_wrap = luaL_checkint(L, 10);
|
||||
int justification = luaL_checkint(L, 11);
|
||||
double contrast = luaL_checknumber(L, 12);
|
||||
int columns = luaL_checkint(L, 12);
|
||||
double contrast = luaL_checknumber(L, 13);
|
||||
|
||||
k2pdfopt_set_params(width, height, font_size, page_margin, line_spacing, word_spacing, text_wrap, justification, contrast);
|
||||
k2pdfopt_set_params(width, height, font_size, page_margin, line_spacing, word_spacing, \
|
||||
text_wrap, justification, columns, contrast);
|
||||
k2pdfopt_djvu_reflow(page->page_ref, page->doc->context, mode, page->doc->pixelformat);
|
||||
k2pdfopt_rfbmp_size(&width, &height);
|
||||
k2pdfopt_rfbmp_zoom(&dc->zoom);
|
||||
|
||||
@@ -475,14 +475,17 @@ static void k2pdfopt_reflow_bmp(MASTERINFO *masterinfo, WILLUSBITMAP *src) {
|
||||
void k2pdfopt_set_params(int bb_width, int bb_height, \
|
||||
double font_size, double page_margin, \
|
||||
double line_space, double word_space, \
|
||||
int wrapping, int justification, double contrast) {
|
||||
int wrapping, int justification, \
|
||||
int columns, double contrast) {
|
||||
dst_userwidth = bb_width; // dst_width is adjusted in adjust_params_init
|
||||
dst_userheight = bb_height;
|
||||
zoom_value = font_size;
|
||||
vertical_line_spacing = line_space;
|
||||
word_spacing = word_space;
|
||||
text_wrap = wrapping;
|
||||
max_columns = columns;
|
||||
gamma_correction = contrast; // contrast is only used by k2pdfopt_mupdf_reflow
|
||||
zoom_value = font_size;
|
||||
|
||||
// margin
|
||||
dst_mar = page_margin;
|
||||
dst_martop = -1.0;
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
void k2pdfopt_set_params(int bb_width, int bb_height, \
|
||||
double font_size, double page_margin, \
|
||||
double line_space, double word_space, \
|
||||
int wrapping, int justification, double contrast);
|
||||
int wrapping, int justification, \
|
||||
int columns, double contrast);
|
||||
void k2pdfopt_mupdf_reflow(fz_document *doc, fz_page *page, fz_context *ctx);
|
||||
void k2pdfopt_djvu_reflow(ddjvu_page_t *page, ddjvu_context_t *ctx, ddjvu_render_mode_t mode, ddjvu_format_t *fmt);
|
||||
void k2pdfopt_rfbmp_size(int *width, int *height);
|
||||
|
||||
6
pdf.c
6
pdf.c
@@ -523,9 +523,11 @@ static int reflowPage(lua_State *L) {
|
||||
double word_spacing = luaL_checknumber(L, 9);
|
||||
int text_wrap = luaL_checkint(L, 10);
|
||||
int justification = luaL_checkint(L, 11);
|
||||
double contrast = luaL_checknumber(L, 12);
|
||||
int columns = luaL_checkint(L, 12);
|
||||
double contrast = luaL_checknumber(L, 13);
|
||||
|
||||
k2pdfopt_set_params(width, height, font_size, page_margin, line_spacing, word_spacing, text_wrap, justification, contrast);
|
||||
k2pdfopt_set_params(width, height, font_size, page_margin, line_spacing, word_spacing, \
|
||||
text_wrap, justification, columns, contrast);
|
||||
k2pdfopt_mupdf_reflow(page->doc->xref, page->page, page->doc->context);
|
||||
k2pdfopt_rfbmp_size(&width, &height);
|
||||
k2pdfopt_rfbmp_zoom(&dc->zoom);
|
||||
|
||||
Reference in New Issue
Block a user