2 * Copyright 1999 SuSE, Inc.
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of SuSE not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. SuSE makes no representations about the
11 * suitability of this software for any purpose. It is provided "as is"
12 * without express or implied warranty.
14 * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
16 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
18 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
19 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 * Author: Keith Packard, SuSE, Inc.
27 #include <X11/fonts/fntfilst.h>
28 #include <X11/fonts/fontutil.h>
29 #include <X11/fonts/pcf.h>
33 BuiltinOpenBitmap (FontPathElementPtr fpe, FontPtr *ppFont, int flags,
34 FontEntryPtr entry, char *fileName, fsBitmapFormat format,
35 fsBitmapFormatMask fmask, FontPtr unused)
46 file = BuiltinFileOpen (fileName);
49 pFont = malloc(sizeof(FontRec));
51 BuiltinFileClose (file, 0);
54 /* set up default values */
55 FontDefaultFormat(&bit, &byte, &glyph, &scan);
56 /* get any changes made from above */
57 ret = CheckFSFormat(format, fmask, &bit, &byte, &scan, &glyph, &image);
59 /* Fill in font record. Data format filled in by reader. */
61 pFont->maxPrivate = -1;
62 pFont->devPrivates = (pointer *) 0;
64 ret = pcfReadFont (pFont, file, bit, byte, glyph, scan);
66 BuiltinFileClose (file, 0);
67 if (ret != Successful)
75 BuiltinGetInfoBitmap (FontPathElementPtr fpe, FontInfoPtr pFontInfo,
76 FontEntryPtr entry, char *fileName)
81 file = BuiltinFileOpen (fileName);
84 ret = pcfReadFontInfo (pFontInfo, file);
85 BuiltinFileClose (file, 0);
90 BuiltinOpenScalable (FontPathElementPtr fpe,
96 fsBitmapFormat format,
97 fsBitmapFormatMask fmask,
98 FontPtr non_cachable_font) /* We don't do licensing */
104 BuiltinGetInfoScalable (FontPathElementPtr fpe,
105 FontInfoPtr pFontInfo,
107 FontNamePtr fontName,
109 FontScalablePtr vals)
114 static FontRendererRec renderers[] = {
118 BuiltinGetInfoBitmap,
119 BuiltinGetInfoScalable,
123 #define numRenderers (sizeof renderers / sizeof renderers[0])
126 BuiltinRegisterFontFileFunctions(void)
129 for (i = 0; i < numRenderers; i++)
130 FontFileRegisterRenderer ((FontRendererRec *) &renderers[i]);