[gs-commits] ghostpdl branch, pdfi, updated. jbig2dec-0.14-2460-gbceaa77

[email protected] (Ken Sharp) Thu, 7 Nov 2019 11:55:48 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, pdfi has been updated
       via  bceaa77e2142b8c09cbc6422de2132239c5f4b29 (commit)
       via  b3db92ef232324757b4e37a9a91b35152170e316 (commit)
       via  90c62f76d0dd4102de70ab3a54ad4bd5cca9cdd1 (commit)
       via  30eb4aebc9694955270b7778e19ff9b1eb4e35cc (commit)
       via  7da3de0c7662491fa2a0b6f5a638848bcf13a5fa (commit)
       via  494eeedf73d13fac5710e56f3a8fb2e7e2379d73 (commit)
       via  4f6bc662909ab79e8fbe9822afb36e8a0eafc2b7 (commit)
       via  ce681338646435ca064ab2d1b8bde1614e5ed3f1 (commit)
       via  4e713293de84b689c4ab358f3e110ea54aa81925 (commit)
       via  f70ab2044429fe4b991801476ea3f4b4a5c0cdf4 (commit)
       via  ce2afc4f02617dee51f3322ae8386c4b46047c18 (commit)
       via  027c546e0dd11e0526f1780a7f3c2c66acffe209 (commit)
       via  1159afbcad927e1a32008b0ab87e257fc21da8e2 (commit)
       via  67b4efc310af7bf9d30f84a70c6b9858ab138e3d (commit)
       via  02c566b4b5f3f60ff8ebd7f4523722c39c2d72e7 (commit)
       via  f38c6b08c6582872af25fc669a5fd3bde9f32753 (commit)
       via  b25cad42dc869e8e9d7ea58adae2c8baba0ee25d (commit)
       via  e7118494be4162b8c2c06d8b7d4cb2d7ebb57f61 (commit)
       via  485904772c5f0aa1140032746e5a0abfc40f4cef (commit)
       via  94d8955cb7725eb5f3557ddc02310c76124fdd1a (commit)
       via  39b4cdb491c3e09434f5d2b9c334a898fb569850 (commit)
       via  d1eac80695b2c6f2a85942a82518715549541969 (commit)
       via  27409d99b069e434c6863f43456cf8985bbdf7f8 (commit)
       via  407c98a38c3a6ac1681144ed45cc2f4fc374c91f (commit)
       via  e0946e5971fb8a68d058a867821a1f39195e7067 (commit)
       via  af004276fd8f6c305727183c159b83021020f7d6 (commit)
       via  4f73e8b4d578e69a17f452fa60d2130c5faaefd6 (commit)
       via  eaba1d97b62831b42c51840cc8ee2bc4576c942e (commit)
       via  a6f7464dddc689386668a38b92dfd03cc1b38a10 (commit)
       via  2793769ff107d8d22dadd30c6e68cd781b569550 (commit)
       via  366ad48d076c1aa4c8f83c65011258a04e348207 (commit)
       via  ec065fd285f8064ac34cc160106dd730569ebc75 (commit)
       via  e4dce29961108c6fef5c02bf4d5e527b265bf8d8 (commit)
       via  9076e48cf91ba6bf4e939b0562c53e6cbb62282e (commit)
       via  1126deff06d81d4fa1975ea0ed3a3b64e9cf0661 (commit)
       via  bcb881e566d90ae43648085ff1edfdcddcd6eb50 (commit)
       via  aadb53eb834b3def3ef68d78865ff87a68901804 (commit)
       via  9c196bb7f6873b4fe43a649fc87cba363c6af8e5 (commit)
       via  a6e36c29b69b4d15aac872e37303dcf9cb8d7739 (commit)
       via  dbdb5f8527007b482d4e6037b558dbf3e6a06d3a (commit)
       via  f5673b5a50f141440329c62ee5b53eefcd585a3f (commit)
       via  b5bc53eb7223f8999882a5d8e2e35c27fe7a0b57 (commit)
       via  255eef0a7d9d24962ebbcbb4b1858e44b803f16b (commit)
       via  351a2251b4a80fa31ac15229036318b01d124532 (commit)
       via  f54414c8b15b2c27d1dcadd92cfe84f6d15f18dc (commit)
       via  464107095e614d54417ffd2bedbdc852efee0961 (commit)
       via  5eaccd845c9957dff754ebfdde417fe5d82e5e82 (commit)
       via  0d998f17c495a12b04904113ff676c7427089883 (commit)
       via  714e8995cd582d418276915cbbec3c70711fb19e (commit)
       via  c64d06deea998199a0e30180fd884286b4b2256c (commit)
       via  bf72f1a3dd5392ee8291e3b1518a0c2c5dc6ba39 (commit)
       via  fa7f0cde80ce734ddc22bde34d121c1be5c7deb4 (commit)
       via  f1fd4a73480c5a2f900b1541b45a62ffcc75e12d (commit)
       via  67a101f3eb888bc651cc13bfb06280a669a84967 (commit)
       via  4fcbece468706e0e89ed2856729b2ccacbc112be (commit)
       via  19cebe708b9ee3d9e0f8bcdd79dbc6ef9ddc70d2 (commit)
       via  849e74e5ab450dd581942192da7101e0664fa5af (commit)
       via  89f58f1aa95b3482cadf6977da49457194ee5358 (commit)
       via  863ada11f9a942a622a581312e2be022d9e2a6f7 (commit)
       via  9f39ed4a92578a020ae10459643e1fe72573d134 (commit)
       via  d31e25ed5b130499e0d880e4609b1b4824699768 (commit)
       via  6e6c69487094b877bc56fcc07b9840f6e5b95925 (commit)
       via  7870f4951bcc6a153f317e3439e14d0e929fd231 (commit)
       via  1e6b2518ed4b130ad649b96bf914558e642e414d (commit)
       via  a2df79b5fdf97e1e33503634910ad08672bcee39 (commit)
       via  450da26a76286a8342ec0864b3d113856709f8f6 (commit)
       via  93cb0c0adbd9bcfefd021d59c472388f67d3300d (commit)
       via  2c2dc335c212750e0fb8ae157063bc06cafa8d3e (commit)
       via  bfeff28bb56ee4424ac78619792c18bf4f5104ef (commit)
       via  aba3375ac24f8e02659d9b1eb9093909618cdb9f (commit)
       via  4b9e86a33b237740df682369300f1a9507dc63c5 (commit)
       via  17ad4a12dd40799655b71a93de1209a6a0f24204 (commit)
       via  62a1c3cdbb374d2f90b00f7aa276be50961c580a (commit)
       via  e80779ae9f53fac617d1416f7075a1b1b7f7688c (commit)
       via  9ae928f80e70e04e89f0c36a7b58332fb0a9b19d (commit)
       via  9001678252cc6c4e45251db70b83daae39b7d4ec (commit)
       via  d6746f08c592057dfd3abe1b957c8b23971508cc (commit)
       via  de22d4d177a5911310d4af0777e87a8809a1622c (commit)
       via  a1cd6ee4a3724fbf70718483aa702c7af0f0a6cc (commit)
       via  a44d0ce727f2095fbbedb8bf6b1e062fca3c8f01 (commit)
       via  4637eeae2415b593d84bb60dbac5369eb2ecc54b (commit)
       via  dc3b7d7f6882e1ed1ff41083ff22893efc5c5afa (commit)
       via  3ff1490e231c8b02ce77386a75f23ac76e97cc29 (commit)
       via  5ce07cab3d1e9e38401cfaddd0312bd06f48422b (commit)
       via  1bb7a148bc6a4e4a8736d27a937465aab95069e5 (commit)
       via  6d7243cea061373f592a6d9113626393ff0eb7d8 (commit)
       via  a34130a136fa9a61af3991224438dbf31b834767 (commit)
       via  5573498b2d9abe918794d377729edeab6b28e1fb (commit)
       via  a7fe4b47d438c78af0fc03adf030d465cfe0ba4f (commit)
       via  b4521b891de48d7f62be739d02749c4aeca2fde8 (commit)
       via  7c836caa3e05a286ac56f39ed45dab65eb979ee9 (commit)
       via  95e76aad97b1b1c2da51f7fc7e904168fadb1399 (commit)
       via  164db4ba0d766e591884079d6fb21ab63829549d (commit)
       via  618c3867b8edec9d0ea757949c926d4290995ac7 (commit)
       via  7acf36de36e6972be8a892078d214eea8e311cdd (commit)
       via  1170f928cc98b64a26edc275b66f081be9079cbb (commit)
       via  928ae0dbcf9a2307bb33ba8d2abd83274fc34a7d (commit)
       via  65dbe88e660adcfba315fe559fcd7fd97628ee49 (commit)
       via  e22ef03cdd31263ba1266f3d53aef7be4467e405 (commit)
       via  8a3309451ded2335b7f7ab5ebf1c19eebad8b32c (commit)
       via  ac5c8747c9f9e2710a315ff25d41a7b9a592b583 (commit)
       via  e7488d8a4d2bb48d6285d4ba3db1539206f0e67f (commit)
       via  75275c5c001699b32dfdc1d7d7977c8c4c9f2c80 (commit)
       via  74e468866b53e1a11d641549841b06027266ce39 (commit)
       via  72ab3591097a2e5ae5201f4a28d3560b019a1019 (commit)
       via  fbe920c86d42919620a425d0933d9dcbfaa1c3cb (commit)
       via  9dddc61852d012b867e0353c7897b9c5301e17e6 (commit)
       via  d305e46c4af1af14dfe79f7ebab6d2edf168f068 (commit)
       via  797ddfc6ef5f0cdfba664f550fe57acc43f309bb (commit)
       via  d45d594ea5660976a21106ea864eb879801827b1 (commit)
       via  34774ab185f17186b26949f5fee118dee9114d3a (commit)
       via  b2c1beac237865bde26c7fa921d24d17ecda6fab (commit)
       via  faef233630240edfc3ad9f5ea154b5b32ed51c75 (commit)
       via  21a10f9e2cb9134c351fd568fc73222f2917e159 (commit)
       via  61c489110685f7cab8cbbbca7b15d9b5cb2463d0 (commit)
       via  2d990b065c228802b3913602b4309165e42c08e9 (commit)
      from  5de6aee41bbe059374f8d38f96c30ddc39677f4b (commit)

