/* font.h -- header file for the font module.
- Copyright (C) 2003, 2004
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H15PRO112
You should have received a copy of the GNU Lesser General Public
License along with the m17n library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
02111-1307, USA. */
#ifndef _M17N_FONT_H_
For the time being, we mention only Y-resolution (resy) and
assume that resx is always equal to resy. */
unsigned short property[MFONT_PROPERTY_MAX];
- enum MFontType type : 2;
- enum MFontSource source : 2;
- enum MFontSpacing spacing : 2;
+ unsigned type : 2;
+ unsigned source : 2;
+ unsigned spacing : 2;
unsigned for_full_width : 1;
- /* Pixel size of the font in 1/10 pixels. The negative value means
- a point size in 1/10 pt. */
- int size : 25;
+ /* For FONT-OBJ, 1 means `size' is a logical or of bit masks for
+ available pixel sizes (Nth bit corresponds to (6 + N) pixels), 0
+ means `size' is an actual pixel size * 10. For FONT-SPEC and
+ FONT-OPENED, this is always 0, and `size' is an actual pixel
+ size * 10. */
+ unsigned multiple_sizes : 1;
+ unsigned size : 24;
MSymbol file;
MSymbol capability;
MFontEncoding *encoding;
so that this object can be distingushed from MFont. */
MFont spec;
+ /* Font identifier. */
+ MSymbol id;
+
/* Frame on which the font is realized. */
MFrame *frame;
non-NULL, it must be a pointer to a managed object. */
void *info;
+ int x_ppem, y_ppem;
+
int ascent, descent, max_advance, average_width, baseline_offset;
/* Pointer to the font structure. */
MRealizedFont *next;
};
+typedef struct MFLTFontForRealized {
+ MFLTFont font;
+ MRealizedFont *rfont;
+} MFLTFontForRealized;
+
typedef struct {
MFont *font;
int score;
MRealizedFont *(*encapsulate) (MFrame *frame, MSymbol source, void *data);
void (*close) (MRealizedFont *rfont);
+
+ int (*check_otf) (MFLTFont *font, MFLTOtfSpec *spec);
+
+ int (*drive_otf) (MFLTFont *font, MFLTOtfSpec *spec,
+ MFLTGlyphString *in, int from, int to,
+ MFLTGlyphString *out, MFLTGlyphAdjustment *adjustment);
+
+ int (*try_otf) (MFLTFont *font, MFLTOtfSpec *spec,
+ MFLTGlyphString *in, int from, int to);
+
+ int (*iterate_otf_feature) (struct _MFLTFont *font, MFLTOtfSpec *spec,
+ int from, int to, unsigned char *table);
};
/** Initialize the members of FONT. */
#ifdef HAVE_FREETYPE
#include <ft2build.h>
#include FT_FREETYPE_H
+#endif
#ifdef HAVE_FONTCONFIG
#include <fontconfig/fontconfig.h>
} features[MFONT_OTT_MAX];
} MFontCapability;
+#ifdef HAVE_FREETYPE
extern MFontDriver mfont__ft_driver;
extern int mfont__ft_init ();
extern unsigned mfont__encode_char (MFrame *frame, MFont *font, MFont *spec,
int c);
+extern int mfont__get_glyph_id (MFLTFont *font, MFLTGlyphString *gstring,
+ int from, int to);
+
extern MFont *mfont__select (MFrame *frame, MFont *font, int max_size);
extern MFontList *mfont__list (MFrame *frame, MFont *spec, MFont *request,
extern void mfont__get_metric (MGlyphString *gstring, int from, int to);
+extern int mfont__get_metrics (MFLTFont *font, MFLTGlyphString *gstring,
+ int from, int to);
+
extern void mfont__set_property (MFont *font, enum MFontProperty key,
MSymbol val);