Windows and Linux build environments; check clean on both (E-01)
MuPDF builds with MSBuild on Windows (/MT, OpenSSL from vcpkg); Git for Windows' MinGit stands in for the source build there. CEF loads from where libcef lives and sets its API version first on every platform. File identity on Windows compares volume and index. The checkout and reference/ keep LF on Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d59159cea2
commit
68b5af76e0
40 files changed
+380
-82
No files matched your search
@@ -146,7 +146,7 @@ static void write_file(fz_context *ctx, fz_output *out, const char *key, const c
|
||||
fz_write_string(ctx, out, ",\"name\":");
|
||||
ely_json_string(ctx, out, name);
|
||||
fz_write_printf(ctx, out, ",\"page\":%d,\"size\":%ld,\"created\":%ld,\"modified\":%ld,\"type\":", page,
|
||||
(long)file_size(ctx, fs), (long)params.created, (long)params.modified);
|
||||
file_size(ctx, fs), (int64_t)params.created, (int64_t)params.modified);
|
||||
ely_json_string(ctx, out, params.mimetype ? params.mimetype : "");
|
||||
fz_write_string(ctx, out, ",\"note\":");
|
||||
ely_json_string(ctx, out, pdf_dict_get_text_string(ctx, fs, PDF_NAME(Desc)));
|
||||
|
||||
@@ -255,7 +255,7 @@ int ely_text_layer(fz_context *ctx, fz_document *doc, const char *json, int repl
|
||||
{
|
||||
if (!font)
|
||||
font = glyphless(ctx, pdf);
|
||||
ely_add_resource(ctx, pdf, page->obj, PDF_NAME(Font), "ElyOCR", font, name, sizeof name);
|
||||
ely_add_resource(ctx, page->obj, PDF_NAME(Font), "ElyOCR", font, name, sizeof name);
|
||||
buf = fz_new_buffer(ctx, 1024);
|
||||
/* Its own state, so later text stays seen. */
|
||||
fz_append_string(ctx, buf, "q\n");
|
||||
|
||||
@@ -132,7 +132,7 @@ const char *ely_pen_resource(fz_context *ctx, pdf_document *pdf, pdf_page *page,
|
||||
p->ref = pdf_add_cjk_font(ctx, pdf, p->font, p->ordering, 0, 0);
|
||||
break;
|
||||
}
|
||||
return ely_add_resource(ctx, pdf, page->obj, PDF_NAME(Font), "ElyF", p->ref, name, room);
|
||||
return ely_add_resource(ctx, page->obj, PDF_NAME(Font), "ElyF", p->ref, name, room);
|
||||
}
|
||||
|
||||
/* The own font's code for `u`, or -1. */
|
||||
|
||||
@@ -38,6 +38,7 @@ static void inv_q(fz_context *ctx, pdf_processor *proc)
|
||||
static void inv_Q(fz_context *ctx, pdf_processor *proc)
|
||||
{
|
||||
inventory *inv = (inventory *)proc;
|
||||
(void)ctx;
|
||||
if (inv->depth > 0)
|
||||
inv->ctm = inv->stack[--inv->depth];
|
||||
}
|
||||
@@ -45,6 +46,7 @@ static void inv_Q(fz_context *ctx, pdf_processor *proc)
|
||||
static void inv_cm(fz_context *ctx, pdf_processor *proc, float a, float b, float c, float d, float e, float f)
|
||||
{
|
||||
inventory *inv = (inventory *)proc;
|
||||
(void)ctx;
|
||||
inv->ctm = fz_concat(fz_make_matrix(a, b, c, d, e, f), inv->ctm);
|
||||
}
|
||||
|
||||
@@ -62,12 +64,15 @@ static void found(fz_context *ctx, inventory *inv, int form, fz_rect box)
|
||||
|
||||
static void inv_image(fz_context *ctx, pdf_processor *proc, const char *name, fz_image *image)
|
||||
{
|
||||
(void)name;
|
||||
(void)image;
|
||||
found(ctx, (inventory *)proc, 0, fz_unit_rect);
|
||||
}
|
||||
|
||||
static void inv_form(fz_context *ctx, pdf_processor *proc, const char *name, pdf_obj *form)
|
||||
{
|
||||
fz_rect box = fz_transform_rect(pdf_xobject_bbox(ctx, form), pdf_xobject_matrix(ctx, form));
|
||||
(void)name;
|
||||
found(ctx, (inventory *)proc, 1, box);
|
||||
}
|
||||
|
||||
@@ -269,7 +274,7 @@ int ely_place(fz_context *ctx, fz_document *doc, int number, int index, const fl
|
||||
own = (float)image->w / image->h;
|
||||
change = fz_concat(fz_concat(fz_translate(-cx, -cy), fz_scale(fminf(1, own / box), fminf(1, box / own))), fz_translate(cx, cy));
|
||||
ref = pdf_add_image(ctx, pdf, image);
|
||||
h.rename = ely_add_resource(ctx, pdf, page->obj, PDF_NAME(XObject), "ElyIm", ref, name, sizeof name);
|
||||
h.rename = ely_add_resource(ctx, page->obj, PDF_NAME(XObject), "ElyIm", ref, name, sizeof name);
|
||||
}
|
||||
if (fz_matrix_expansion(change) < 0.001f)
|
||||
fz_throw(ctx, FZ_ERROR_ARGUMENT, "a change that leaves nothing");
|
||||
@@ -315,7 +320,7 @@ int ely_add_image(fz_context *ctx, fz_document *doc, int number, const char *pat
|
||||
pdf_begin_operation(ctx, pdf, "Add an image");
|
||||
begun = 1;
|
||||
ref = pdf_add_image(ctx, pdf, image);
|
||||
ely_add_resource(ctx, pdf, page->obj, PDF_NAME(XObject), "ElyIm", ref, name, sizeof name);
|
||||
ely_add_resource(ctx, page->obj, PDF_NAME(XObject), "ElyIm", ref, name, sizeof name);
|
||||
/* The unit square, bottom left first, onto the box. */
|
||||
m = fz_concat(fz_make_matrix(rect[2] - rect[0], 0, 0, rect[1] - rect[3], rect[0], rect[3]), ely_to_user(ctx, page));
|
||||
buf = fz_new_buffer(ctx, 128);
|
||||
|
||||
@@ -38,7 +38,7 @@ void ely_read_block(fz_context *ctx, fz_document *doc, pdf_page *page, int numbe
|
||||
void ely_remove_block(fz_context *ctx, pdf_document *pdf, pdf_page *page, ely_shape *shape);
|
||||
void ely_drop_shape(fz_context *ctx, ely_shape *shape);
|
||||
pdf_obj *ely_append_content(fz_context *ctx, pdf_document *pdf, pdf_obj *page, fz_buffer *buf);
|
||||
const char *ely_add_resource(fz_context *ctx, pdf_document *pdf, pdf_obj *page, pdf_obj *type, const char *stem,
|
||||
const char *ely_add_resource(fz_context *ctx, pdf_obj *page, pdf_obj *type, const char *stem,
|
||||
pdf_obj *ref, char *name, size_t room);
|
||||
void ely_json_string(fz_context *ctx, fz_output *out, const char *s);
|
||||
fz_json *ely_member(fz_context *ctx, fz_json *obj, const char *key, int type);
|
||||
|
||||
@@ -97,6 +97,10 @@ static int take_glyph(fz_context *ctx, void *opaque, int *ucs, int ucslen, fz_ma
|
||||
fz_rect bbox, int tr, float ca, float CA)
|
||||
{
|
||||
targets *t = opaque;
|
||||
(void)bbox;
|
||||
(void)tr;
|
||||
(void)ca;
|
||||
(void)CA;
|
||||
fz_point at = fz_transform_point(fz_transform_point(fz_make_point(0, 0), trm), ctm);
|
||||
/* MuPDF gives at most PDF_MRANGE_CAP; each spells to 18. */
|
||||
int i, k, found = 0, spelt[18 * PDF_MRANGE_CAP], n = 0;
|
||||
|
||||
@@ -68,7 +68,7 @@ static int lay_out(fz_context *ctx, ely_pen *p, const int *u, int n, float size,
|
||||
}
|
||||
|
||||
/* A resource name in `type` that is free, given `ref`. */
|
||||
const char *ely_add_resource(fz_context *ctx, pdf_document *pdf, pdf_obj *page, pdf_obj *type, const char *stem,
|
||||
const char *ely_add_resource(fz_context *ctx, pdf_obj *page, pdf_obj *type, const char *stem,
|
||||
pdf_obj *ref, char *name, size_t room)
|
||||
{
|
||||
pdf_obj *res = pdf_dict_get_inheritable(ctx, page, PDF_NAME(Resources));
|
||||
|
||||
Reference in new issue
Block a user