From e34e2328cc4f0b8958aa328488eb95d1df8aa0c6 Mon Sep 17 00:00:00 2001 From: handa Date: Tue, 28 Sep 2004 11:10:40 +0000 Subject: [PATCH] (mfont_list): New function. --- src/font.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/font.c b/src/font.c index 45d3c3e..0d31550 100644 --- a/src/font.c +++ b/src/font.c @@ -2085,6 +2085,34 @@ mfont_resize_ratio (MFont *font) return (font->property[MFONT_SIZE] * 100 / request.property[MFONT_SIZE]); } +/*=*/ + +/***en + @brief Get a list fonts. + + The mfont_list () functions returns a list of fonts available on + frame $FRAME. If $FONT is not nil, it limits fonts to ones that + matchq with $FONT. If $LANGUAGE is not @c Mnil, it limits fonts + to ones that support $LANGUAGE. + + @return + This function returns a plist whose keys are family name and + values are pointers to the object MFont. The plist must be freed + by m17n_object_unref (). */ + +MPlist * +mfont_list (MFrame *frame, MFont *font, MSymbol language) +{ + MPlist *plist = mplist (), *p; + + MPLIST_DO (p, frame->font_driver_list) + { + MFontDriver *driver = MPLIST_VAL (p); + + (driver->list) (frame, plist, font, language); + } + return plist; +} /*** @} */ -- 1.7.10.4