1 /* $XConsortium: spfuncs.c,v 1.13 94/06/06 17:42:26 gildea Exp $ */
3 * Copyright 1990, 1991 Network Computing Devices;
4 * Portions Copyright 1987 by Digital Equipment Corporation
6 * Permission to use, copy, modify, distribute, and sell this software and
7 * its documentation for any purpose is hereby granted without fee, provided
8 * that the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the names of Network Computing Devices or Digital
11 * not be used in advertising or publicity pertaining to distribution of
12 * the software without specific, written prior permission.
14 * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH
15 * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16 * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES OR DIGITAL BE
17 * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
19 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 * Author: Dave Lemke, Network Computing Devices, Inc
27 Copyright (c) 1987 X Consortium
29 Permission is hereby granted, free of charge, to any person obtaining
30 a copy of this software and associated documentation files (the
31 "Software"), to deal in the Software without restriction, including
32 without limitation the rights to use, copy, modify, merge, publish,
33 distribute, sublicense, and/or sell copies of the Software, and to
34 permit persons to whom the Software is furnished to do so, subject to
35 the following conditions:
37 The above copyright notice and this permission notice shall be included
38 in all copies or substantial portions of the Software.
40 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
41 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
42 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
43 IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
44 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
45 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
46 OTHER DEALINGS IN THE SOFTWARE.
48 Except as contained in this notice, the name of the X Consortium shall
49 not be used in advertising or otherwise to promote the sale, use or
50 other dealings in this Software without prior written authorization
51 from the X Consortium.
60 SpeedoOpenScalable (fpe, pFont, flags, entry, fileName, vals, format, fmask,
62 FontPathElementPtr fpe;
68 fsBitmapFormat format;
69 fsBitmapFormatMask fmask;
70 FontPtr non_cachable_font; /* We don't do licensing */
72 char fullName[MAXFONTNAMELEN];
74 strcpy (fullName, entry->name.name);
75 return SpeedoFontLoad (pFont, fullName, fileName, entry, vals,
76 format, fmask, flags);
82 * this does a lot more then i'd like, but it has to get the bitmaps
83 * in order to get accurate metrics (which it *must* have).
85 * a possible optimization is to avoid allocating the glyph memory
86 * and to simply save the values without doing the work.
89 get_font_info(pinfo, fontname, filename, entry, vals, spfont)
95 SpeedoFontPtr *spfont;
101 err = sp_open_font(fontname, filename, entry, vals,
102 (fsBitmapFormat) 0, (fsBitmapFormatMask) 0, (unsigned long) 0,
105 if (err != Successful)
109 sp_reset_master(spf->master);
111 sp_make_header(spf, pinfo);
113 sp_compute_bounds(spf, pinfo, (unsigned long) 0, &sWidth);
115 sp_compute_props(spf, fontname, pinfo, sWidth);
117 /* compute remaining accelerators */
118 FontComputeInfoAccelerators (pinfo);
126 SpeedoGetInfoScaleable(fpe, pFontInfo, entry, fontName, fileName, vals)
127 FontPathElementPtr fpe;
128 FontInfoPtr pFontInfo;
130 FontNamePtr fontName;
132 FontScalablePtr vals;
134 SpeedoFontPtr spf = NULL;
135 char fullName[MAXFONTNAMELEN];
138 strcpy(fullName, entry->name.name);
139 FontParseXLFDName(fullName, vals, FONT_XLFD_REPLACE_VALUE);
141 err = get_font_info(pFontInfo, fullName, fileName, entry, vals, &spf);
149 static FontRendererRec renderer = {
150 ".spd", 4, (int (*)()) 0, SpeedoOpenScalable,
151 (int (*)()) 0, SpeedoGetInfoScaleable, 0
152 , CAP_MATRIX | CAP_CHARSUBSETTING
155 SpeedoRegisterFontFileFunctions()
157 sp_make_standard_props();
159 FontFileRegisterRenderer(&renderer);