From: Eli Zaretskii Date: Tue, 18 Jun 2019 17:21:40 +0000 (+0300) Subject: Fix the handling of font backend supersedence on MS-Windows X-Git-Tag: emacs-27.0.90~2413 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=922121e7ddbc107da14ea9c1280d15c828e85063;p=emacs.git Fix the handling of font backend supersedence on MS-Windows * src/w32font.c (syms_of_w32font): Don't make the Uniscribe font backend "superceded" here, ... * src/w32uniscribe.c (syms_of_w32uniscribe_for_pdumper): ... make it "superceded" here, only if the HarfBuzz DLL was successfully loaded. This is because Emacs compiled with HarfBuzz support might run on a system without the DLL. * src/w32fns.c (Fx_create_frame, w32_create_tip_frame): Register the HarfBuzz font backend only if it is available. --- diff --git a/src/w32fns.c b/src/w32fns.c index 83830c616e5..acd9c80528a 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -5845,7 +5845,8 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, } #ifdef HAVE_HARFBUZZ - register_font_driver (&harfbuzz_font_driver, f); + if (harfbuzz_available) + register_font_driver (&harfbuzz_font_driver, f); #endif register_font_driver (&uniscribe_font_driver, f); register_font_driver (&w32font_driver, f); @@ -6900,7 +6901,8 @@ w32_create_tip_frame (struct w32_display_info *dpyinfo, Lisp_Object parms) } #ifdef HAVE_HARFBUZZ - register_font_driver (&harfbuzz_font_driver, f); + if (harfbuzz_available) + register_font_driver (&harfbuzz_font_driver, f); #endif register_font_driver (&uniscribe_font_driver, f); register_font_driver (&w32font_driver, f); diff --git a/src/w32font.c b/src/w32font.c index 5d54f048fb5..14d49b24d9b 100644 --- a/src/w32font.c +++ b/src/w32font.c @@ -2821,8 +2821,6 @@ versions of Windows) characters. */); defsubr (&Sx_select_font); - Fput (Quniscribe, Qfont_driver_superseded_by, Qharfbuzz); - pdumper_do_now_and_after_load (syms_of_w32font_for_pdumper); } diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index caf346a5ec2..d59d564abb4 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c @@ -1533,6 +1533,7 @@ syms_of_w32uniscribe_for_pdumper (void) if (!load_harfbuzz_funcs (harfbuzz)) return; + Fput (Quniscribe, Qfont_driver_superseded_by, Qharfbuzz); harfbuzz_available = 1; harfbuzz_font_driver = uniscribe_font_driver; harfbuzz_font_driver.type = Qharfbuzz;