Back to index

tetex-bin  3.0
ffilest.h
Go to the documentation of this file.
00001 /*
00002  * $XConsortium: fontfilest.h,v 1.3 91/07/16 20:15:16 keith Exp $
00003  *
00004  * Copyright 1991 Massachusetts Institute of Technology
00005  *
00006  * Permission to use, copy, modify, distribute, and sell this software and its
00007  * documentation for any purpose is hereby granted without fee, provided that
00008  * the above copyright notice appear in all copies and that both that
00009  * copyright notice and this permission notice appear in supporting
00010  * documentation, and that the name of M.I.T. not be used in advertising or
00011  * publicity pertaining to distribution of the software without specific,
00012  * written prior permission.  M.I.T. makes no representations about the
00013  * suitability of this software for any purpose.  It is provided "as is"
00014  * without express or implied warranty.
00015  *
00016  * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
00017  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
00018  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00019  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
00020  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
00021  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00022  *
00023  * Author:  Keith Packard, MIT X Consortium
00024  */
00025 
00026 #ifndef _FONTFILEST_H_
00027 #define _FONTFILEST_H_
00028 
00029 #ifdef XSERVER
00030 #include    <X11/Xos.h>
00031 #else
00032 #include    "types.h"
00033 #include    "Xstuff.h"
00034 #endif
00035 
00036 #include    "fontmisc.h"
00037 #include    "fontstruct.h"
00038 #include    "fontfile.h"
00039 #include    "fontxlfd.h"
00040 
00041 typedef struct _FontName {
00042     char      *name;
00043     short     length;
00044     short     ndashes;
00045 } FontNameRec;
00046 
00047 typedef struct _FontScaled {
00048     FontScalableRec  vals;
00049     FontEntryPtr     bitmap;
00050     FontPtr          pFont;
00051 } FontScaledRec;
00052 
00053 typedef struct _FontScalableExtra {
00054     FontScalableRec  defaults;
00055     int                     numScaled;
00056     int                     sizeScaled;
00057     FontScaledPtr    scaled;
00058     pointer          private;
00059 } FontScalableExtraRec;
00060 
00061 typedef struct _FontScalableEntry {
00062     FontRendererPtr      renderer;
00063     char                 *fileName;
00064     FontScalableExtraPtr   extra;
00065 } FontScalableEntryRec;
00066 
00067 /*
00068  * This "can't" work yet - the returned alias string must be permanent,
00069  * but this layer would need to generate the appropriate name from the
00070  * resolved scalable + the XLFD values passed in.  XXX
00071  */
00072 
00073 typedef struct _FontScaleAliasEntry {
00074     char             *resolved;
00075 } FontScaleAliasEntryRec;
00076 
00077 typedef struct _FontBitmapEntry {
00078     FontRendererPtr  renderer;
00079     char             *fileName;
00080     FontPtr          pFont;
00081 } FontBitmapEntryRec;
00082 
00083 typedef struct _FontAliasEntry {
00084     char      *resolved;
00085 } FontAliasEntryRec;
00086 
00087 typedef struct _FontBCEntry {
00088     FontScalableRec      vals;
00089     FontEntryPtr         entry;
00090 } FontBCEntryRec;
00091 
00092 typedef struct _FontEntry {
00093     FontNameRec      name;
00094     int              type;
00095     union _FontEntryParts {
00096        FontScalableEntryRec scalable;
00097        FontBitmapEntryRec   bitmap;
00098        FontAliasEntryRec    alias;
00099        FontBCEntryRec              bc;
00100     } u;
00101 } FontEntryRec;
00102 
00103 typedef struct _FontTable {
00104     int                  used;
00105     int                  size;
00106     FontEntryPtr    entries;
00107     Bool          sorted;
00108 } FontTableRec;
00109 
00110 typedef struct _FontDirectory {
00111     char         *directory;
00112     ULONG          dir_mtime;
00113     ULONG          alias_mtime;
00114     FontTableRec   scalable;
00115     FontTableRec   nonScalable;
00116 } FontDirectoryRec;
00117 
00118 typedef struct _FontRenderer {
00119     char    *fileSuffix;
00120     int           fileSuffixLen;
00121     int           (*OpenBitmap)(/* fpe, pFont, flags, entry, fileName, format, fmask */);
00122     int           (*OpenScalable)(/* fpe, pFont, flags, entry, fileName, vals, format, fmask */);
00123     int           (*GetInfoBitmap)(/* fpe, pFontInfo, entry, fileName */);
00124     int           (*GetInfoScalable)(/* fpe, pFontInfo, entry, fileName, vals */);
00125     int           number;
00126 } FontRendererRec;
00127 
00128 typedef struct _FontRenders {
00129     int                  number;
00130     FontRendererPtr *renderers;
00131 } FontRenderersRec, *FontRenderersPtr;
00132 
00133 typedef struct _BitmapInstance {
00134     FontScalableRec  vals;
00135     FontBitmapEntryPtr      bitmap;
00136 } BitmapInstanceRec, *BitmapInstancePtr;
00137 
00138 typedef struct _BitmapScalablePrivate {
00139     int                     numInstances;
00140     BitmapInstancePtr       instances;
00141 } BitmapScalablePrivateRec, *BitmapScalablePrivatePtr;
00142 
00143 typedef struct _BitmapSources {
00144     FontPathElementPtr      *fpe;
00145     int                     size;
00146     int                     count;
00147 } BitmapSourcesRec, *BitmapSourcesPtr;
00148 
00149 extern BitmapSourcesRec     FontFileBitmapSources;
00150 
00151 #endif /* _FONTFILEST_H_ */