merge justification and full justification to one option
Conflicts: koptconfig.lua koptreader.lua
This commit is contained in:
1 parent
75b1e716fe
commit
ddb46eeb41
4 files changed
+21
-9
No files matched your search
@@ -482,10 +482,9 @@ static int reflowPage(lua_State *L) {
|
||||
double word_spacing = luaL_checknumber(L, 8);
|
||||
int text_wrap = luaL_checkint(L, 9);
|
||||
int justification = luaL_checkint(L, 10);
|
||||
int full_just = luaL_checkint(L, 11);
|
||||
double contrast = luaL_checknumber(L, 12);
|
||||
double contrast = luaL_checknumber(L, 11);
|
||||
|
||||
k2pdfopt_set_params(width, height, page_margin, line_spacing, word_spacing, text_wrap, justification, full_just, contrast);
|
||||
k2pdfopt_set_params(width, height, page_margin, line_spacing, word_spacing, text_wrap, justification, contrast);
|
||||
k2pdfopt_djvu_reflow(page->page_ref, page->doc->context, mode, page->doc->pixelformat, dc->zoom, \
|
||||
width, height, line_spacing, word_spacing);
|
||||
k2pdfopt_rfbmp_size(&width, &height);
|
||||
|
||||
+16
-2
@@ -474,21 +474,35 @@ static void k2pdfopt_reflow_bmp(MASTERINFO *masterinfo, WILLUSBITMAP *src) {
|
||||
|
||||
void k2pdfopt_set_params(int bb_width, int bb_height, double page_margin, \
|
||||
double line_space, double word_space, \
|
||||
int wrapping, int justification, int full_just, double contrast) {
|
||||
int wrapping, int justification, double contrast) {
|
||||
dst_userwidth = bb_width; // dst_width is adjusted in adjust_params_init
|
||||
dst_userheight = bb_height;
|
||||
vertical_line_spacing = line_space;
|
||||
word_spacing = word_space;
|
||||
text_wrap = wrapping;
|
||||
dst_justify = justification;
|
||||
dst_fulljustify = full_just;
|
||||
gamma_correction = contrast; // contrast is only used by k2pdfopt_mupdf_reflow
|
||||
|
||||
// margin
|
||||
dst_mar = page_margin;
|
||||
dst_martop = -1.0;
|
||||
dst_marbot = -1.0;
|
||||
dst_marleft = -1.0;
|
||||
dst_marright = -1.0;
|
||||
|
||||
// justification
|
||||
if (justification < 0) {
|
||||
dst_justify = -1;
|
||||
dst_fulljustify = -1;
|
||||
}
|
||||
else if (justification <= 2) {
|
||||
dst_justify = justification;
|
||||
dst_fulljustify = 0;
|
||||
}
|
||||
else {
|
||||
dst_justify = -1;
|
||||
dst_fulljustify = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void k2pdfopt_mupdf_reflow(fz_document *doc, fz_page *page, fz_context *ctx, \
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
|
||||
void k2pdfopt_set_params(int bb_width, int bb_height, double page_margin, \
|
||||
double line_space, double word_space, \
|
||||
int wrapping, int justification, int full_just, double contrast);
|
||||
int wrapping, int justification, double contrast);
|
||||
void k2pdfopt_mupdf_reflow(fz_document *doc, fz_page *page, fz_context *ctx, \
|
||||
double zoom, double gamma, double rot_deg);
|
||||
void k2pdfopt_djvu_reflow(ddjvu_page_t *page, ddjvu_context_t *ctx, \
|
||||
|
||||
@@ -522,10 +522,9 @@ static int reflowPage(lua_State *L) {
|
||||
double word_spacing = luaL_checknumber(L, 8);
|
||||
int text_wrap = luaL_checkint(L, 9);
|
||||
int justification = luaL_checkint(L, 10);
|
||||
int full_just = luaL_checkint(L, 11);
|
||||
double contrast = luaL_checknumber(L, 12);
|
||||
double contrast = luaL_checknumber(L, 11);
|
||||
|
||||
k2pdfopt_set_params(width, height, page_margin, line_spacing, word_spacing, text_wrap, justification, full_just, contrast);
|
||||
k2pdfopt_set_params(width, height, page_margin, line_spacing, word_spacing, text_wrap, justification, contrast);
|
||||
k2pdfopt_mupdf_reflow(page->doc->xref, page->page, page->doc->context, dc->zoom, dc->gamma, 0.0);
|
||||
k2pdfopt_rfbmp_size(&width, &height);
|
||||
k2pdfopt_rfbmp_zoom(&dc->zoom);
|
||||
|
||||
Reference in new issue
Block a user