From 0a91670f825f5302d0e75710b9e86ce04a861998 Mon Sep 17 00:00:00 2001
From: Max Chernoff <49086429+gucci-on-fleek@users.noreply.github.com>
Date: Tue, 4 Jul 2023 19:53:10 -0600
Subject: [PATCH 1/3] Don't require \pdfextension glyphtounicode before writing
 a /ToUnicode for a Lua-defined font

---
 source/texk/web2c/luatexdir/font/tounicode.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/source/texk/web2c/luatexdir/font/tounicode.c b/source/texk/web2c/luatexdir/font/tounicode.c
index 68b6e01f..135e27c1 100644
--- a/source/texk/web2c/luatexdir/font/tounicode.c
+++ b/source/texk/web2c/luatexdir/font/tounicode.c
@@ -329,10 +329,6 @@ static int do_write_tounicode(PDF pdf, char **glyph_names, char *name, internal_
     int objnum;
     int i, j;
     int bfchar_count, bfrange_count, subrange_count;
-    if (glyph_unicode_tree == NULL) {
-        pdf->gen_tounicode = 0;
-        return 0;
-    }
     if (name == NULL) {
         strcpy(buf, "no-name");
     } else {
@@ -370,7 +366,7 @@ static int do_write_tounicode(PDF pdf, char **glyph_names, char *name, internal_
         if (! done) {
             return 0;
         }
-    } else {
+    } else if (glyph_unicode_tree != NULL) {
         for (i = 0; i < 256; ++i) {
             gtab[i].code = UNI_UNDEF;
             set_glyph_unicode(glyph_names[i], &gtab[i]);
-- 
2.41.0

