-2004-10-10 Kenichi Handa <handa@m17n.org>
+2004-10-11 Kenichi Handa <handa@m17n.org>
* m17n-core.pc.in, m17n-shell.pc.in, m17n-gui.pc.in: New files.
+2004-10-11 Kenichi Handa <handa@m17n.org>
+
+ * m17n-gui.h (mfont_list): Adjust prototype.
+
+ * m17n-X.c (xfont_list): New arg maxnum.
+
+ * font.h (struct MFontDriver): Change prototype of <list>.
+
+ * font-ft.c (fc_generic_family_list): Delete it.
+ (Mserif, Msans_serif, Mmonospace): Delete them.
+ (M_generic_family_info): New variable.
+ (enum GenericFamilyType): New enum.
+ (struct GenericFamilyInfo): New struct.
+ (generic_family_table): New variable.
+ (set_font_info): New arg style. Don't check 0xA0..0xBF to decide
+ iso8859-1.
+ (add_font_info): Get style here.
+ (ft_list_family): Don't initialize fc_config here. Don't list
+ generic families.
+ (ft_list_generic): New function.
+ (ft_select): Pay attention to generic familes here.
+ (ft_open): Fix calculation of ascent and descent.
+ (ft_list): Pay attention to generic families.
+ (mfont__ft_init): Initialize M_generic_family_info,
+ generic_family_table, and fc_config..
+ (mfont__ft_fini): Finalize generic_family_table.
+
+ * draw.c (compose_glyph_string): Use more constant font for
+ glyphs. Adjust for the member change in MGlyph.
+ (layout_glyph_string): Adjust for the member change in MGlyph.
+ (alloc_gstring): Intilize scracth_glyph to avoid
+ compose_glyph_string on it.
+ (get_gstring): Don't call compose_glyph_string on scracth_glyph.
+ (mdraw_coordinates_position): Fix previous change.
+
+ * internal-gui.h (glyph_category): New enum.
+ (MGlyph): Change type of <category> to enum glyph_category.
+
+ * face.c (mface__realize): Delete args langauge and charset.
+ (mface__for_chars): Fix for the case that glyphs have different
+ rfaces.
+ (mface__update_frame_face): Adjust for mface__realize change.
+
+ * face.h (mface__realize): Adjust prototype.
+
2004-10-05 Kenichi Handa <handa@m17n.org>
* language.c (mlang__init): Add Akan.
@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.
+ frame $FRAME. $FONT, if not @c Mnil, limits fonts to ones
+ matching with $FONT. $LANGUAGE, if not @c Mnil, limits fonts to
+ ones that support $LANGUAGE. $MAXNUM, if greater than 0, limits
+ the number of fonts.
@return
- This function returns a plist whose keys are family name and
+ This function returns a plist whose keys are family names 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)
+mfont_list (MFrame *frame, MFont *font, MSymbol language, int maxnum)
{
MPlist *plist = mplist (), *p;
+ int num = 0;
MPLIST_DO (p, frame->font_driver_list)
{
MFontDriver *driver = MPLIST_VAL (p);
- (driver->list) (frame, plist, font, language);
+ num += (driver->list) (frame, plist, font, language,
+ maxnum > 0 ? maxnum - num : 0);
+ if (maxnum > 0 && num >= maxnum)
+ break;
}
return plist;
}
MPlist *plist, *p;
if (family == Mnil)
- plist = mfont_list (frame, NULL, lang);
+ plist = mfont_list (frame, NULL, lang, 0);
else
{
MFont font;
MFONT_INIT (&font);
mfont__set_property (&font, MFONT_FAMILY, family);
- plist = mfont_list (frame, &font, lang);
+ plist = mfont_list (frame, &font, lang, 0);
}
MPLIST_DO (p, plist)
{