*** empty log message ***
[m17n/m17n-lib.git] / src / font.h
index f7caef7..4d4318f 100644 (file)
@@ -17,7 +17,7 @@
 
    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_
@@ -104,9 +104,9 @@ struct MFont
       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;
   /* 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
@@ -159,6 +159,8 @@ struct MRealizedFont
      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.  */
@@ -167,6 +169,11 @@ struct MRealizedFont
   MRealizedFont *next;
 };
 
+typedef struct MFLTFontForRealized {
+  MFLTFont font;
+  MRealizedFont *rfont;
+} MFLTFontForRealized;
+
 typedef struct {
   MFont *font;
   int score;
@@ -227,6 +234,12 @@ struct MFontDriver
   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);
 };
 
 /** Initialize the members of FONT.  */
@@ -244,6 +257,7 @@ extern void mfont__flt_fini ();
 #ifdef HAVE_FREETYPE
 #include <ft2build.h>
 #include FT_FREETYPE_H
+#endif
 
 #ifdef HAVE_FONTCONFIG
 #include <fontconfig/fontconfig.h>
@@ -277,6 +291,7 @@ typedef struct
   } features[MFONT_OTT_MAX];
 } MFontCapability;
 
+#ifdef HAVE_FREETYPE
 extern MFontDriver mfont__ft_driver;
 
 extern int mfont__ft_init ();
@@ -313,6 +328,9 @@ extern int mfont__has_char (MFrame *frame, MFont *font, MFont *spec, int c);
 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,
@@ -322,6 +340,9 @@ extern MRealizedFont *mfont__open (MFrame *frame, MFont *font, MFont *spec);
 
 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);