From 4c49daf7cd961fb47126baf04240243736cae606 Mon Sep 17 00:00:00 2001
From: Garret Rieger <grieger@google.com>
Date: Wed, 23 Nov 2022 22:33:57 +0000
Subject: [PATCH] [subset] actually use the preprocessed face in hb-subset.

Tests weren't actually using the preprocessed face due to this typo in util/hb-subset.
---
 src/hb-subset-input.cc | 5 +++++
 util/hb-subset.cc      | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/hb-subset-input.cc b/src/hb-subset-input.cc
index 18a07fead..232ab0493 100644
--- a/src/hb-subset-input.cc
+++ b/src/hb-subset-input.cc
@@ -483,6 +483,11 @@ hb_subset_preprocess (hb_face_t *source)
   hb_set_invert (hb_subset_input_set(input,
                                      HB_SUBSET_SETS_NAME_ID));
 
+  hb_set_clear (hb_subset_input_set(input,
+                                    HB_SUBSET_SETS_NAME_LANG_ID));
+  hb_set_invert (hb_subset_input_set(input,
+                                     HB_SUBSET_SETS_NAME_LANG_ID));
+
   hb_subset_input_set_flags(input,
                             HB_SUBSET_FLAGS_NOTDEF_OUTLINE |
                             HB_SUBSET_FLAGS_GLYPH_NAMES |
diff --git a/util/hb-subset.cc b/util/hb-subset.cc
index f2606c767..171f27c8c 100644
--- a/util/hb-subset.cc
+++ b/util/hb-subset.cc
@@ -120,7 +120,7 @@ struct subset_main_t : option_parser_t, face_options_t, output_options_t<false>
     for (unsigned i = 0; i < num_iterations; i++)
     {
       hb_face_destroy (new_face);
-      new_face = hb_subset_or_fail (face, input);
+      new_face = hb_subset_or_fail (orig_face, input);
     }
 
     bool success = new_face;