# HG changeset patch
# User Aidan Kehoe <kehoea@parhasard.net>
# Date 1739950047 0
#      Wed Feb 19 07:27:27 2025 +0000
# Node ID 10e8e0fb778fdfcace7e2257d1f1cd0a74446e66
# Parent  b2a7a1a58d1fba872a100db28ba45ddc6239cfeb
Delay calls to FcInit() at startup until an XFT font is actually opened.

src/ChangeLog addition:

2025-02-19  Aidan Kehoe  <kehoea@parhasard.net>

	Delay calls to FcInit() until
	lwlib-fonts.c:xft_open_font_by_name() or
	fontcolor-xlike-inc.c:xft_find_charset_font(), avoiding updating
	out-of-tree cache files at build time, something Gentoo does not
	like. Thank you for the bug report, Mats Lidell.
	* emacs.c (main_1):
	Remove the call to reinit_vars_of_font_mgr() here.
	* font-mgr.c (reinit_vars_of_font_mgr): Removed. All it did was
	call FcInit() basically directly after pdump_load(), for which
	there is no need, reasonable to delay until we open an X11 device.
	* symsinit.h:
	Remove its declaration.

diff -r b2a7a1a58d1f -r 10e8e0fb778f src/emacs.c
--- a/src/emacs.c	Wed Feb 19 06:13:45 2025 +0000
+++ b/src/emacs.c	Wed Feb 19 07:27:27 2025 +0000
@@ -2235,9 +2235,6 @@
 #if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_X_DIALOGS) || defined (HAVE_TOOLBARS)
       reinit_vars_of_gui_x ();
 #endif
-#ifdef HAVE_XFT
-      reinit_vars_of_font_mgr ();
-#endif
 #endif /* HAVE_X_WINDOWS */
 
       reinit_vars_of_mule_coding ();
diff -r b2a7a1a58d1f -r 10e8e0fb778f src/font-mgr.c
--- a/src/font-mgr.c	Wed Feb 19 06:13:45 2025 +0000
+++ b/src/font-mgr.c	Wed Feb 19 07:27:27 2025 +0000
@@ -1439,9 +1439,4 @@
   Vxlfd_font_name_regexp = make_xlfd_font_regexp();
 }
 
-void
-reinit_vars_of_font_mgr (void)
-{
-  FcInit ();
-}
-
+/* font-mgr.c ends here */
diff -r b2a7a1a58d1f -r 10e8e0fb778f src/symsinit.h
--- a/src/symsinit.h	Wed Feb 19 06:13:45 2025 +0000
+++ b/src/symsinit.h	Wed Feb 19 07:27:27 2025 +0000
@@ -419,7 +419,6 @@
 void vars_of_font_lock (void);
 void reinit_vars_of_font_lock (void);
 void vars_of_font_mgr (void);
-void reinit_vars_of_font_mgr (void);
 void vars_of_frame (void);
 void vars_of_frame_gtk (void);
 void vars_of_frame_mswindows (void);
