{
return ((BFont *) font)->StringWidth (utf8);
}
+
+haiku_font_family_or_style *
+be_list_font_families (size_t *length)
+{
+ int32 families = count_font_families ();
+ haiku_font_family_or_style *array;
+ int32 idx;
+ uint32 flags;
+
+ array = (haiku_font_family_or_style *) malloc (sizeof *array * families);
+
+ if (!array)
+ return NULL;
+
+ for (idx = 0; idx < families; ++idx)
+ {
+ if (get_font_family (idx, &array[idx], &flags) != B_OK)
+ array[idx][0] = '\0';
+ }
+
+ *length = families;
+
+ return array;
+}
extern void
EmacsWindow_signal_menu_update_complete (void *window);
+ extern haiku_font_family_or_style *
+ be_list_font_families (size_t *length);
+
#ifdef __cplusplus
extern void *
find_appropriate_view_for_draw (void *vw);
#include "fontset.h"
#include "haikuterm.h"
#include "character.h"
+#include "coding.h"
#include "font.h"
#include "termchar.h"
#include "pdumper.h"
return 1;
}
+static Lisp_Object
+haikufont_list_family (struct frame *f)
+{
+ Lisp_Object list = Qnil;
+ size_t length;
+ ptrdiff_t idx;
+ haiku_font_family_or_style *styles;
+
+ block_input ();
+ styles = be_list_font_families (&length);
+ unblock_input ();
+
+ if (!styles)
+ return list;
+
+ block_input ();
+ for (idx = 0; idx < length; ++idx)
+ {
+ if (styles[idx][0])
+ list = Fcons (build_string_from_utf8 ((char *) &styles[idx]),
+ list);
+ }
+
+ free (styles);
+ unblock_input ();
+
+ return list;
+}
+
struct font_driver const haikufont_driver =
{
.type = LISPSYM_INITIALLY (Qhaiku),
.prepare_face = haikufont_prepare_face,
.encode_char = haikufont_encode_char,
.text_extents = haikufont_text_extents,
- .shape = haikufont_shape
+ .shape = haikufont_shape,
+ .list_family = haikufont_list_family
};
void