X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Ffont.h;h=54c75d1827bcf5205e256b0b3f0ca2f8b27727a9;hb=3dbe5210009c5328999362178544d143a8f7b992;hp=06b54b8a09c12ae6243aaa444bae1b478e04e965;hpb=4296bd3d5a6311b5c6074c30c13ba57a1375f27e;p=m17n%2Fm17n-lib.git diff --git a/src/font.h b/src/font.h index 06b54b8..54c75d1 100644 --- a/src/font.h +++ b/src/font.h @@ -144,6 +144,12 @@ struct MRealizedFont short ascent, descent; MFontEncoding *encoding; + + /* Type of the font: Mx, Mfreetype, or Mxft. */ + MSymbol type; + + /* Pointer to the font structure. */ + void *fontp; }; /** Structure to hold a list of fonts of each registry. */ @@ -180,6 +186,13 @@ struct MFontDriver void (*render) (MDrawWindow win, int x, int y, MGlyphString *gstring, MGlyph *from, MGlyph *to, int reverse, MDrawRegion region); + + /** Push to PLIST fonts matching with FONT. LANGUAGE, if not Mnil, + limits fonts to ones that support LANGUAGE. MAXNUM if greater + than 0 limits the number of listed fonts. Return how many fonts + a listed. */ + int (*list) (MFrame *frame, MPlist *plist, MFont *font, MSymbol language, + int maxnum); }; /** Initialize the members of FONT. */ @@ -196,6 +209,10 @@ extern void mfont__flt_fini (); #include #include FT_FREETYPE_H +#ifdef HAVE_FONTCONFIG +#include +#endif + #ifdef HAVE_OTF #include #endif /* HAVE_OTF */ @@ -209,9 +226,15 @@ typedef struct MPlist *charmap_list; int charmap_index; FT_Face ft_face; + char *languages; #ifdef HAVE_OTF OTF *otf; #endif /* HAVE_OTF */ +#ifdef HAVE_FONTCONFIG + FcLangSet *langset; +#else + void *langset; +#endif void *extra_info; /* Xft uses this member. */ } MFTInfo; @@ -225,12 +248,16 @@ extern int mfont__ft_parse_name (char *name, MFont *font); extern char *mfont__ft_unparse_name (MFont *font); +#ifdef HAVE_OTF + extern int mfont__ft_drive_otf (MGlyphString *gstring, int from, int to, - MRealizedFont *rfont, MSymbol script, MSymbol langsys, MSymbol gsub_features, MSymbol gpos_features); + extern int mfont__ft_decode_otf (MGlyph *g); +#endif /* HAVE_OTF */ + #endif /* HAVE_FREETYPE */ extern void mfont__free_realized (MRealizedFont *rfont); @@ -269,6 +296,8 @@ extern void mfont__set_spec (MFont *font, extern int mfont__parse_name_into_font (char *name, MSymbol format, MFont *font); +extern MPlist *mfont__encoding_list (void); + extern unsigned mfont__flt_encode_char (MSymbol layouter_name, int c); extern int mfont__flt_run (MGlyphString *gstring, int from, int to,