[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master b5dd337ada: Fix initialization of Haiku font driver
From: |
Po Lu |
Subject: |
master b5dd337ada: Fix initialization of Haiku font driver |
Date: |
Mon, 20 Jun 2022 07:00:14 -0400 (EDT) |
branch: master
commit b5dd337ada80ec89651677cfd8630380afca6f91
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Fix initialization of Haiku font driver
* src/font.c (register_font_driver): Fix comment.
* src/haikufont.c (haikufont_booleans): New list.
(haikufont_filter_properties): New function.
(haikufont_driver): Register new hook.
(syms_of_haikufont_for_pdumper): Register font driver globally.
(syms_of_haikufont): Call it in a pdumper hook.
---
src/font.c | 4 ++--
src/haikufont.c | 28 +++++++++++++++++++++++++++-
2 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/src/font.c b/src/font.c
index 702536c1ca..3846cfc107 100644
--- a/src/font.c
+++ b/src/font.c
@@ -3589,8 +3589,8 @@ font_open_by_name (struct frame *f, Lisp_Object name)
The second is with frame F NULL. In this case, DRIVER is globally
registered in the variable `font_driver_list'. All font-driver
- implementations must call this function in its syms_of_XXXX
- (e.g. syms_of_xfont). */
+ implementations must call this function in its
+ syms_of_XXXX_for_pdumper (e.g. syms_of_xfont_for_pdumper). */
void
register_font_driver (struct font_driver const *driver, struct frame *f)
diff --git a/src/haikufont.c b/src/haikufont.c
index 77aa400631..e9a25c0d58 100644
--- a/src/haikufont.c
+++ b/src/haikufont.c
@@ -1173,6 +1173,24 @@ haikufont_list_family (struct frame *f)
return list;
}
+/* List of boolean properties in font names accepted by this font
+ driver. */
+static const char *const haikufont_booleans[] =
+ {
+ ":antialias",
+ NULL,
+ };
+
+/* List of non-boolean properties. Currently empty. */
+static const char *const haikufont_non_booleans[1];
+
+static void
+haikufont_filter_properties (Lisp_Object font, Lisp_Object alist)
+{
+ font_filter_properties (font, alist, haikufont_booleans,
+ haikufont_non_booleans);
+}
+
struct font_driver const haikufont_driver =
{
.type = LISPSYM_INITIALLY (Qhaiku),
@@ -1187,7 +1205,8 @@ struct font_driver const haikufont_driver =
.encode_char = haikufont_encode_char,
.text_extents = haikufont_text_extents,
.shape = haikufont_shape,
- .list_family = haikufont_list_family
+ .list_family = haikufont_list_family,
+ .filter_properties = haikufont_filter_properties,
};
static bool
@@ -1270,6 +1289,12 @@ in the font selection dialog. */)
QCsize, lsize);
}
+static void
+syms_of_haikufont_for_pdumper (void)
+{
+ register_font_driver (&haikufont_driver, NULL);
+}
+
void
syms_of_haikufont (void)
{
@@ -1299,6 +1324,7 @@ syms_of_haikufont (void)
#ifdef USE_BE_CAIRO
Fput (Qhaiku, Qfont_driver_superseded_by, Qftcr);
#endif
+ pdumper_do_now_and_after_load (syms_of_haikufont_for_pdumper);
font_cache = list (Qnil);
staticpro (&font_cache);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master b5dd337ada: Fix initialization of Haiku font driver,
Po Lu <=