aboutsummaryrefslogtreecommitdiff
path: root/X11/fonts/fontstruct.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-06-28 22:07:26 +0000
committermarha <marha@users.sourceforge.net>2009-06-28 22:07:26 +0000
commit3562e78743202e43aec8727005182a2558117eca (patch)
tree8f9113a77d12470c5c851a2a8e4cb02e89df7d43 /X11/fonts/fontstruct.h
downloadvcxsrv-3562e78743202e43aec8727005182a2558117eca.tar.gz
vcxsrv-3562e78743202e43aec8727005182a2558117eca.tar.bz2
vcxsrv-3562e78743202e43aec8727005182a2558117eca.zip
Checked in the following released items:
xkeyboard-config-1.4.tar.gz ttf-bitstream-vera-1.10.tar.gz font-alias-1.0.1.tar.gz font-sun-misc-1.0.0.tar.gz font-sun-misc-1.0.0.tar.gz font-sony-misc-1.0.0.tar.gz font-schumacher-misc-1.0.0.tar.gz font-mutt-misc-1.0.0.tar.gz font-misc-misc-1.0.0.tar.gz font-misc-meltho-1.0.0.tar.gz font-micro-misc-1.0.0.tar.gz font-jis-misc-1.0.0.tar.gz font-isas-misc-1.0.0.tar.gz font-dec-misc-1.0.0.tar.gz font-daewoo-misc-1.0.0.tar.gz font-cursor-misc-1.0.0.tar.gz font-arabic-misc-1.0.0.tar.gz font-winitzki-cyrillic-1.0.0.tar.gz font-misc-cyrillic-1.0.0.tar.gz font-cronyx-cyrillic-1.0.0.tar.gz font-screen-cyrillic-1.0.1.tar.gz font-xfree86-type1-1.0.1.tar.gz font-adobe-utopia-type1-1.0.1.tar.gz font-ibm-type1-1.0.0.tar.gz font-bitstream-type1-1.0.0.tar.gz font-bitstream-speedo-1.0.0.tar.gz font-bh-ttf-1.0.0.tar.gz font-bh-type1-1.0.0.tar.gz font-bitstream-100dpi-1.0.0.tar.gz font-bh-lucidatypewriter-100dpi-1.0.0.tar.gz font-bh-100dpi-1.0.0.tar.gz font-adobe-utopia-100dpi-1.0.1.tar.gz font-adobe-100dpi-1.0.0.tar.gz font-util-1.0.1.tar.gz font-bitstream-75dpi-1.0.0.tar.gz font-bh-lucidatypewriter-75dpi-1.0.0.tar.gz font-adobe-utopia-75dpi-1.0.1.tar.gz font-bh-75dpi-1.0.0.tar.gz bdftopcf-1.0.1.tar.gz font-adobe-75dpi-1.0.0.tar.gz mkfontscale-1.0.6.tar.gz openssl-0.9.8k.tar.gz bigreqsproto-1.0.2.tar.gz xtrans-1.2.2.tar.gz resourceproto-1.0.2.tar.gz inputproto-1.4.4.tar.gz compositeproto-0.4.tar.gz damageproto-1.1.0.tar.gz zlib-1.2.3.tar.gz xkbcomp-1.0.5.tar.gz freetype-2.3.9.tar.gz pthreads-w32-2-8-0-release.tar.gz pixman-0.12.0.tar.gz kbproto-1.0.3.tar.gz evieext-1.0.2.tar.gz fixesproto-4.0.tar.gz recordproto-1.13.2.tar.gz randrproto-1.2.2.tar.gz scrnsaverproto-1.1.0.tar.gz renderproto-0.9.3.tar.gz xcmiscproto-1.1.2.tar.gz fontsproto-2.0.2.tar.gz xextproto-7.0.3.tar.gz xproto-7.0.14.tar.gz libXdmcp-1.0.2.tar.gz libxkbfile-1.0.5.tar.gz libfontenc-1.0.4.tar.gz libXfont-1.3.4.tar.gz libX11-1.1.5.tar.gz libXau-1.0.4.tar.gz libxcb-1.1.tar.gz xorg-server-1.5.3.tar.gz
Diffstat (limited to 'X11/fonts/fontstruct.h')
-rw-r--r--X11/fonts/fontstruct.h295
1 files changed, 295 insertions, 0 deletions
diff --git a/X11/fonts/fontstruct.h b/X11/fonts/fontstruct.h
new file mode 100644
index 000000000..451ed6a12
--- /dev/null
+++ b/X11/fonts/fontstruct.h
@@ -0,0 +1,295 @@
+/* $Xorg: fontstruct.h,v 1.3 2000/08/18 04:05:44 coskrey Exp $ */
+/***********************************************************
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+/* $XFree86: xc/include/fonts/fontstruct.h,v 3.3 1999/08/21 13:47:34 dawes Exp $ */
+
+#ifndef FONTSTR_H
+#define FONTSTR_H
+
+#include <X11/Xproto.h>
+#include "font.h"
+#include <X11/Xfuncproto.h>
+#include <X11/Xdefs.h>
+
+/*
+ * This version of the server font data strucutre is only for describing
+ * the in memory data structure. The file structure is not necessarily a
+ * copy of this. That is up to the compiler and the OS layer font loading
+ * machinery.
+ */
+
+#define GLYPHPADOPTIONS 4 /* 1, 2, 4, or 8 */
+
+typedef struct _FontProp {
+ long name;
+ long value; /* assumes ATOM is not larger than INT32 */
+} FontPropRec;
+
+typedef struct _FontResolution {
+ unsigned short x_resolution;
+ unsigned short y_resolution;
+ unsigned short point_size;
+} FontResolutionRec;
+
+typedef struct _ExtentInfo {
+ DrawDirection drawDirection;
+ int fontAscent;
+ int fontDescent;
+ int overallAscent;
+ int overallDescent;
+ int overallWidth;
+ int overallLeft;
+ int overallRight;
+} ExtentInfoRec;
+
+typedef struct _CharInfo {
+ xCharInfo metrics; /* info preformatted for Queries */
+ char *bits; /* pointer to glyph image */
+} CharInfoRec;
+
+/*
+ * Font is created at font load time. It is specific to a single encoding.
+ * e.g. not all of the glyphs in a font may be part of a single encoding.
+ */
+
+typedef struct _FontInfo {
+ unsigned short firstCol;
+ unsigned short lastCol;
+ unsigned short firstRow;
+ unsigned short lastRow;
+ unsigned short defaultCh;
+ unsigned int noOverlap:1;
+ unsigned int terminalFont:1;
+ unsigned int constantMetrics:1;
+ unsigned int constantWidth:1;
+ unsigned int inkInside:1;
+ unsigned int inkMetrics:1;
+ unsigned int allExist:1;
+ unsigned int drawDirection:2;
+ unsigned int cachable:1;
+ unsigned int anamorphic:1;
+ short maxOverlap;
+ short pad;
+ xCharInfo maxbounds;
+ xCharInfo minbounds;
+ xCharInfo ink_maxbounds;
+ xCharInfo ink_minbounds;
+ short fontAscent;
+ short fontDescent;
+ int nprops;
+ FontPropPtr props;
+ char *isStringProp;
+} FontInfoRec;
+
+typedef struct _Font {
+ int refcnt;
+ FontInfoRec info;
+ char bit;
+ char byte;
+ char glyph;
+ char scan;
+ fsBitmapFormat format;
+ int (*get_glyphs) (FontPtr /* font */,
+ unsigned long /* count */,
+ unsigned char * /* chars */,
+ FontEncoding /* encoding */,
+ unsigned long * /* count */,
+ CharInfoPtr * /* glyphs */);
+ int (*get_metrics) (FontPtr /* font */,
+ unsigned long /* count */,
+ unsigned char * /* chars */,
+ FontEncoding /* encoding */,
+ unsigned long * /* count */,
+ xCharInfo ** /* glyphs */);
+ void (*unload_font) (FontPtr /* font */);
+ void (*unload_glyphs) (FontPtr /* font */);
+ FontPathElementPtr fpe;
+ pointer svrPrivate;
+ pointer fontPrivate;
+ pointer fpePrivate;
+ int maxPrivate;
+ pointer *devPrivates;
+} FontRec;
+
+#define FontGetPrivate(pFont,n) ((n) > (pFont)->maxPrivate ? (pointer) 0 : \
+ (pFont)->devPrivates[n])
+
+#define FontSetPrivate(pFont,n,ptr) ((n) > (pFont)->maxPrivate ? \
+ _FontSetNewPrivate (pFont, n, ptr) : \
+ ((((pFont)->devPrivates[n] = (ptr)) != 0) || TRUE))
+
+typedef struct _FontNames {
+ int nnames;
+ int size;
+ int *length;
+ char **names;
+} FontNamesRec;
+
+/* External view of font paths */
+typedef struct _FontPathElement {
+ int name_length;
+ char *name;
+ int type;
+ int refcount;
+ pointer private;
+} FontPathElementRec;
+
+typedef Bool (*NameCheckFunc) (char *name);
+typedef int (*InitFpeFunc) (FontPathElementPtr fpe);
+typedef int (*FreeFpeFunc) (FontPathElementPtr fpe);
+typedef int (*ResetFpeFunc) (FontPathElementPtr fpe);
+typedef int (*OpenFontFunc) ( pointer client,
+ FontPathElementPtr fpe,
+ Mask flags,
+ char* name,
+ int namelen,
+ fsBitmapFormat format,
+ fsBitmapFormatMask fmask,
+ XID id,
+ FontPtr* pFont,
+ char** aliasName,
+ FontPtr non_cachable_font);
+typedef void (*CloseFontFunc) (FontPathElementPtr fpe, FontPtr pFont);
+typedef int (*ListFontsFunc) (pointer client,
+ FontPathElementPtr fpe,
+ char* pat,
+ int len,
+ int max,
+ FontNamesPtr names);
+
+typedef int (*StartLfwiFunc) (pointer client,
+ FontPathElementPtr fpe,
+ char* pat,
+ int len,
+ int max,
+ pointer* privatep);
+
+typedef int (*NextLfwiFunc) (pointer client,
+ FontPathElementPtr fpe,
+ char** name,
+ int* namelen,
+ FontInfoPtr* info,
+ int* numFonts,
+ pointer private);
+
+typedef int (*WakeupFpeFunc) (FontPathElementPtr fpe,
+ unsigned long* LastSelectMask);
+
+typedef void (*ClientDiedFunc) (pointer client,
+ FontPathElementPtr fpe);
+
+typedef int (*LoadGlyphsFunc) (pointer client,
+ FontPtr pfont,
+ Bool range_flag,
+ unsigned int nchars,
+ int item_size,
+ unsigned char* data);
+
+typedef int (*StartLaFunc) (pointer client,
+ FontPathElementPtr fpe,
+ char* pat,
+ int len,
+ int max,
+ pointer* privatep);
+
+typedef int (*NextLaFunc) (pointer client,
+ FontPathElementPtr fpe,
+ char** namep,
+ int* namelenp,
+ char** resolvedp,
+ int* resolvedlenp,
+ pointer private);
+
+typedef void (*SetPathFunc)(void);
+
+typedef struct _FPEFunctions {
+ NameCheckFunc name_check;
+ InitFpeFunc init_fpe;
+ ResetFpeFunc reset_fpe;
+ FreeFpeFunc free_fpe;
+ OpenFontFunc open_font;
+ CloseFontFunc close_font;
+ ListFontsFunc list_fonts;
+ StartLaFunc start_list_fonts_and_aliases;
+ NextLaFunc list_next_font_or_alias;
+ StartLfwiFunc start_list_fonts_with_info;
+ NextLfwiFunc list_next_font_with_info;
+ WakeupFpeFunc wakeup_fpe;
+ ClientDiedFunc client_died;
+ /* for load_glyphs, range_flag = 0 ->
+ nchars = # of characters in data
+ item_size = bytes/char
+ data = list of characters
+ range_flag = 1 ->
+ nchars = # of fsChar2b's in data
+ item_size is ignored
+ data = list of fsChar2b's */
+ LoadGlyphsFunc load_glyphs;
+ SetPathFunc set_path_hook;
+} FPEFunctionsRec, FPEFunctions;
+
+/*
+ * Various macros for computing values based on contents of
+ * the above structures
+ */
+
+#define GLYPHWIDTHPIXELS(pci) \
+ ((pci)->metrics.rightSideBearing - (pci)->metrics.leftSideBearing)
+
+#define GLYPHHEIGHTPIXELS(pci) \
+ ((pci)->metrics.ascent + (pci)->metrics.descent)
+
+#define GLYPHWIDTHBYTES(pci) (((GLYPHWIDTHPIXELS(pci))+7) >> 3)
+
+#define GLYPHWIDTHPADDED(bc) (((bc)+7) & ~0x7)
+
+#define BYTES_PER_ROW(bits, nbytes) \
+ ((nbytes) == 1 ? (((bits)+7)>>3) /* pad to 1 byte */ \
+ :(nbytes) == 2 ? ((((bits)+15)>>3)&~1) /* pad to 2 bytes */ \
+ :(nbytes) == 4 ? ((((bits)+31)>>3)&~3) /* pad to 4 bytes */ \
+ :(nbytes) == 8 ? ((((bits)+63)>>3)&~7) /* pad to 8 bytes */ \
+ : 0)
+
+#define BYTES_FOR_GLYPH(ci,pad) (GLYPHHEIGHTPIXELS(ci) * \
+ BYTES_PER_ROW(GLYPHWIDTHPIXELS(ci),pad))
+/*
+ * Macros for computing different bounding boxes for fonts; from
+ * the font protocol
+ */
+
+#define FONT_MAX_ASCENT(pi) ((pi)->fontAscent > (pi)->ink_maxbounds.ascent ? \
+ (pi)->fontAscent : (pi)->ink_maxbounds.ascent)
+#define FONT_MAX_DESCENT(pi) ((pi)->fontDescent > (pi)->ink_maxbounds.descent ? \
+ (pi)->fontDescent : (pi)->ink_maxbounds.descent)
+#define FONT_MAX_HEIGHT(pi) (FONT_MAX_ASCENT(pi) + FONT_MAX_DESCENT(pi))
+#define FONT_MIN_LEFT(pi) ((pi)->ink_minbounds.leftSideBearing < 0 ? \
+ (pi)->ink_minbounds.leftSideBearing : 0)
+#define FONT_MAX_RIGHT(pi) ((pi)->ink_maxbounds.rightSideBearing > \
+ (pi)->ink_maxbounds.characterWidth ? \
+ (pi)->ink_maxbounds.rightSideBearing : \
+ (pi)->ink_maxbounds.characterWidth)
+#define FONT_MAX_WIDTH(pi) (FONT_MAX_RIGHT(pi) - FONT_MIN_LEFT(pi))
+
+#include "fontproto.h"
+
+#endif /* FONTSTR_H */