2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: FaLib.h /main/5 1996/06/25 20:08:31 cde-fuj $ */
25 * (c) Copyright 1995 FUJITSU LIMITED
26 * This is source code modified by FUJITSU LIMITED under the Joint
27 * Development Agreement for the CDEnext PST.
28 * This is unpublished proprietary source code of FUJITSU LIMITED
40 extern int fal_utyerror; /* library error information */
41 extern int fal_utyderror; /* library error information */
42 extern int fal_utyexists; /* existence's flag of font pattern */
44 extern unsigned long fal_utyerrno ; /* library error information */
45 extern char fal_err_file[] ;
49 * structure of the font information
54 * the equipment of output permission
56 #define FAL_FONT_DISPLAY 1
57 #define FAL_FONT_PRINTER 2
60 #define FAL_FONT_GLYPH_INDEX -1
64 #define FAL_FONT_CS0 1
65 #define FAL_FONT_CS1 2
66 #define FAL_FONT_CS2 3
67 #define FAL_FONT_CS3 4
69 #define FAL_FONT_CS4 5
70 #define FAL_FONT_CS5 6
71 #define FAL_FONT_CS6 7
72 #define FAL_FONT_CS7 8
73 #define FAL_FONT_CS8 9
78 #define FAL_FONT_MASK_XLFDNAME (1L<<1)
79 #define FAL_FONT_MASK_SIZE_W (1L<<2)
80 #define FAL_FONT_MASK_SIZE_H (1L<<3)
81 #define FAL_FONT_MASK_LETTER_W (1L<<4)
82 #define FAL_FONT_MASK_LETTER_H (1L<<5)
83 #define FAL_FONT_MASK_LETTER_X (1L<<6)
84 #define FAL_FONT_MASK_LETTER_Y (1L<<7)
85 #define FAL_FONT_MASK_STYLE_DEF (1L<<8)
86 #define FAL_FONT_MASK_STYLE_NAME (1L<<9)
87 #define FAL_FONT_MASK_SHAPE_DEF (1L<<10)
88 #define FAL_FONT_MASK_SHAPE_NAME (1L<<11)
91 #define FAL_FONT_MASK_CODE_SET (1L<<14)
92 #define FAL_FONT_MASK_PERMISSION (1L<<15)
93 #define FAL_FONT_MASK_DEL_EQUALDATA (1L<<16)
94 #define FAL_FONT_MASK_CHECK_ALL 0x1FFFF
96 #define FAL_FONT_MASK_GLYPH_INDEX (1L<<17)
97 #define FAL_FONT_MASK_UPDATE (1L<<18)
98 #define FAL_FONT_MASK_DEFINED (1L<<19)
99 #define FAL_FONT_MASK_UNDEFINED (1L<<20)
103 * undefined the character style,shape
105 #define FAL_FONT_UNKNOWN 0
108 * definition's data of character style
110 #define FAL_FONT_MINCHO 1
111 #define FAL_FONT_STR_MINCHO "mincho"
112 #define FAL_FONT_GOTHIC 2
113 #define FAL_FONT_STR_GOTHIC "gothic"
114 #define FAL_FONT_MARU_GOTHIC 3
115 #define FAL_FONT_STR_MARU_GOTHIC "maru_gothic"
116 #define FAL_FONT_TEXTBOOK 4
117 #define FAL_FONT_STR_TEXTBOOK "textbook"
118 #define FAL_FONT_BRASH_GYOU 5
119 #define FAL_FONT_STR_BRASH_GYOU "brash_gyou"
120 #define FAL_FONT_BRASH_KAI 6
121 #define FAL_FONT_STR_BRASH_KAI "brash_kai"
122 #define FAL_FONT_HANDWRITING 7
123 #define FAL_FONT_STR_HANDWRITING "handwriting"
126 * definition's data of character shape
128 #define FAL_FONT_ZENKAKU 1
129 #define FAL_FONT_STR_ZENKAKU "zenkaku"
130 #define FAL_FONT_HANKAKU 2
131 #define FAL_FONT_STR_HANKAKU "hankaku"
132 #define FAL_FONT_QUARTER 3
133 #define FAL_FONT_STR_QUARTER "1/4kaku"
136 * structures for font informations
139 int width; /* width */
140 int height; /* height */
141 int top; /* the head code */
142 int bottom; /* the final code */
151 int def; /* definition data */
152 char *name; /* the information of the character line */
157 * structure of the font information
160 char *xlfdname; /* xlfd name */
162 int w; /* the width of the character size */
163 int h; /* the height of the character size */
166 int w; /* the width of the letter size */
167 int h; /* the height of the letter size */
168 int x; /* position x of the letter size */
169 int y; /* position y of the letter size */
171 FalFontDB style; /* character style */
172 FalFontDB shape; /* character shape */
173 FalFontDB reserve ; /* reserve */
174 int cd_set; /* codeset */
175 int prm; /* the equipment of output permission */
179 int num; /* the number of font data*/
180 FalFontData *list; /* the pointer to the array of
181 FalFontData structure */
187 typedef struct _FalCodeRegion {
188 int start ; /* first code */
189 int end ; /* last code */
192 typedef struct _FalGlyphRegion {
193 int start ; /* first glyph index */
194 int end ; /* last glyph index */
197 typedef struct _FalGIInf {
198 char *charset_str; /* charcter set */
199 int glyph_index; /* glyph index */
203 * structure of the font identifier
208 #include <X11/Xproto.h>
216 #include "snfstruct.h"
217 #include "fontstruct.h"
222 xCharInfo org_bounds;
225 CARD32 bmp_fmt; /* bitOrder ,byteOrder, glyph, scan */
231 CARD16 *encodingOffsets;
234 typedef struct _Oak_Finf {
235 int ismmap; /* used mmap()? */
236 int fsize; /* file size */
237 int fd; /* file descripter */
239 char *buf; /* font file allocated on memory */
240 char *fname; /* name of font file */
243 struct pcf_inf pcfinf;
247 unsigned char *pGlyphs;
260 typedef Oak_FontInf * FalFontID; /* font distinction */
263 * function prototypes
265 extern FalFontID FalOpenSysFont(
266 #if NeedFunctionPrototypes
267 FalFontData* /* open_font_data */,
268 int /* font_data_mask */,
269 FalFontDataList** /* missing_font_list_return */
273 extern int FalGetFontList(
274 #if NeedFunctionPrototypes
275 FalFontData* /* key_data */,
277 FalFontDataList** /* list_ret */
281 extern int FalFreeFontList(
282 #if NeedFunctionPrototypes
283 FalFontDataList* /* list */
289 #if NeedFunctionPrototypes
290 FalFontID /* fid */ ,
297 extern int FalQueryFont(
298 #if NeedFunctionPrototypes
299 FalFontID /* fid */ ,
300 FalFontinfo* /* fontinfo */
304 extern int FalFontOfFontID(
305 #if NeedFunctionPrototypes
307 FalFontData* /* fontdata */
311 extern int FalCloseFont(
312 #if NeedFunctionPrototypes
317 extern int FalFontIDToFileName(
318 #if NeedFunctionPrototypes
319 FalFontID /* fid */ ,
320 char** /* file_name */
325 #if NeedFunctionPrototypes
330 extern int FalGetUDCCPArea(
331 #if NeedFunctionPrototypes
334 char* /* charset_str */ ,
335 FalCodeRegion** /* cr */ ,
340 extern int FalGetUDCGIArea(
341 #if NeedFunctionPrototypes
344 char* /* charset_str */ ,
345 FalGlyphRegion** /* gr */ ,
350 extern FalFontID FalOpenFont() ;
355 #define FALGETFALCODESET( cd_set ) ( ((cd_set)==-1) ? FAL_FONT_GLYPH_INDEX : (cd_set)+1 )
357 #define FALCODESETTONUM( cd_set ) ( ((cd_set)==FAL_FONT_GLYPH_INDEX) ? -1 : (cd_set)-1 )
362 #define FAL_FUNCNUM_GFLST 0x0
363 #define FAL_FUNCNUM_SRCHFNM 0x0
364 #define FAL_FUNCNUM_OPNFNT 0x0
365 #define FAL_FUNCNUM_FRFLST 0x0
366 #define FAL_FUNCNUM_RDFNT 0x0
367 #define FAL_FUNCNUM_QRY 0x0
368 #define FAL_FUNCNUM_FID 0x0
369 #define FAL_FUNCNUM_IDTOFNM 0x0
370 #define FAL_FUNCNUM_CLSFNT 0x0
371 #define FAL_FUNCNUM_CPA 0x0
372 #define FAL_FUNCNUM_GIA 0x0
373 #define FAL_FUNCNUM_FREE 0x0
375 #define FAL_ERR_NON 0x00
377 #define FAL_ERR_FNT_OPN 0x01
378 #define FAL_ERR_FNT_RD 0x02
379 #define FAL_ERR_MALLOC 0x03
380 #define FAL_ERR_PARM 0x04
381 #define FAL_ERR_STAT 0x05
382 #define FAL_ERR_FONT 0x06
383 #define FAL_ERR_FDATA_OPN 0x07
384 #define FAL_ERR_FDATA_RD 0x08
385 #define FAL_ERR_FDATA_DSC 0x09
386 #define FAL_ERR_FPATH 0x0a
388 #define FAL_ERR_FNTDIR_OPN 0x0b
389 #define FAL_ERR_FNTDIR_RD 0x0c
390 #define FAL_ERR_PROP_RD 0x0d
391 #define FAL_ERR_PROP_FONT 0x0e
392 #define FAL_ERR_PROP_FNAME 0x0f
393 #define FAL_ERR_LCKD 0x10
394 #define FAL_ERR_FILELCK 0x11
395 #define FAL_ERR_FILEUNLCK 0x12
396 #define FAL_ERR_FILEGETLCK 0x13
397 #define FAL_ERR_NOFONT 0x14
399 #define FAL_ERR_XLC_CRTDB 0x15
400 #define FAL_ERR_XLC_GETCHARST 0x16
401 #define FAL_ERR_XLC_NOCHARST 0x17
403 #define FAL_ERR_FID_RD 0x18
404 #define FAL_ERR_FATAL 0x19
410 #endif /* _FALIB_H */