]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix the handling of font backend supersedence on MS-Windows
authorEli Zaretskii <eliz@gnu.org>
Tue, 18 Jun 2019 17:21:40 +0000 (20:21 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 18 Jun 2019 17:21:40 +0000 (20:21 +0300)
* 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.

src/w32fns.c
src/w32font.c
src/w32uniscribe.c

index 83830c616e598d734d78fec134c1fe4ba98abbd5..acd9c80528a05c410ce3bc123b181089e72199cd 100644 (file)
@@ -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);
index 5d54f048fb51b61b77a1119fc7cfc1061e775fc1..14d49b24d9bd5b37aca567dd6315ecb28bb342ac 100644 (file)
@@ -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);
 }
 
index caf346a5ec264f277f616cf8428aa1c08f511083..d59d564abb4aa1724daa8146024f796daedd2f3c 100644 (file)
@@ -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;