summaryrefslogtreecommitdiff
path: root/devices
diff options
context:
space:
mode:
authorJulian Smith <julian.smith@artifex.com>2022-03-29 13:44:27 +0100
committerJulian Smith <julian.smith@artifex.com>2022-03-29 14:50:51 +0100
commit815b051d40f66815bea75636192e4c062f41798e (patch)
tree1d398a3e5e8f1ab8e85a30093afd19da8f044b26 /devices
parent38b3bde1293ea8b6064bd6c2a1ed60171adea82b (diff)
downloadghostpdl-815b051d40f66815bea75636192e4c062f41798e.tar.gz
Updates for latest extract.
Extract has two new source files, src/boxer.c and src/rect.c, plus extra rect args in extract_page_begin() and extract_add_char(). For now we pass dummy (0, 0, 0, 0) rect args as they are only used for page layout analysis, which we don't ask extract to do.
Diffstat (limited to 'devices')
-rw-r--r--devices/extract.mak10
-rw-r--r--devices/vector/gdevdocxw.c16
2 files changed, 21 insertions, 5 deletions
diff --git a/devices/extract.mak b/devices/extract.mak
index 71f30825e..1ed6080b9 100644
--- a/devices/extract.mak
+++ b/devices/extract.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2021 Artifex Software, Inc.
+# Copyright (C) 2001-2022 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -22,6 +22,9 @@ $(extract_out_prefix)alloc.$(OBJ): $(EXTRACT_DIR)/src/alloc.c $(MAKEDIR
$(extract_out_prefix)astring.$(OBJ): $(EXTRACT_DIR)/src/astring.c $(MAKEDIRS)
$(extract_cc)$@ $(C_) $(EXTRACT_DIR)/src/astring.c
+$(extract_out_prefix)boxer.$(OBJ): $(EXTRACT_DIR)/src/boxer.c $(MAKEDIRS)
+ $(extract_cc)$@ $(C_) $(EXTRACT_DIR)/src/boxer.c
+
$(extract_out_prefix)buffer.$(OBJ): $(EXTRACT_DIR)/src/buffer.c $(MAKEDIRS)
$(extract_cc)$@ $(C_) $(EXTRACT_DIR)/src/buffer.c
@@ -55,6 +58,9 @@ $(extract_out_prefix)odt_template.$(OBJ): $(EXTRACT_DIR)/src/odt_template.c $(
$(extract_out_prefix)outf.$(OBJ): $(EXTRACT_DIR)/src/outf.c $(MAKEDIRS)
$(extract_cc)$@ $(C_) $(EXTRACT_DIR)/src/outf.c
+$(extract_out_prefix)rect.$(OBJ): $(EXTRACT_DIR)/src/rect.c $(MAKEDIRS)
+ $(extract_cc)$@ $(C_) $(EXTRACT_DIR)/src/rect.c
+
$(extract_out_prefix)sys.$(OBJ): $(EXTRACT_DIR)/src/sys.c $(MAKEDIRS)
$(extract_cc)$@ $(C_) $(EXTRACT_DIR)/src/sys.c
@@ -70,6 +76,7 @@ $(extract_out_prefix)zip.$(OBJ): $(EXTRACT_DIR)/src/zip.c $(MAKEDIRS)
EXTRACT_OBJS = \
$(extract_out_prefix)alloc.$(OBJ) \
$(extract_out_prefix)astring.$(OBJ) \
+ $(extract_out_prefix)boxer.$(OBJ) \
$(extract_out_prefix)buffer.$(OBJ) \
$(extract_out_prefix)document.$(OBJ) \
$(extract_out_prefix)docx.$(OBJ) \
@@ -81,6 +88,7 @@ EXTRACT_OBJS = \
$(extract_out_prefix)odt.$(OBJ) \
$(extract_out_prefix)odt_template.$(OBJ) \
$(extract_out_prefix)outf.$(OBJ) \
+ $(extract_out_prefix)rect.$(OBJ) \
$(extract_out_prefix)sys.$(OBJ) \
$(extract_out_prefix)text.$(OBJ) \
$(extract_out_prefix)xml.$(OBJ) \
diff --git a/devices/vector/gdevdocxw.c b/devices/vector/gdevdocxw.c
index b637a4c82..7783bff4d 100644
--- a/devices/vector/gdevdocxw.c
+++ b/devices/vector/gdevdocxw.c
@@ -273,7 +273,8 @@ docxwrite_open_device(gx_device * dev)
code = s_errno_to_gs();
goto end;
}
- if (extract_page_begin(tdev->extract)) {
+ /* Pass dummy page bbox for now; our simple use of extract ignores it. */
+ if (extract_page_begin(tdev->extract, 0, 0, 0, 0)) {
code = s_errno_to_gs();
goto end;
}
@@ -383,7 +384,8 @@ docxwrite_output_page(gx_device * dev, int num_copies, int flush)
goto end;
}
}
- if (extract_page_begin(tdev->extract)) {
+ /* Pass dummy page bbox for now; our simple use of extract ignores it. */
+ if (extract_page_begin(tdev->extract, 0, 0, 0, 0)) {
code = s_errno_to_gs();
goto end;
}
@@ -939,13 +941,16 @@ docxwrite_process_cmap_text(gx_device_docxwrite_t *tdev, gs_text_enum_t *pte)
txt_get_unicode(penum->dev, (gs_font *)pte->orig_font, glyph, chr, &buffer[0]);
+ /* Pass dummy glyph bbox because our use of extract does not
+ currently cause it to be used. */
if (extract_add_char(
tdev->extract,
tdev->x,
fixed2float(penum->origin.y) - penum->text_state->matrix.ty,
buffer[0] /*ucs*/,
glyph_width / penum->text_state->size /*adv*/,
- 0 /*autosplit*/
+ 0 /*autosplit*/,
+ 0, 0, 0, 0 /* bbox*/
)) {
return s_errno_to_gs();
}
@@ -1095,13 +1100,16 @@ docxwrite_process_plain_text(gx_device_docxwrite_t *tdev, gs_text_enum_t *pte)
* 'extra' code points' widths to 0.
*/
+ /* Pass dummy glyph bbox because our use of extract does not currently
+ cause it to be used. */
if (extract_add_char(
tdev->extract,
tdev->x,
fixed2float(penum->origin.y) - penum->text_state->matrix.ty,
chr2[0] /*ucs*/,
glyph_width / penum->text_state->size /*adv*/,
- 0 /*autosplit*/
+ 0 /*autosplit*/,
+ 0, 0, 0, 0 /*bbox*/
)) {
return s_errno_to_gs();
}