~ubuntu-branches/ubuntu/precise/libxfont/precise-updates

« back to all changes in this revision

Viewing changes to src/builtins/render.c

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2007-07-18 16:46:59 UTC
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: james.westby@ubuntu.com-20070718164659-hbs3149rix062etp
Tags: upstream-1.3.0
ImportĀ upstreamĀ versionĀ 1.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include <config.h>
30
30
#endif
31
31
#include    <X11/fonts/fntfilst.h>
 
32
#include    <X11/fonts/fontutil.h>
 
33
#include    <X11/fonts/pcf.h>
32
34
#include    "builtin.h"
33
35
 
34
 
BuiltinOpenBitmap (fpe, ppFont, flags, entry, fileName, format, fmask)
35
 
    FontPathElementPtr  fpe;
36
 
    FontPtr             *ppFont;
37
 
    int                 flags;
38
 
    FontEntryPtr        entry;
39
 
    char                *fileName;
40
 
    fsBitmapFormat      format;
41
 
    fsBitmapFormatMask  fmask;
 
36
static int
 
37
BuiltinOpenBitmap (FontPathElementPtr fpe, FontPtr *ppFont, int flags,
 
38
                   FontEntryPtr entry, char *fileName, fsBitmapFormat format,
 
39
                   fsBitmapFormatMask fmask, FontPtr unused)
42
40
{
43
41
    FontFilePtr file;
44
42
    FontPtr     pFont;
45
 
    int         i;
46
43
    int         ret;
47
44
    int         bit,
48
45
                byte,
55
52
        return BadFontName;
56
53
    pFont = (FontPtr) xalloc(sizeof(FontRec));
57
54
    if (!pFont) {
58
 
        BuiltinFileClose (file);
 
55
        BuiltinFileClose (file, 0);
59
56
        return AllocError;
60
57
    }
61
58
    /* set up default values */
70
67
 
71
68
    ret = pcfReadFont (pFont, file, bit, byte, glyph, scan);
72
69
 
73
 
    BuiltinFileClose (file);
 
70
    BuiltinFileClose (file, 0);
74
71
    if (ret != Successful)
75
72
        xfree(pFont);
76
73
    else
78
75
    return ret;
79
76
}
80
77
 
81
 
BuiltinGetInfoBitmap (fpe, pFontInfo, entry, fileName)
82
 
    FontPathElementPtr  fpe;
83
 
    FontInfoPtr         pFontInfo;
84
 
    FontEntryPtr        entry;
85
 
    char                *fileName;
 
78
static int
 
79
BuiltinGetInfoBitmap (FontPathElementPtr fpe, FontInfoPtr pFontInfo,
 
80
                      FontEntryPtr entry, char *fileName)
86
81
{
87
82
    FontFilePtr file;
88
 
    int         i;
89
83
    int         ret;
90
 
    FontRendererPtr renderer;
91
84
 
92
85
    file = BuiltinFileOpen (fileName);
93
86
    if (!file)
94
87
        return BadFontName;
95
88
    ret = pcfReadFontInfo (pFontInfo, file);
96
 
    BuiltinFileClose (file);
 
89
    BuiltinFileClose (file, 0);
97
90
    return ret;
98
91
}
99
92
 
123
116
}
124
117
 
125
118
static FontRendererRec renderers[] = {
126
 
    ".builtin", 8,
 
119
    { ".builtin", 8,
127
120
    BuiltinOpenBitmap,
128
121
    BuiltinOpenScalable,
129
122
    BuiltinGetInfoBitmap,
130
123
    BuiltinGetInfoScalable,
131
 
    0
 
124
    0 }
132
125
};
133
126
 
134
127
#define numRenderers    (sizeof renderers / sizeof renderers[0])