diff options
author | Po Lu <luangruo@yahoo.com> | 2022-05-01 00:59:55 +0000 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-05-01 01:00:15 +0000 |
commit | b2fdf78fd9ef46683775014716a2cbf98f11ad8c (patch) | |
tree | 7f728276bbdaa82bf6c17d9fd397c3a8f4ec0cbd /src/haiku_font_support.cc | |
parent | 02bf6650b073ffad702772a2ebae20023fa8276a (diff) | |
download | emacs-b2fdf78fd9ef46683775014716a2cbf98f11ad8c.tar.gz emacs-b2fdf78fd9ef46683775014716a2cbf98f11ad8c.tar.bz2 emacs-b2fdf78fd9ef46683775014716a2cbf98f11ad8c.zip |
Implement font selection dialog on Haiku
* src/haiku_font_support.cc (font_style_to_flags): Handle style
allocation failures.
(be_font_style_to_flags): New function.
* src/haiku_support.cc (struct font_selection_dialog_message):
New struct.
(class EmacsFontSelectionDialog): New class.
(be_select_font): New function.
* src/haiku_support.h: Update prototypes.
* src/haikufont.c (Fx_select_font): New function.
(syms_of_haikufont): Define new subr.
Diffstat (limited to 'src/haiku_font_support.cc')
-rw-r--r-- | src/haiku_font_support.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/haiku_font_support.cc b/src/haiku_font_support.cc index 9acdd652e34..95a0db8ae68 100644 --- a/src/haiku_font_support.cc +++ b/src/haiku_font_support.cc @@ -294,6 +294,9 @@ font_style_to_flags (char *st, struct haiku_font_pattern *pattern) char *token; int tok = 0; + if (!style) + return; + pattern->weight = NO_WEIGHT; pattern->width = NO_WIDTH; pattern->slant = NO_SLANT; @@ -804,3 +807,11 @@ be_evict_font_cache (void) font_object_cache[i] = NULL; } } + +void +be_font_style_to_flags (char *style, struct haiku_font_pattern *pattern) +{ + pattern->specified = 0; + + font_style_to_flags (style, pattern); +} |