----------------------------------------------------------------------
commit bceaa77e2142b8c09cbc6422de2132239c5f4b29
Merge: b3db92e 7da3de0
Author: Ken Sharp <[email protected]>
Date:   Thu Nov 7 11:55:21 2019 +0000

    Merge branch 'master' into pdfi


----------------------------------------------------------------------
commit b3db92ef232324757b4e37a9a91b35152170e316
Author: Ken Sharp <[email protected]>
Date:   Thu Nov 7 11:55:13 2019 +0000

    Add some halftone handling
    
    This only handles type 1 halftones at present, but it does it using
    the graphics library 'multiple' halftone instead of using the 'screen'
    functions (disabled code with #if 0) which only work with a single
    colour.
    
    This is so that we can use the same code (as Ghostscript does currently)
    for single and multiple colour halftones.
    
    This is far from complete, we still need to handle threshold arrays
    (type 6, 10 and 16) and multiple colour halftones (type 5) but we can't
    do type 5 until the others are in place.

diff --git a/pdf/pdf_gstate.c b/pdf/pdf_gstate.c
index 4e47ac8..626cdb4 100644
--- a/pdf/pdf_gstate.c
+++ b/pdf/pdf_gstate.c
@@ -34,6 +34,11 @@
 #include "gslparam.h"
 #include "gstparam.h"
 
+#include "gxdht.h"
+#include "gxht.h"
+#include "gzht.h"
+#include "gsht.h"
+
 static const char *blend_mode_names[] = {
     GS_BLEND_MODE_NAMES, 0
 };
@@ -200,7 +205,7 @@ int pdfi_op_q(pdf_context *ctx)
 
 int pdfi_op_Q(pdf_context *ctx)
 {
-    int code;
+    int code = 0;
 
     dbgmprintf(ctx->memory, "(doing Q)\n"); /* TODO: Spammy, delete me at some point */
     if (ctx->pgs->level <= ctx->current_stream_save.gsave_level) {
@@ -1065,10 +1070,450 @@ static int GS_TR2(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dic
     return code;
 }
 
+static char *spot_functions[] = {
+    "{dup mul exch dup mul add 1 exch sub}",        /* SimpleDot */
+    "{dup mul exch dup mul add 1 sub}",             /* InvertedSimpleDot */
+    "{360 mul sin 2 div exch 360 mul sin 2 div add",/* DoubleDot */
+    "360 mul sin 2 div exch 360 mul\
+     sin 2 div add neg}",                           /* InvertedDoubleDot */
+    "{180 mul cos exch 180 mul cos add 2 div}",     /* CosineDot */
+    "{360 mul sin 2 div exch 2 div \
+     360 mul sin 2 div add}",                       /* Double */
+    "{360 mul sin 2 div exch 2 div \
+     360 mul sin 2 div add neg}",                   /* InvertedDouble */
+    "{exch pop abs neg}",                           /* Line */
+    "{pop}",                                        /* LineX */
+    "{exch pop}",                                   /* LineY */
+    "{abs exch abs 2 copy add 1.0 le\
+     {dup mul exch dup mul add 1 exch sub}\
+     {1 sub dup mul exch 1 sub dup mul add 1 sub}\
+     ifelse}",                                      /* Round */
+    "{abs exch abs 2 copy 3 mul exch 4 mul\
+     add 3 sub dup 0 lt\
+     {pop dup mul exch 0.75 div dup mul add\
+     4 div 1 exch sub}\
+     {dup 1 gt\
+     {pop 1 exch sub dup mul exch 1 exch sub\
+     0.75 div dup mul add 4 div 1 sub}\
+     {0.5 exch sub exch pop exch pop}}\
+     ifelse}ifelse}}",                              /* Ellipse */
+    "{dup mul 0.9 mul exch dup mul add 1 exch sub}",/* EllipseA */
+    "{dup mul 0.9 mul exch dup mul add 1 sub}",     /* InvertedEllipseA */
+    "{dup 5 mul 8 div mul exch dup mul exch add\
+     sqrt 1 exch sub}",                             /* EllipseB */
+    "{dup mul exch dup mul 0.9 mul add 1 exch sub}",/* EllipseC */
+    "{dup mul exch dup mul 0.9 mul add 1 sub}",     /* InvertedEllipseC */
+    "{abs exch abs 2 copy lt {exch} if pop neg}",   /* Square */
+    "{abs exch abs 2 copy gt {exch} if pop neg}",   /* Cross */
+    "{abs exch abs 0.9 mul add 2 div}",             /* Rhomboid */
+    "{abs exch abs 2 copy add 0.75 le\
+     {dup mul exch dup mul add 1 exch sub}\
+     {1 copy add 1.23 le\
+     {0.85 mul add 1 exch sub}\
+     {1 sub dup mul exch 1 sub dup mul add 1 sub}\
+     ifelse} ifelse}"                               /* Diamond */
+};
+
+static char *spot_table[] = {
+    "SimpleDot",
+    "InvertedSimpleDot",
+    "DoubleDot",
+    "InvertedDoubleDot",
+    "CosineDot",
+    "Double",
+    "InvertedDouble",
+    "Line",
+    "LineX",
+    "LineY",
+    "Round",
+    "Ellipse",
+    "EllipseA",
+    "InvertedEllipseA",
+    "EllipseB",
+    "EllipseC",
+    "InvertedEllipseC",
+    "Square",
+    "Cross",
+    "Rhomboid",
+    "Diamond"
+};
+
+#if 0
+static int pdfi_set_halftone(pdf_context *ctx, pdf_obj *obj, pdf_dict *stream_dict, pdf_dict *page_dict, bool is_TR)
+{
+    int code = 0;
+
+    if (obj->type == PDF_NAME) {
+            if (pdfi_name_is((const pdf_name *)obj, "Default")) {
+                goto exit;
+            } else {
+                code = gs_note_error(gs_error_rangecheck);
+                goto exit;
+            }
+    }
+
+    if (obj->type == PDF_ARRAY) {
+        if (pdfi_array_size((pdf_array *)obj) != 4) {
+            code = gs_note_error(gs_error_rangecheck);
+            goto exit;
+        } else {
+            code = pdfi_set_all_transfers(ctx, (pdf_array *)obj, page_dict, false);
+        }
+    } else
+        code = pdfi_set_gray_transfer(ctx, (pdf_dict *)obj, page_dict);
+
+exit:
+    return code;
+}
+
+int do_screen(pdf_context *ctx, pdf_dict *halftone_dict, pdf_dict *stream_dict, pdf_dict *page_dict)
+{
+    gs_screen_enum *penum = NULL;
+    gs_point pt;
+    int code;
+    gs_screen_halftone screen;
+    gx_ht_order order;
+    pdf_obj *obj = NULL;
+    double f, a;
+    float values[2] = {0, 0}, domain[2] = {-1, 1}, out;
+    gs_function_t *pfn = NULL;
+
+    memset(&screen, 0x00, sizeof(gs_screen_halftone));
+
+    code = pdfi_dict_get_number(ctx, halftone_dict, "Frequency", &f);
+    if (code < 0)
+        return code;
+
+    code = pdfi_dict_get_number(ctx, halftone_dict, "Angle", &a);
+    if (code < 0)
+        return code;
+
+    code = pdfi_dict_get(ctx, halftone_dict, "SpotFunction", &obj);
+    if (code < 0)
+        return code;
+
+    if (obj->type == PDF_NAME) {
+        if (pdfi_name_is((pdf_name *)obj, "Default")) {
+            return 0;
+        } else {
+            int i;
+
+            for (i = 0; i < sizeof(spot_table); i++){
+                if (pdfi_name_is((pdf_name *)obj, spot_table[i]))
+                    break;
+            }
+            if (i > sizeof(spot_table))
+                return gs_note_error(gs_error_rangecheck);
+            code = pdfi_build_halftone_function(ctx, &pfn, (byte *)spot_functions[i], strlen(spot_functions[i]));
+            if (code < 0)
+                goto error;
+        }
+    } else {
+        if (obj->type == PDF_DICT) {
+            code = pdfi_build_function(ctx, &pfn, (const float *)domain, 2, (pdf_dict *)obj, page_dict);
+            if (code < 0)
+                goto error;
+        } else
+            return gs_note_error(gs_error_typecheck);
+    }
+
+    screen.frequency = f;
+    screen.angle = a;
+
+    code = gs_screen_order_init_memory(&order, ctx->pgs, &screen,
+                                       gs_currentaccuratescreens(ctx->memory), ctx->memory);
+    if (code < 0)
+        goto error;
+
+    penum = gs_screen_enum_alloc(ctx->memory, "HT");
+    if (penum == 0) {
+        code = gs_error_VMerror;
+        goto error;
+    }
+
+    code = gs_screen_enum_init_memory(penum, &order, ctx->pgs, &screen, ctx->memory);
+    if (code < 0)
+        goto error;
+
+    do {
+        /* Generate x and y, the parameteric variables */
+        code = gs_screen_currentpoint(penum, &pt);
+        if (code < 0)
+            goto error;
+
+        if (code == 1)
+            break;
+
+        /* Process sample */
+        values[0] = pt.x, values[1] = pt.y;
+        code = gs_function_evaluate(pfn, (const float *)&values, &out);
+        if (code < 0)
+            goto error;
+
+        /* Store the sample */
+        code = gs_screen_next(penum, out);
+        if (code < 0)
+            goto error;
+
+    } while (1);
+    code = 0;
+
+    gs_screen_install(penum);
+
+error:
+    pdfi_countdown(obj);
+    pdfi_free_function(ctx, pfn);
+    gs_free_object(ctx->memory, penum, "HT");
+    return code;
+}
+#endif
+
+/* Dummy spot function */
+static float
+pdfi_spot1_dummy(double x, double y)
+{
+    return (x + y) / 2;
+}
+
+static int build_type1_halftone(pdf_context *ctx, pdf_dict *halftone_dict, pdf_dict *page_dict, gx_device_halftone *pdht, gs_halftone_component *phtc, char *name, int len)
+{
+    int code;
+    pdf_obj *obj = NULL;
+    double f, a;
+    float values[2] = {0, 0}, domain[4] = {-1, 1, -1, 1}, out;
+    gs_function_t *pfn = NULL;
+    gx_ht_order *order = NULL;
+    gs_screen_enum *penum = NULL;
+    gs_point pt;
+
+    code = pdfi_dict_get_number(ctx, halftone_dict, "Frequency", &f);
+    if (code < 0)
+        return code;
+
+    code = pdfi_dict_get_number(ctx, halftone_dict, "Angle", &a);
+    if (code < 0)
+        return code;
+
+    code = pdfi_dict_get(ctx, halftone_dict, "SpotFunction", &obj);
+    if (code < 0)
+        return code;
+
+    order = (gx_ht_order *)gs_alloc_bytes(ctx->memory, sizeof(gx_ht_order), "build_type1_halftone");
+    if (order == NULL) {
+        code = gs_note_error(gs_error_VMerror);
+        goto error;
+    }
+
+    if (obj->type == PDF_NAME) {
+        if (pdfi_name_is((pdf_name *)obj, "Default")) {
+            code = 0;
+            goto error;
+        } else {
+            int i;
+
+            for (i = 0; i < sizeof(spot_table); i++){
+                if (pdfi_name_is((pdf_name *)obj, spot_table[i]))
+                    break;
+            }
+            if (i > sizeof(spot_table))
+                return gs_note_error(gs_error_rangecheck);
+            code = pdfi_build_halftone_function(ctx, &pfn, (byte *)spot_functions[i], strlen(spot_functions[i]));
+            if (code < 0)
+                goto error;
+        }
+    } else {
+        if (obj->type == PDF_DICT) {
+            code = pdfi_build_function(ctx, &pfn, (const float *)domain, 2, (pdf_dict *)obj, page_dict);
+            if (code < 0)
+                goto error;
+        } else {
+            code = gs_note_error(gs_error_typecheck);
+            goto error;
+        }
+    }
+
+    phtc->params.spot.screen.frequency = f;
+    phtc->params.spot.screen.angle = a;
+    phtc->params.spot.screen.spot_function = pdfi_spot1_dummy;
+    phtc->params.spot.transfer = (code > 0 ? (gs_mapping_proc) 0 : gs_mapped_transfer);
+    phtc->params.spot.transfer_closure.proc = 0;
+    phtc->params.spot.transfer_closure.data = 0;
+    phtc->type = ht_type_spot;
+    code = pdfi_get_name_index(ctx, name, len, (unsigned int *)&phtc->cname);
+    if (code < 0)
+        goto error;
+
+    phtc->comp_number = gs_cname_to_colorant_number(ctx->pgs, name, len, 1);
+
+    code = gs_screen_order_init_memory(order, ctx->pgs, &phtc->params.spot.screen,
+                                       gs_currentaccuratescreens(ctx->memory), ctx->memory);
+    if (code < 0)
+        goto error;
+
+    penum = gs_screen_enum_alloc(ctx->memory, "build_type1_halftone");
+    if (penum == 0) {
+        code = gs_error_VMerror;
+        goto error;
+    }
+
+    code = gs_screen_enum_init_memory(penum, order, ctx->pgs, &phtc->params.spot.screen, ctx->memory);
+    if (code < 0)
+        goto error;
+
+    do {
+        /* Generate x and y, the parameteric variables */
+        code = gs_screen_currentpoint(penum, &pt);
+        if (code < 0)
+            goto error;
+
+        if (code == 1)
+            break;
+
+        /* Process sample */
+        values[0] = pt.x, values[1] = pt.y;
+        code = gs_function_evaluate(pfn, (const float *)&values, &out);
+        if (code < 0)
+            goto error;
+
+        /* Store the sample */
+        code = gs_screen_next(penum, out);
+        if (code < 0)
+            goto error;
+
+    } while (1);
+    code = 0;
+    pdht->order = penum->order;
+
+error:
+    pdfi_countdown(obj);
+    pdfi_free_function(ctx, pfn);
+    gs_free_object(ctx->memory, order, "build_type1_halftone");
+    gs_free_object(ctx->memory, penum, "build_type1_halftone");
+    return code;
+}
+
+static int pdfi_free_halftone(gs_memory_t *memory, void *data, client_name_t cname)
+{
+    gs_halftone *pht = (gs_halftone *)data;
+
+    gs_free_object(memory, pht->params.multiple.components, "pdfi_free_halftone");
+    return 0;
+}
+
+static int pdfi_do_halftone(pdf_context *ctx, pdf_dict *halftone_dict, pdf_dict *page_dict)
+{
+    int code;
+    int64_t type;
+    pdf_obj *obj = NULL;
+    gs_halftone *pht = NULL;
+    gx_device_halftone *pdht = NULL;
+    gs_halftone_component *phtc = NULL;
+
+    code = pdfi_dict_get_int(ctx, halftone_dict, "HalftoneType", &type);
+    if (code < 0)
+        return code;
+
+    pht = (gs_halftone *)gs_alloc_bytes(ctx->memory, sizeof(gs_halftone), "pdfi_do_halftone");
+    if (pht == 0) {
+        code = gs_note_error(gs_error_VMerror);
+        goto error;
+    }
+    memset(pht, 0x00, sizeof(gs_halftone));
+    pht->rc.memory = ctx->memory;
+    pht->rc.free = pdfi_free_halftone;
+
+    pdht = (gx_device_halftone *)gs_alloc_bytes(ctx->memory, sizeof(gx_device_halftone), "pdfi_do_halftone");
+    if (pdht == 0) {
+        code = gs_note_error(gs_error_VMerror);
+        goto error;
+    }
+    memset(pdht, 0x00, sizeof(gx_device_halftone));
+    pdht->num_dev_comp = ctx->pgs->device->color_info.num_components;
+
+    switch(type) {
+        case 1:
+            phtc = (gs_halftone_component *)gs_alloc_bytes(ctx->memory, sizeof(gs_halftone_component), "pdfi_do_halftone");
+            if (phtc == 0) {
+                code = gs_note_error(gs_error_VMerror);
+                goto error;
+            }
+
+            code = build_type1_halftone(ctx, halftone_dict, page_dict, pdht, phtc, "Default", 7);
+            if (code < 0)
+                goto error;
+
+            pht->type = 1;
+            pht->params.multiple.components = phtc;
+            pht->params.multiple.num_comp = 1;
+            pht->params.multiple.get_colorname_string = pdfi_name_from_index;
+            code = gx_gstate_dev_ht_install(ctx->pgs, pdht, pht->type, gs_currentdevice_inline(ctx->pgs));
+            if (code < 0)
+                goto error;
+
+            gx_device_halftone_release(pdht, pdht->rc.memory);
+            ctx->pgs->halftone = pht;
+            rc_increment(ctx->pgs->halftone);
+            gx_unset_both_dev_colors(ctx->pgs);
+            break;
+        case 5:
+            /* The only case involving multiple halftones, we need to enumerate each entry
+             * in the dictionary
+             */
+            /* Type 5 halftone dictionaries are required to have a Default */
+            code = pdfi_dict_get_int(ctx, halftone_dict, "Default", &type);
+            if (code < 0)
+                return code;
+            break;
+        case 6:
+            break;
+        case 10:
+            break;
+        case 16:
+            break;
+        default:
+            return_error(gs_error_rangecheck);
+            break;
+    }
+    gs_free_object(ctx->memory, pdht, "pdfi_do_halftone");
+    return 0;
+
+error:
+    gs_free_object(ctx->memory, pht, "pdfi_do_halftone");
+    gs_free_object(ctx->memory, phtc, "pdfi_do_halftone");
+    gs_free_object(ctx->memory, pdht, "pdfi_do_halftone");
+    return code;
+}
+
 static int GS_HT(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict *page_dict)
 {
-    dbgmprintf(ctx->memory, "ExtGState HT not yet implemented\n");
-    return 0;
+    int code;
+    int64_t type;
+    pdf_obj *obj = NULL;
+    bool error = false;
+
+    code = pdfi_dict_get(ctx, GS, "HT", &obj);
+    if (code < 0)
+        return code;
+
+
+    if (obj->type == PDF_NAME) {
+        if (pdfi_name_is((const pdf_name *)obj, "Default")) {
+            goto exit;
+        } else {
+            code = gs_note_error(gs_error_rangecheck);
+            goto exit;
+        }
+    } else {
+        if (obj->type != PDF_DICT) {
+            code = gs_note_error(gs_error_typecheck);
+            goto exit;
+        }
+        code = pdfi_do_halftone(ctx, (pdf_dict *)obj, page_dict);
+    }
+
+exit:
+    pdfi_countdown(obj);
+    return code;
 }
 
 static int GS_FL(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict *page_dict)

----------------------------------------------------------------------
commit 90c62f76d0dd4102de70ab3a54ad4bd5cca9cdd1
Author: Ken Sharp <[email protected]>
Date:   Thu Nov 7 11:51:49 2019 +0000

    Add code to build a spot function from a Halftone spot
    
    Apart from the actual function, the spots are all the same so we can
    use common code to generate the function.
    
    make pdfi_build_sub_function actually set the error code on an error
    condition, before returning, so we know if this fails and don't try
    to use broken functions. Also pdfi_build_function_0()

diff --git a/pdf/pdf_func.c b/pdf/pdf_func.c
index 688cb02..298d789 100644
--- a/pdf/pdf_func.c
+++ b/pdf/pdf_func.c
@@ -413,8 +413,10 @@ pdfi_build_function_0(pdf_context *ctx, gs_function_params_t * mnDR,
         else
             goto function_0_error;
     }
-    if (code != 2 * params.m)
+    if (code != 2 * params.m) {
+        code = gs_error_rangecheck;
         goto function_0_error;
+    }
 
     code = make_float_array_from_dict(ctx, (float **)&params.Decode, function_dict, "Decode");
     if (code < 0) {
@@ -607,20 +609,28 @@ static int pdfi_build_sub_function(pdf_context *ctx, gs_function_t ** ppfn, cons
     if (code < 0)
         return code;
 
-    if (code & 1)
+    if (code & 1) {
+        code = gs_error_rangecheck;
         goto sub_function_error;
+    }
 
     for (i=0;i<code;i+=2) {
-        if (params.Domain[i] > params.Domain[i+1])
+        if (params.Domain[i] > params.Domain[i+1]) {
+            code = gs_error_rangecheck;
             goto sub_function_error;
+        }
     }
     if (shading_domain) {
-        if (num_inputs != code >> 1)
+        if (num_inputs != code >> 1) {
+            code = gs_error_rangecheck;
             goto sub_function_error;
+        }
 
         for (i=0;i<2*num_inputs;i+=2) {
-            if (params.Domain[i] > shading_domain[i] || params.Domain[i+1] < shading_domain[i+1])
+            if (params.Domain[i] > shading_domain[i] || params.Domain[i+1] < shading_domain[i+1]) {
+                code = gs_error_rangecheck;
                 goto sub_function_error;
+            }
         }
     }
 
@@ -680,3 +690,94 @@ int pdfi_build_function(pdf_context *ctx, gs_function_t ** ppfn, const float *sh
 {
     return pdfi_build_sub_function(ctx, ppfn, shading_domain, num_inputs, stream_dict, page_dict);
 }
+
+int pdfi_build_halftone_function(pdf_context *ctx, gs_function_t ** ppfn, byte *Buffer, int64_t Length)
+{
+    gs_function_PtCr_params_t params;
+    pdf_stream *function_stream = NULL;
+    int code;
+    byte *data_source_buffer;
+    byte *ops = NULL;
+    unsigned int size;
+    float *pfloat;
+    byte *stream_buffer = NULL;
+
+    memset(&params, 0x00, sizeof(gs_function_PtCr_params_t));
+    params.ops.data = 0;	/* in case of failure */
+    params.ops.size = 0;	/* ditto */
+
+    stream_buffer = gs_alloc_bytes(ctx->memory, Length, "pdfi_build_halftone_function(stream_buffer))");
+    if (stream_buffer == NULL)
+        goto halftone_function_error;
+
+    memcpy(stream_buffer, Buffer, Length);
+
+    code = pdfi_open_memory_stream_from_memory(ctx, Length, stream_buffer, &function_stream);
+    if (code < 0)
+        goto halftone_function_error;
+
+    size = 0;
+    code = pdfi_parse_type4_func_stream(ctx, function_stream, 0, NULL, &size);
+    if (code < 0)
+        goto halftone_function_error;
+
+    ops = gs_alloc_string(ctx->memory, size + 1, "pdfi_build_halftone_function(ops)");
+    if (ops == NULL) {
+        code = gs_error_VMerror;
+        goto halftone_function_error;
+    }
+
+    code = pdfi_seek(ctx, function_stream, 0, SEEK_SET);
+    if (code < 0)
+        goto halftone_function_error;
+
+    size = 0;
+    code = pdfi_parse_type4_func_stream(ctx, function_stream, 0, ops, &size);
+    if (code < 0)
+        goto halftone_function_error;
+    ops[size] = PtCr_return;
+
+    code = pdfi_close_memory_stream(ctx, stream_buffer, function_stream);
+    if (code < 0) {
+        function_stream = NULL;
+        goto halftone_function_error;
+    }
+
+    params.ops.data = (const byte *)ops;
+    params.ops.size = size + 1;
+    params.m = 2;
+    params.n = 1;
+    pfloat = (float *)gs_alloc_byte_array(ctx->memory, 4, sizeof(float), "pdfi_build_halftone_function(Domain)");
+    if (pfloat == NULL) {
+        code = gs_error_VMerror;
+        goto halftone_function_error;
+    }
+    pfloat[0] = -1;
+    pfloat[1] = 1;
+    pfloat[2] = -1;
+    pfloat[3] = 1;
+    params.Domain = (const float *)pfloat;
+    pfloat = (float *)gs_alloc_byte_array(ctx->memory, 2, sizeof(float), "pdfi_build_halftone_function(Domain)");
+    if (pfloat == NULL) {
+        code = gs_error_VMerror;
+        goto halftone_function_error;
+    }
+    pfloat[0] = -1;
+    pfloat[1] = 1;
+    params.Range = (const float *)pfloat;
+
+    code = gs_function_PtCr_init(ppfn, &params, ctx->memory);
+    if (code < 0)
+        goto halftone_function_error;
+
+    return 0;
+
+halftone_function_error:
+    if (function_stream)
+        (void)pdfi_close_memory_stream(ctx, stream_buffer, function_stream);
+
+    gs_function_PtCr_free_params(&params, ctx->memory);
+    if (ops)
+        gs_free_const_string(ctx->memory, ops, size, "pdfi_build_function_4(ops)");
+    return code;
+}
diff --git a/pdf/pdf_func.h b/pdf/pdf_func.h
index 5a4a26c..fd71944 100644
--- a/pdf/pdf_func.h
+++ b/pdf/pdf_func.h
@@ -20,6 +20,7 @@
 
 int pdfi_free_function(pdf_context *ctx, gs_function_t *pfn);
 int pdfi_build_function(pdf_context *ctx, gs_function_t ** ppfn, const float *shading_domain, int num_inputs, pdf_dict *stream_dict, pdf_dict *page_dict);
+int pdfi_build_halftone_function(pdf_context *ctx, gs_function_t ** ppfn, byte *Buffer, int64_t Length);
 
 #endif
 

----------------------------------------------------------------------
commit 30eb4aebc9694955270b7778e19ff9b1eb4e35cc
Author: Ken Sharp <[email protected]>
Date:   Thu Nov 7 11:44:43 2019 +0000

    Add a 'name table' for use by halftones.
    
    This is simply a list of 'names' which are persistent across the entire
    job. The interpreter can use the index in places where Ghostscript
    uses a name_index, and pdfi_name_from_index() where the graphics
    library needs a function to return a name string from an index.

diff --git a/pdf/ghostpdf.c b/pdf/ghostpdf.c
index 018fdd5..f518362 100644
--- a/pdf/ghostpdf.c
+++ b/pdf/ghostpdf.c
@@ -406,6 +406,90 @@ pdfi_report_errors(pdf_context *ctx)
     dmprintf(ctx->memory, "   **** specification.\n\n");
 }
 
+/* Name table
+ * I've been trying to avoid this for as long as possible, but it seems it cannot
+ * be evaded. We need functions to get an index for a given string (which will
+ * add the string to the table if its not present) and to cleear up the table
+ * on finishing a PDF file.
+ */
+
+int pdfi_get_name_index(pdf_context *ctx, char *name, int len, unsigned int *returned)
+{
+    pdfi_name_entry *e = NULL, *last_entry = NULL, *new_entry = NULL;
+    int index = 0;
+
+    if (ctx->name_table == NULL) {
+        e = NULL;
+    } else {
+        e = ctx->name_table;
+    }
+
+    while(e != NULL) {
+        if (e->len == len) {
+            if (memcmp(e->name, name, e->len) == 0) {
+                *returned = e->index;
+                return 0;
+            }
+        }
+        last_entry = e;
+        index = e->index;
+    }
+
+    new_entry = (pdfi_name_entry *)gs_alloc_bytes(ctx->memory, sizeof(pdfi_name_entry), "Alloc name table entry");
+    if (new_entry == NULL)
+        return_error(gs_error_VMerror);
+    memset(new_entry, 0x00, sizeof(pdfi_name_entry));
+    new_entry->name = (char *)gs_alloc_bytes(ctx->memory, len+1, "Alloc name table name");
+    if (new_entry->name == NULL) {
+        gs_free_object(ctx->memory, new_entry, "Failed to allocate name entry");
+            return_error(gs_error_VMerror);
+    }
+    memset(new_entry->name, 0x00, len+1);
+    memcpy(new_entry->name, name, len);
+    new_entry->len = len;
+    new_entry->index = ++index;
+
+    if (last_entry)
+        last_entry->next = new_entry;
+    else
+        ctx->name_table = new_entry;
+
+    *returned = new_entry->index;
+    return 0;
+}
+
+static int pdfi_free_name_table(pdf_context *ctx)
+{
+    if (ctx->name_table) {
+        pdfi_name_entry *next = NULL, *e = (pdfi_name_entry *)ctx->name_table;
+
+        while (e != NULL) {
+            next = (pdfi_name_entry *)e->next;
+            gs_free_object(ctx->memory, e->name, "free name table entries");
+            gs_free_object(ctx->memory, e, "free name table entries");
+            e = next;
+        }
+    }
+    ctx->name_table = NULL;
+    return 0;
+}
+
+int pdfi_name_from_index(const gs_memory_t *mem, gs_separation_name index, unsigned char **name, unsigned int *len)
+{
+    pdf_context *ctx = (pdf_context *)mem->gs_lib_ctx;
+    pdfi_name_entry *next = NULL, *e = (pdfi_name_entry *)ctx->name_table;
+
+    while (e != NULL) {
+        if (e->index == index) {
+            *name = (unsigned char *)e->name;
+            *len = e->len;
+        }
+        e = e->next;
+    }
+
+    return_error(gs_error_undefined);
+}
+
 /* These functions are used by the 'PL' implementation, eventually we will */
 /* need to have custom PostScript operators to process the file or at      */
 /* (least pages from it).                                                  */
@@ -420,6 +504,7 @@ int pdfi_close_pdf_file(pdf_context *ctx)
         ctx->main_stream = NULL;
     }
     ctx->main_stream_length = 0;
+    pdfi_free_name_table(ctx);
     return 0;
 }
 
diff --git a/pdf/ghostpdf.h b/pdf/ghostpdf.h
index 821fa2d..65d99fc 100644
--- a/pdf/ghostpdf.h
+++ b/pdf/ghostpdf.h
@@ -166,6 +166,13 @@ typedef struct stream_save_s {
     int group_depth;
 } stream_save;
 
+typedef struct name_entry {
+    char *name;
+    int len;
+    unsigned int index;
+    void *next;
+} pdfi_name_entry;
+
 typedef struct pdf_context_s
 {
     void *instance;
@@ -237,6 +244,9 @@ typedef struct pdf_context_s
      */
     bool spot_capable_device;
 
+    /* A name table :-( */
+    pdfi_name_entry *name_table;
+
     /* We need a gs_font_dir for gs_definefotn() */
     gs_font_dir * font_dir;
     /* Obviously we need a graphics state */
@@ -340,6 +350,8 @@ typedef struct pdf_context_s
 pdf_context *pdfi_create_context(gs_memory_t *pmem);
 int pdfi_free_context(gs_memory_t *pmem, pdf_context *ctx);
 
+int pdfi_get_name_index(pdf_context *ctx, char *name, int len, unsigned int *returned);
+int pdfi_name_from_index(const gs_memory_t *mem, gs_separation_name index, unsigned char **name, unsigned int *len);
 int pdfi_open_pdf_file(pdf_context *ctx, char *filename);
 int pdfi_process_pdf_file(pdf_context *ctx, char *filename);
 int pdfi_close_pdf_file(pdf_context *ctx);

----------------------------------------------------------------------
commit e0946e5971fb8a68d058a867821a1f39195e7067
Author: Ken Sharp <[email protected]>
Date:   Mon Nov 4 16:48:20 2019 +0000

    Fix a couple of casts that were throwing warnings

diff --git a/pdf/pdf_dict.c b/pdf/pdf_dict.c
index e620eb6..7ab3dd0 100644
--- a/pdf/pdf_dict.c
+++ b/pdf/pdf_dict.c
@@ -629,12 +629,12 @@ int pdfi_dict_put_bool(pdf_context *ctx, pdf_dict *d, const char *key, bool valu
     int code;
     pdf_bool *obj = NULL;
 
-    code = pdfi_alloc_object(ctx, PDF_BOOL, 0, (pdf_bool **)&obj);
+    code = pdfi_alloc_object(ctx, PDF_BOOL, 0, (pdf_obj **)&obj);
     if (code < 0)
         return code;
 
     obj->value = value;
-    return pdfi_dict_put(ctx, d, key, (pdf_bool *)obj);
+    return pdfi_dict_put(ctx, d, key, (pdf_obj *)obj);
 }
 
 int pdfi_dict_put_name(pdf_context *ctx, pdf_dict *d, const char *key, const char *name)


Summary of changes:
 Resource/Init/gs_fonts.ps                    |   19 +
 Resource/Init/gs_init.ps                     |   19 +-
 Resource/Init/gs_ttf.ps                      |    8 +-
 Resource/Init/pdf_base.ps                    |  201 +-
 Resource/Init/pdf_draw.ps                    |  263 +-
 Resource/Init/pdf_main.ps                    |   63 +-
 base/cal.mak                                 |    7 +
 base/ets.h                                   |    1 +
 base/gdevdevn.c                              |   13 +
 base/gdevdflt.c                              |    5 +
 base/genconf.c                               |   11 +-
 base/gp_unix.c                               |    6 +
 base/gpmisc.c                                |    6 +-
 base/gsdevmem.c                              |    2 +-
 base/gsfunc4.c                               |    9 +-
 base/gsht.c                                  |    3 +-
 base/gsparam.c                               |   25 +-
 base/gsptype1.c                              |    2 +-
 base/gstype42.c                              |   11 +-
 base/gxacpath.c                              |    4 +-
 base/gxblend.c                               |    4 +-
 base/gxclrect.c                              |    5 +-
 base/gxclthrd.c                              |    2 +-
 base/gxcpath.c                               |    6 +-
 base/gxdevice.h                              |    4 +-
 base/gxdownscale.c                           |   62 +-
 base/gxicolor.c                              |   35 +-
 base/gxstroke.c                              |    2 +-
 base/lib.mak                                 |   19 +-
 base/memento.c                               |   83 +-
 base/memento.h                               |   24 +
 base/version.mak                             |    6 +-
 contrib/contrib.mak                          |    6 +-
 contrib/eplaser/gdevescv.c                   |   23 +-
 contrib/gdevbjc_.c                           |   28 +-
 contrib/gdevbjc_.h                           |    4 +-
 contrib/gdevbjca.c                           |   40 +-
 contrib/gdevcd8.c                            |   65 +-
 contrib/gdevdj9.c                            |  196 +-
 contrib/gdevgdi.c                            |    4 +-
 contrib/gdevln03.c                           |    2 +-
 contrib/gdevlx32.c                           |   12 +-
 contrib/gdevmd2k.c                           |   26 +-
 contrib/gdevop4w.c                           |    8 +-
 contrib/japanese/gdev10v.c                   |   19 +-
 contrib/japanese/gdevalps.c                  |   27 +-
 contrib/japanese/gdevespg.c                  |   20 +-
 contrib/japanese/gdevmjc.c                   |   35 +-
 contrib/japanese/gdevnpdl.c                  |   68 +-
 contrib/japanese/gdevrpdl.c                  |    8 +-
 contrib/lips4/gdevl4r.c                      |   41 +-
 contrib/lips4/gdevlips.c                     |    4 +-
 contrib/lips4/gdevlips.h                     |   32 +-
 contrib/lips4/gdevlprn.c                     |    9 +-
 contrib/pcl3/eprn/mediasize.c                |    6 +-
 contrib/pcl3/eprn/mediasize.h                |    4 +-
 contrib/pcl3/src/gdevpcl3.c                  |    4 +-
 contrib/pcl3/src/pclcap.c                    |  298 +-
 contrib/pcl3/src/pclgen.c                    |    2 +-
 devices/contrib.mak                          |  230 +-
 devices/gdev3852.c                           |   15 +-
 devices/gdevatx.c                            |   11 +
 devices/gdevcdj.c                            |    4 +-
 devices/gdevcif.c                            |   22 +-
 devices/gdevclj.c                            |   23 +-
 devices/gdevdm24.c                           |   45 +-
 devices/gdevepsc.c                           |   58 +-
 devices/gdevepsn.c                           |   19 +-
 devices/gdevlbp8.c                           |   15 +-
 devices/gdevlp8k.c                           |    5 +-
 devices/gdevlxm.c                            |   49 +-
 devices/gdevmgr.c                            |   18 +-
 devices/gdevokii.c                           |   46 +-
 devices/gdevpcx.c                            |    2 +-
 devices/gdevpdfimg.c                         |   14 +
 devices/gdevphex.c                           |   30 +-
 devices/gdevpjet.c                           |   59 +-
 devices/gdevplan.c                           |   15 +-
 devices/gdevpng.c                            |   14 +-
 devices/gdevtfnx.c                           |    8 +-
 devices/gdevtifs.c                           |    5 +
 devices/gdevtsep.c                           |    4 +-
 devices/vector/gdevagl.c                     |    2 +-
 devices/vector/gdevpdf.c                     |    1 +
 devices/vector/gdevpdfb.h                    |    1 +
 devices/vector/gdevpdfd.c                    |    4 +-
 devices/vector/gdevpdfe.c                    |    5 +
 devices/vector/gdevpdfg.c                    |   82 +-
 devices/vector/gdevpdfg.h                    |    8 +-
 devices/vector/gdevpdft.c                    |    4 +-
 devices/vector/gdevpdfx.h                    |    1 +
 devices/vector/gdevpdts.c                    |    2 +-
 devices/vector/gdevpdtt.c                    |    4 +-
 devices/vector/gdevpsu.c                     |    5 +
 devices/vector/gdevtxtw.c                    |  160 +-
 devices/vector/gdevxps.c                     |   43 +-
 doc/API.htm                                  |    2 +-
 doc/C-style.htm                              |    2 +-
 doc/DLL.htm                                  |    4 +-
 doc/Deprecated.htm                           |    4 +-
 doc/Develop.htm                              |    4 +-
 doc/Devices.htm                              |    4 +-
 doc/Drivers.htm                              |    4 +-
 doc/Fonts.htm                                |    4 +-
 doc/History9.htm                             | 7470 +++++++++++++++++++++++++-
 doc/Install.htm                              |    4 +-
 doc/Internal.htm                             |    4 +-
 doc/Language.htm                             |   46 +-
 doc/Lib.htm                                  |    4 +-
 doc/Make.htm                                 |   16 +-
 doc/News.htm                                 |   70 +-
 doc/Ps-style.htm                             |    4 +-
 doc/Ps2epsi.htm                              |    4 +-
 doc/Psfiles.htm                              |    4 +-
 doc/Readme.htm                               |    4 +-
 doc/Release.htm                              |    4 +-
 doc/SavedPages.htm                           |    2 +-
 doc/Source.htm                               |    4 +-
 doc/Unix-lpr.htm                             |    4 +-
 doc/Use.htm                                  |   45 +-
 doc/VectorDevices.htm                        |   18 +-
 doc/WhatIsGS.htm                             |    4 +-
 doc/gs-vms.hlp                               |    2 +-
 doc/sample_downscale_device.htm              |    4 +-
 doc/subclass.htm                             |    2 +-
 doc/thirdparty.htm                           |    4 +-
 examples/transparency_example.ps             |    2 +-
 lib/Fontmap.URW-136.T1                       |  580 --
 lib/Fontmap.URW-136.TT                       |  574 --
 lib/dvipdf                                   |    2 +-
 man/dvipdf.1                                 |    4 +-
 man/gs.1                                     |    4 +-
 man/gslp.1                                   |    4 +-
 man/gsnd.1                                   |    4 +-
 man/pdf2dsc.1                                |    4 +-
 man/pdf2ps.1                                 |    4 +-
 man/pf2afm.1                                 |    4 +-
 man/pfbtopfa.1                               |    4 +-
 man/printafm.1                               |    4 +-
 man/ps2ascii.1                               |    4 +-
 man/ps2epsi.1                                |    4 +-
 man/ps2pdf.1                                 |    4 +-
 man/ps2pdfwr.1                               |    4 +-
 man/ps2ps.1                                  |    4 +-
 pcl/pcl/pgdraw.c                             |   28 +-
 pcl/pcl/pglabel.c                            |   10 +-
 pcl/pcl/pgmisc.h                             |   12 +-
 pcl/pcl/pgparse.c                            |    9 +-
 pcl/pcl/pgpoly.c                             |   21 +-
 pcl/pl/pjparse.c                             |    7 +-
 pcl/pl/plsymbol.c                            |   57 +
 pdf/ghostpdf.c                               |   85 +
 pdf/ghostpdf.h                               |   12 +
 pdf/pdf_dict.c                               |    4 +-
 pdf/pdf_func.c                               |  111 +-
 pdf/pdf_func.h                               |    1 +
 pdf/pdf_gstate.c                             |  451 +-
 psi/zbfont.c                                 |    2 +-
 psi/zfont2.c                                 |   10 +-
 psi/ztype.c                                  |    9 +-
 toolbin/genfontmap.ps                        |   16 +-
 toolbin/halftone/thresh_remap/thresh_remap.c |    2 +-
 toolbin/localcluster/clusterpush.pl          |    1 +
 toolbin/vdb.pl                               |  280 +-
 xps/xpscolor.c                               |    4 +
 xps/xpsimage.c                               |    2 +
 xps/xpsopacity.c                             |    2 +
 167 files changed, 10534 insertions(+), 2521 deletions(-)
 delete mode 100644 lib/Fontmap.URW-136.T1
 delete mode 100644 lib/Fontmap.URW-136.TT