[subset] always return a valid face from hb_subset_preprocess.
This commit is contained in:
parent
a80cae4453
commit
76d5482a7c
|
@ -464,6 +464,8 @@ HB_EXTERN hb_face_t *
|
||||||
hb_subset_preprocess (hb_face_t *source)
|
hb_subset_preprocess (hb_face_t *source)
|
||||||
{
|
{
|
||||||
hb_subset_input_t* input = hb_subset_input_create_or_fail ();
|
hb_subset_input_t* input = hb_subset_input_create_or_fail ();
|
||||||
|
if (!input)
|
||||||
|
return source;
|
||||||
|
|
||||||
hb_set_clear (hb_subset_input_set(input, HB_SUBSET_SETS_UNICODE));
|
hb_set_clear (hb_subset_input_set(input, HB_SUBSET_SETS_UNICODE));
|
||||||
hb_set_invert (hb_subset_input_set(input, HB_SUBSET_SETS_UNICODE));
|
hb_set_invert (hb_subset_input_set(input, HB_SUBSET_SETS_UNICODE));
|
||||||
|
@ -505,6 +507,11 @@ hb_subset_preprocess (hb_face_t *source)
|
||||||
hb_face_t* new_source = hb_subset_or_fail (source, input);
|
hb_face_t* new_source = hb_subset_or_fail (source, input);
|
||||||
hb_subset_input_destroy (input);
|
hb_subset_input_destroy (input);
|
||||||
|
|
||||||
|
if (!new_source) {
|
||||||
|
DEBUG_MSG (SUBSET, nullptr, "Preprocessing failed due to subset failure.");
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
return new_source;
|
return new_source;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue