]> code.delx.au - gnu-emacs/blobdiff - src/fontset.h
(Fcoordinates_in_window_p): Convert Fcons arguments to Lisp_Integer.
[gnu-emacs] / src / fontset.h
index 902f1691d6fcc65f3613bac9c9148e2fe5619707..2df41aa0b721852c0933e5e7d880ce43985e18b5 100644 (file)
@@ -1,22 +1,23 @@
 /* Header for fontset handler.
-   Ver.1.0
+   Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN.
+   Licensed to the Free Software Foundation.
 
-   Copyright (C) 1995 Free Software Foundation, Inc.
-   Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
+This file is part of GNU Emacs.
 
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
 
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 #ifndef _FONTSET_H
 #define _FONTSET_H
@@ -69,7 +70,7 @@ struct font_info
      whose default value is defined in lisp/fontset.el.  Since there's
      no charset whose id is 1, we use encoding[1] to store the
      encoding information decided by the font itself.  */
-  char encoding[MAX_CHARSET];
+  unsigned char encoding[MAX_CHARSET + 1];
 
   /* The baseline position of a font is normally `ascent' value of the
      font.  However, there exists many fonts which don't set `ascent'
@@ -112,14 +113,23 @@ struct font_info
        height).  In this case, the character is drawn beneath the
        previous glyphs.
 
-     This value is take from a private font property
+     This value is taken from a private font property
      `_MULE_RELATIVE_COMPOSE' which is introduced by Emacs.  */
   int relative_compose;
 
+  /* Non zero means an ascent value to be used for a character
+     registered in char-table `use-default-ascent'.  */
+  int default_ascent;
+
   /* CCL program to calculate code points of the font.  */
   struct ccl_program *font_encoder;
 };
 
+/* A value which may appear in the member encoding of struch font_info
+   indicating that a font itself doesn't tell which encoding to be
+   used.  */
+#define FONT_ENCODING_NOT_DECIDED 4
+
 #define FONT_NOT_OPENED -1
 #define FONT_NOT_FOUND  -2
 
@@ -136,12 +146,12 @@ struct fontset_info
   int height;
 
   /* Table of font name for each character set.  */
-  char *fontname[MAX_CHARSET];
+  char *fontname[MAX_CHARSET + 1];
 
   /* Table of index numbers of fonts indexed by charset.  If a font is
      not yet loaded, the value is -1 (FONT_NOT_OPENED).  If font
      loading is failed, the value is -2 (FONT_NOT_FOUND).  */
-  int font_indexes[MAX_CHARSET];
+  int font_indexes[MAX_CHARSET + 1];
 };
 
 /* This data type is used for the fontset_data field of struct frame.  */
@@ -197,5 +207,27 @@ extern Lisp_Object list_fontsets ();
 extern Lisp_Object Vglobal_fontset_alist;
 
 extern Lisp_Object Qfontset;
+extern Lisp_Object Vuse_default_ascent; 
+extern Lisp_Object Valternative_fontname_alist;
+extern Lisp_Object Vhighlight_wrong_size_font;
+extern Lisp_Object Vclip_large_size_font;
+
+extern int font_idx_temp;
+
+/* Load a font named FONTNAME for displaying CHARSET on frame F.
+   All fonts for frame F is stored in a table pointed by FONT_TABLE.
+   Return a pointer to the struct font_info of the loaded font.
+   If loading fails, return 0;
+   If FONTNAME is NULL, the name is taken from the information of FONTSET.
+   If FONTSET is given, try to load a font whose size matches that of
+   FONTSET, and, the font index is stored in the table for FONTSET.  */
+
+#define FS_LOAD_FONT(f, font_table, charset, fontname, fontset)                  \
+  (fontset >= 0 && fontset < FRAME_FONTSET_DATA (f)->n_fontsets                  \
+   && (font_idx_temp = (FRAME_FONTSET_DATA (f)                           \
+                       ->fontset_table[fontset]->font_indexes[charset]), \
+       font_idx_temp >= 0)                                               \
+   ? font_table + font_idx_temp                                                  \
+   : fs_load_font (f, font_table, charset, fontname, fontset))
 
 #endif /* _FONTSET_H */