For other information, see the Ghostscript overview.
As of Ghostscript 9.04, the Xfont functionality has been removed
As of Ghostscript 9.01 Xfont functionality is considered deprecated, and unsupported. Its complete removal is planned for a near future release.
If your application relies on this feature you should either plan for its removal, or contact the Ghostscript developers so our Xfont plans can be revisited.
Ghostscript can use the character rasterizer provided by the underlying operating system and window system; specifically, Adobe Type Manager (ATM) or a TrueType rasterizer under MS Windows, or the facilities provided by X Windows. This ability augments, but does not replace, Ghostscript's own Type 1 rasterizer: Ghostscript may still use its own rasterizer for very large characters, characters that are clipped or transformed in unusual ways, and for output to devices other than the screen.
Ghostscript connects to these platform facilities through a driver-like interface called the xfont (external font) interface. Current xfont implementations are associated directly with device drivers; in a future release, Ghostscript may separate them, so that (for example) it will be possible to use the platform rasterizer when writing to a file.
Please note that from this point, this file is likely to be useful only to a small number of Ghostscript porters and implementors.
|A character code that appears in a string. Currently it is always a single byte, but composite fonts or Unicode may require it to be wider in the future.|
|A character name like "period" or "epsilon". From
the xfont implementation's point of view, it is just a handle;
when necessary, Ghostscript provides a
|A procedure that maps a |
|A character or glyph code that can be used with a
specific platform font. Normally it will be a character code
that the implementation of |
|The xfont analogue of
|The gxfont analogue of |
|(||Not really a type, although it probably should be:
All the procedures that return
int results return 0 on
success, or an appropriate negative error code for error conditions; these
error codes are defined in
gserrors.h. The relevant ones
are the same as for drivers, and as with drivers,
if an implementation procedure returns an error, it should use the
return_error macro -- defined in
which is automatically included by
gdevprn.h but not by
gserrors.h -- rather than a simple
statement, for instance
gx_xfont *(*lookup_font)(P7(gx_device *dev, const byte *fname, uint len, int encoding_index, const gs_uid *puid, const gs_matrix *pmat, const gs_memory_procs *mprocs))
UniqueID, and matrix, and return an xfont, or
NULLif no suitable xfont exists. Use
mprocsto allocate the xfont and any subsidiary data structures. The matrix is the
FontMatrixconcatenated with the CTM, so (roughly speaking) the font size in pixels is
pmat -> yy× 1000 for a normal Type 1 font.
Note that this is the only implementation procedure that does not take an
xfont * as its first argument. In fact, callers of
lookup_font must use the
driver procedure to get the correct device to pass as the first argument to
gx_xglyph (*char_xglyph)(P5(gx_xfont *xf, gs_char chr, int encoding_index, gs_glyph glyph, gs_proc_glyph_name_t glyph_name))
gs_no_char; for an ordinary
showoperation, if the character code is invalid,
int (*char_metrics)(P5(gx_xfont *xf, gx_xglyph xg, int wmode, gs_int_point *pwidth, gs_int_rect *pbbox))
int (*render_char)(P7(gx_xfont *xf, gx_xglyph xg, gx_device *target, int x, int y, gx_color_index color, int required))
requiredis false, the procedure should return an error if the rendering operation would be expensive, since in this case Ghostscript has already cached the bitmap and metrics from a previous call with
required=true. If the operation cannot be done, return 1.
int (*release)(P2(gx_xfont *xf, const gs_memory_procs *mprocs))
NULL, also free any storage allocated by
lookup_font(including the xfont itself).
Copyright © 2000-2006 Artifex Software, Inc. All rights reserved.
This software is provided AS-IS with no warranty, either express or implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of that license. Refer to licensing information at http://www.artifex.com/ or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
Ghostscript version 9.22, 4 October 2017