From 153e8da44452905ae04a0e20ad0d85f40399b4ca Mon Sep 17 00:00:00 2001 From: Kaleb Keithley Date: Fri, 14 Nov 2003 15:54:40 +0000 Subject: R6.6 is the Xorg base-line --- include/X11/fonts/bdfint.h | 82 +++++++++++++++++++++ include/X11/fonts/bitmap.h | 72 +++++++++++++++++++ include/X11/fonts/bufio.h | 122 +++++++++++++++++++++++++++++++ include/X11/fonts/fntfil.h | 80 +++++++++++++++++++++ include/X11/fonts/fntfilio.h | 50 +++++++++++++ include/X11/fonts/fntfilst.h | 166 +++++++++++++++++++++++++++++++++++++++++++ include/X11/fonts/fontmisc.h | 124 ++++++++++++++++++++++++++++++++ include/X11/fonts/fontshow.h | 37 ++++++++++ include/X11/fonts/fontxlfd.h | 98 +++++++++++++++++++++++++ include/X11/fonts/pcf.h | 91 ++++++++++++++++++++++++ 10 files changed, 922 insertions(+) create mode 100644 include/X11/fonts/bdfint.h create mode 100644 include/X11/fonts/bitmap.h create mode 100644 include/X11/fonts/bufio.h create mode 100644 include/X11/fonts/fntfil.h create mode 100644 include/X11/fonts/fntfilio.h create mode 100644 include/X11/fonts/fntfilst.h create mode 100644 include/X11/fonts/fontmisc.h create mode 100644 include/X11/fonts/fontshow.h create mode 100644 include/X11/fonts/fontxlfd.h create mode 100644 include/X11/fonts/pcf.h (limited to 'include/X11') diff --git a/include/X11/fonts/bdfint.h b/include/X11/fonts/bdfint.h new file mode 100644 index 0000000..04e4c41 --- /dev/null +++ b/include/X11/fonts/bdfint.h @@ -0,0 +1,82 @@ +/* $Xorg: bdfint.h,v 1.4 2001/02/09 02:04:01 xorgcvs Exp $ */ + +/* + +Copyright 1990, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ + +#ifndef BDFINT_H +#define BDFINT_H + +#define bdfIsPrefix(buf,str) (!strncmp((char *)buf,str,strlen(str))) +#define bdfStrEqual(s1,s2) (!strcmp(s1,s2)) + +#define BDF_GENPROPS 6 +#define NullProperty ((FontPropPtr)0) + +/* + * This structure holds some properties we need to generate if they aren't + * specified in the BDF file and some other values read from the file + * that we'll need to calculate them. We need to keep track of whether + * or not we've read them. + */ +typedef struct BDFSTAT { + int linenum; + char *fileName; + char fontName[MAXFONTNAMELEN]; + float pointSize; + int resolution_x; + int resolution_y; + int digitCount; + int digitWidths; + int exHeight; + + FontPropPtr fontProp; + FontPropPtr pointSizeProp; + FontPropPtr resolutionXProp; + FontPropPtr resolutionYProp; + FontPropPtr resolutionProp; + FontPropPtr xHeightProp; + FontPropPtr weightProp; + FontPropPtr quadWidthProp; + BOOL haveFontAscent; + BOOL haveFontDescent; + BOOL haveDefaultCh; +} bdfFileState; + +extern unsigned char *bdfGetLine(); + +extern void bdfError( +#if NeedVarargsPrototypes + char* message, ... +#endif +); +extern void bdfWarning(); +extern Atom bdfForceMakeAtom(); +extern Atom bdfGetPropertyValue(); +extern unsigned char bdfHexByte(); + +#endif /* BDFINT_H */ diff --git a/include/X11/fonts/bitmap.h b/include/X11/fonts/bitmap.h new file mode 100644 index 0000000..027b869 --- /dev/null +++ b/include/X11/fonts/bitmap.h @@ -0,0 +1,72 @@ +/* $Xorg: bitmap.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ + +/* + +Copyright 1990, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ + +/* + * Author: Keith Packard, MIT X Consortium + */ + +#ifndef _BITMAP_H_ +#define _BITMAP_H_ + +#include +#include /* just for NULL */ + +/* + * Internal format used to store bitmap fonts + */ + +typedef struct _BitmapExtra { + Atom *glyphNames; + int *sWidths; + CARD32 bitmapsSizes[GLYPHPADOPTIONS]; + FontInfoRec info; +} BitmapExtraRec, *BitmapExtraPtr; + +typedef struct _BitmapFont { + unsigned version_num; + int num_chars; + int num_tables; + CharInfoPtr metrics; /* font metrics, including glyph pointers */ + xCharInfo *ink_metrics; /* ink metrics */ + char *bitmaps; /* base of bitmaps, useful only to free */ + CharInfoPtr *encoding; /* array of char info pointers */ + CharInfoPtr pDefault; /* default character */ + BitmapExtraPtr bitmapExtra; /* stuff not used by X server */ +} BitmapFontRec, *BitmapFontPtr; + +extern int bitmapReadFont(), bitmapReadFontInfo(); +extern int bitmapGetGlyphs(), bitmapGetMetrics(); +extern int bitmapGetBitmaps(), bitmapGetExtents(); +extern void bitmapUnloadFont(); + +extern void bitmapComputeFontBounds(); +extern void bitmapComputeFontInkBounds(); + +#endif /* _BITMAP_H_ */ diff --git a/include/X11/fonts/bufio.h b/include/X11/fonts/bufio.h new file mode 100644 index 0000000..493f3ce --- /dev/null +++ b/include/X11/fonts/bufio.h @@ -0,0 +1,122 @@ +/* $Xorg: bufio.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ + +/* + +Copyright 1993, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ + +#ifdef TEST + +#define xalloc(s) malloc(s) +#define xfree(s) free(s) + +#endif + +#define BUFFILESIZE 8192 +#define BUFFILEEOF -1 + +typedef unsigned char BufChar; + +typedef struct _buffile { + BufChar *bufp; + int left; + BufChar buffer[BUFFILESIZE]; + int (*io)(/* BufFilePtr f */); + int (*skip)(/* BufFilePtr f, int count */); + int (*close)(/* BufFilePtr f */); + char *private; +} BufFileRec, *BufFilePtr; + +extern BufFilePtr BufFileCreate ( +#if NeedFunctionPrototypes + char*, + int (*)(), + int (*)(), + int (*)() +#endif +); +extern BufFilePtr BufFileOpenRead ( +#if NeedFunctionPrototypes + int +#endif +); + +extern BufFilePtr BufFileOpenWrite ( +#if NeedFunctionPrototypes + int +#endif +); + +extern BufFilePtr BufFilePushCompressed ( +#if NeedFunctionPrototypes + BufFilePtr +#endif +); +#ifdef X_GZIP_FONT_COMPRESSION +extern BufFilePtr BufFilePushZIP ( +#if NeedFunctionPrototypes + BufFilePtr +#endif +); +#endif +extern int BufFileClose ( +#if NeedFunctionPrototypes + BufFilePtr, + int +#endif +); +extern int BufFileFlush ( +#if NeedFunctionPrototypes + BufFilePtr +#endif +); + +extern int BufFileRead ( +#if NeedFunctionPrototypes + BufFilePtr, + char*, + int +#endif +); + +extern int BufFileWrite ( +#if NeedFunctionPrototypes + BufFilePtr, + char*, + int +#endif +); + +#define BufFileGet(f) ((f)->left-- ? *(f)->bufp++ : (*(f)->io) (f)) +#define BufFilePut(c,f) (--(f)->left ? *(f)->bufp++ = (c) : (*(f)->io) (c,f)) +#define BufFileSkip(f,c) ((*(f)->skip) (f, c)) + +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif diff --git a/include/X11/fonts/fntfil.h b/include/X11/fonts/fntfil.h new file mode 100644 index 0000000..6999e51 --- /dev/null +++ b/include/X11/fonts/fntfil.h @@ -0,0 +1,80 @@ +/* $Xorg: fntfil.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ + +/* + +Copyright 1991, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ + +/* + * Author: Keith Packard, MIT X Consortium + */ + +#ifndef _FONTFILE_H_ +#define _FONTFILE_H_ +typedef struct _FontEntry *FontEntryPtr; +typedef struct _FontTable *FontTablePtr; +typedef struct _FontName *FontNamePtr; +typedef struct _FontScaled *FontScaledPtr; +typedef struct _FontScalableExtra *FontScalableExtraPtr; +typedef struct _FontScalableEntry *FontScalableEntryPtr; +typedef struct _FontScaleAliasEntry *FontScaleAliasEntryPtr; +typedef struct _FontBitmapEntry *FontBitmapEntryPtr; +typedef struct _FontAliasEntry *FontAliasEntryPtr; +typedef struct _FontBCEntry *FontBCEntryPtr; +typedef struct _FontDirectory *FontDirectoryPtr; +typedef struct _FontRenderer *FontRendererPtr; + +#define NullFontEntry ((FontEntryPtr) 0) +#define NullFontTable ((FontTablePtr) 0) +#define NullFontName ((FontNamePtr) 0) +#define NullFontScaled ((FontScaled) 0) +#define NullFontScalableExtra ((FontScalableExtra) 0) +#define NullFontscalableEntry ((FontScalableEntry) 0) +#define NullFontScaleAliasEntry ((FontScaleAliasEntry) 0) +#define NullFontBitmapEntry ((FontBitmapEntry) 0) +#define NullFontAliasEntry ((FontAliasEntry) 0) +#define NullFontBCEntry ((FontBCEntry) 0) +#define NullFontDirectory ((FontDirectoryPtr) 0) +#define NullFontRenderer ((FontRendererPtr) 0) + +#define FONT_ENTRY_SCALABLE 0 +#define FONT_ENTRY_SCALE_ALIAS 1 +#define FONT_ENTRY_BITMAP 2 +#define FONT_ENTRY_ALIAS 3 +#define FONT_ENTRY_BC 4 + +#define MAXFONTNAMELEN 1024 +#define MAXFONTFILENAMELEN 1024 + +#define FontDirFile "fonts.dir" +#define FontAliasFile "fonts.alias" +#define FontScalableFile "fonts.scale" + +extern FontEntryPtr FontFileFindNameInDir (); +extern FontEntryPtr FontFileFindNameInScalableDir (); +extern FontDirectoryPtr FontFileMakeDir (); +extern FontRendererPtr FontFileMatchRenderer (); +extern char *FontFileSaveString (); +extern FontScaledPtr FontFileFindScaledInstance (); +#endif /* _FONTFILE_H_ */ diff --git a/include/X11/fonts/fntfilio.h b/include/X11/fonts/fntfilio.h new file mode 100644 index 0000000..ffb146b --- /dev/null +++ b/include/X11/fonts/fntfilio.h @@ -0,0 +1,50 @@ +/* $Xorg: fntfilio.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ + +/* + +Copyright 1991, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ + +/* + * Author: Keith Packard, MIT X Consortium + */ + +#include + +typedef BufFilePtr FontFilePtr; + +#define FontFileGetc(f) BufFileGet(f) +#define FontFilePutc(c,f) BufFilePut(c,f) +#define FontFileRead(f,b,n) BufFileRead(f,b,n) +#define FontFileWrite(f,b,n) BufFileWrite(f,b,n) +#define FontFileSkip(f,n) (BufFileSkip (f, n) != BUFFILEEOF) +#define FontFileSeek(f,n) (BufFileSeek (f,n,0) != BUFFILEEOF) + +#define FontFileEOF BUFFILEEOF + +extern FontFilePtr FontFileOpen (); +extern FontFilePtr FontFileOpenWrite (); +extern FontFilePtr FontFileOpenFd (); +extern FontFilePtr FontFileOpenWriteFd (); +extern int FontFileClose (); diff --git a/include/X11/fonts/fntfilst.h b/include/X11/fonts/fntfilst.h new file mode 100644 index 0000000..8e90090 --- /dev/null +++ b/include/X11/fonts/fntfilst.h @@ -0,0 +1,166 @@ +/* $Xorg: fntfilst.h,v 1.5 2001/02/09 02:04:04 xorgcvs Exp $ */ + +/* + +Copyright 1991, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ + +/* + * Author: Keith Packard, MIT X Consortium + */ + +#ifndef _FONTFILEST_H_ +#define _FONTFILEST_H_ + +#include +#ifndef XP_PSTEXT +#include "fontmisc.h" +#endif +#include "fontstruct.h" +#include "fntfil.h" +#include "fontxlfd.h" + +typedef struct _FontName { + char *name; + short length; + short ndashes; +} FontNameRec; + +typedef struct _FontScaled { + FontScalableRec vals; + FontEntryPtr bitmap; + FontPtr pFont; +} FontScaledRec; + +typedef struct _FontScalableExtra { + FontScalableRec defaults; + int numScaled; + int sizeScaled; + FontScaledPtr scaled; + pointer private; +} FontScalableExtraRec; + +typedef struct _FontScalableEntry { + FontRendererPtr renderer; + char *fileName; + FontScalableExtraPtr extra; +} FontScalableEntryRec; + +/* + * This "can't" work yet - the returned alias string must be permanent, + * but this layer would need to generate the appropriate name from the + * resolved scalable + the XLFD values passed in. XXX + */ + +typedef struct _FontScaleAliasEntry { + char *resolved; +} FontScaleAliasEntryRec; + +typedef struct _FontBitmapEntry { + FontRendererPtr renderer; + char *fileName; + FontPtr pFont; +} FontBitmapEntryRec; + +typedef struct _FontAliasEntry { + char *resolved; +} FontAliasEntryRec; + +typedef struct _FontBCEntry { + FontScalableRec vals; + FontEntryPtr entry; +} FontBCEntryRec; + +typedef struct _FontEntry { + FontNameRec name; + int type; + union _FontEntryParts { + FontScalableEntryRec scalable; + FontBitmapEntryRec bitmap; + FontAliasEntryRec alias; + FontBCEntryRec bc; + } u; +} FontEntryRec; + +typedef struct _FontTable { + int used; + int size; + FontEntryPtr entries; + Bool sorted; +} FontTableRec; + +typedef struct _FontDirectory { + char *directory; + unsigned long dir_mtime; + unsigned long alias_mtime; + FontTableRec scalable; + FontTableRec nonScalable; +} FontDirectoryRec; + +/* Capability bits: for definition of capabilities bitmap in the + FontRendererRec to indicate support of XLFD enhancements */ + +#define CAP_MATRIX 0x1 +#define CAP_CHARSUBSETTING 0x2 + +typedef struct _FontRenderer { + char *fileSuffix; + int fileSuffixLen; + int (*OpenBitmap)(/* fpe, pFont, flags, entry, fileName, format, fmask */); + int (*OpenScalable)(/* fpe, pFont, flags, entry, fileName, vals, format, fmask */); + int (*GetInfoBitmap)(/* fpe, pFontInfo, entry, fileName */); + int (*GetInfoScalable)(/* fpe, pFontInfo, entry, fileName, vals */); + int number; + int capabilities; /* Bitmap components defined above */ +} FontRendererRec; + +typedef struct _FontRenders { + int number; + FontRendererPtr *renderers; +} FontRenderersRec, *FontRenderersPtr; + +typedef struct _BitmapInstance { + FontScalableRec vals; + FontBitmapEntryPtr bitmap; +} BitmapInstanceRec, *BitmapInstancePtr; + +typedef struct _BitmapScalablePrivate { + int numInstances; + BitmapInstancePtr instances; +} BitmapScalablePrivateRec, *BitmapScalablePrivatePtr; + +typedef struct _BitmapSources { + FontPathElementPtr *fpe; + int size; + int count; +} BitmapSourcesRec, *BitmapSourcesPtr; + +extern BitmapSourcesRec FontFileBitmapSources; + +/* Defines for FontFileFindNamesInScalableDir() behavior */ +#define NORMAL_ALIAS_BEHAVIOR 0 +#define LIST_ALIASES_AND_TARGET_NAMES (1<<0) +#define IGNORE_SCALABLE_ALIASES (1<<1) + +#endif /* _FONTFILEST_H_ */ diff --git a/include/X11/fonts/fontmisc.h b/include/X11/fonts/fontmisc.h new file mode 100644 index 0000000..22ee61e --- /dev/null +++ b/include/X11/fonts/fontmisc.h @@ -0,0 +1,124 @@ +/* $Xorg: fontmisc.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ + +/* + +Copyright 1991, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ + +/* + * Author: Keith Packard, MIT X Consortium + */ + +#ifndef _FONTMISC_H_ +#define _FONTMISC_H_ + +#include + +#ifndef X_NOT_STDC_ENV +#include +#else +extern int rand(); +#endif +#include + +#ifndef X_NOT_POSIX +#include +#else +extern int close(); +#endif + +typedef unsigned char *pointer; +typedef int Bool; + +#ifndef X_PROTOCOL +#ifndef _XSERVER64 +typedef unsigned long Atom; +typedef unsigned long XID; +#else +#include +typedef CARD32 XID; +typedef CARD32 Atom; +#endif +#endif + +#ifndef LSBFirst +#define LSBFirst 0 +#define MSBFirst 1 +#endif + +#ifndef None +#define None 0l +#endif + +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif + +extern char *NameForAtom (); + +#define xalloc(n) Xalloc ((unsigned) n) +#define xfree(p) Xfree ((pointer) p) +#define xrealloc(p,n) Xrealloc ((pointer)p,n) +#define lowbit(x) ((x) & (~(x) + 1)) + +#define assert(x) + +extern void +BitOrderInvert( +#if NeedFunctionPrototypes + register unsigned char *, + register int +#endif +); + +extern void +TwoByteSwap( +#if NeedFunctionPrototypes + register unsigned char *, + register int +#endif +); + +extern void +FourByteSwap( +#if NeedFunctionPrototypes + register unsigned char *, + register int +#endif +); + +extern int +RepadBitmap ( +#if NeedFunctionPrototypes + char*, + char*, + unsigned, + unsigned, + int, + int +#endif +); + +#endif /* _FONTMISC_H_ */ diff --git a/include/X11/fonts/fontshow.h b/include/X11/fonts/fontshow.h new file mode 100644 index 0000000..5bb48fe --- /dev/null +++ b/include/X11/fonts/fontshow.h @@ -0,0 +1,37 @@ +/* $Xorg: fontshow.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ + +/* + +Copyright 1990, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ + +/* + * Author: Keith Packard, MIT X Consortium + */ + +#define FONT_SHOW_INFO (1<<0) +#define FONT_SHOW_PROPS (1<<1) +#define FONT_SHOW_METRICS (1<<2) +#define FONT_SHOW_GLYPHS (1<<3) +#define FONT_SHOW_ALL (FONT_SHOW_INFO|FONT_SHOW_PROPS|FONT_SHOW_GLYPHS) diff --git a/include/X11/fonts/fontxlfd.h b/include/X11/fonts/fontxlfd.h new file mode 100644 index 0000000..759d41e --- /dev/null +++ b/include/X11/fonts/fontxlfd.h @@ -0,0 +1,98 @@ +/* $Xorg: fontxlfd.h,v 1.4 2001/02/09 02:04:04 xorgcvs Exp $ */ + +/* + +Copyright 1990, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ + +/* + * Author: Keith Packard, MIT X Consortium + */ + +#ifndef _FONTXLFD_H_ +#define _FONTXLFD_H_ + +#include "FSproto.h" + +/* Constants for values_supplied bitmap */ + +#define SIZE_SPECIFY_MASK 0xf + +#define PIXELSIZE_MASK 0x3 +#define PIXELSIZE_UNDEFINED 0 +#define PIXELSIZE_SCALAR 0x1 +#define PIXELSIZE_ARRAY 0x2 +#define PIXELSIZE_SCALAR_NORMALIZED 0x3 /* Adjusted for resolution */ + +#define POINTSIZE_MASK 0xc +#define POINTSIZE_UNDEFINED 0 +#define POINTSIZE_SCALAR 0x4 +#define POINTSIZE_ARRAY 0x8 + +#define PIXELSIZE_WILDCARD 0x10 +#define POINTSIZE_WILDCARD 0x20 + +#define ENHANCEMENT_SPECIFY_MASK 0x40 + +#define CHARSUBSET_SPECIFIED 0x40 + +#define EPS 1.0e-20 +#define XLFD_NDIGITS 3 /* Round numbers in pixel and + point arrays to this many + digits for repeatability */ +double xlfd_round_double(); + +typedef struct _FontScalable { + int values_supplied; /* Bitmap identifying what advanced + capabilities or enhancements + were specified in the font name */ + double pixel_matrix[4]; + double point_matrix[4]; + + /* Pixel and point fields are deprecated in favor of the + transformation matrices. They are provided and filled in for the + benefit of rasterizers that do not handle the matrices. */ + + int pixel, + point; + + int x, + y, + width; + char *xlfdName; + int nranges; + fsRange *ranges; +} FontScalableRec, *FontScalablePtr; + +extern Bool FontParseXLFDName(); +extern fsRange *FontParseRanges(); + +#define FONT_XLFD_REPLACE_NONE 0 +#define FONT_XLFD_REPLACE_STAR 1 +#define FONT_XLFD_REPLACE_ZERO 2 +#define FONT_XLFD_REPLACE_VALUE 3 + +#endif /* _FONTXLFD_H_ */ diff --git a/include/X11/fonts/pcf.h b/include/X11/fonts/pcf.h new file mode 100644 index 0000000..510a8a6 --- /dev/null +++ b/include/X11/fonts/pcf.h @@ -0,0 +1,91 @@ +/* $Xorg: pcf.h,v 1.4 2001/02/09 02:04:02 xorgcvs Exp $ */ + +/* + +Copyright 1991, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ + +/* + * Author: Keith Packard, MIT X Consortium + */ + +#ifndef _PCF_H_ +#define _PCF_H_ + +/* + * Information used to read/write PCF fonts + */ + +typedef struct _PCFTable { + CARD32 type; + CARD32 format; + CARD32 size; + CARD32 offset; +} PCFTableRec, *PCFTablePtr; + +#define PCF_FILE_VERSION (('p'<<24)|('c'<<16)|('f'<<8)|1) +#define PCF_FORMAT_MASK 0xffffff00 + +#define PCF_DEFAULT_FORMAT 0x00000000 +#define PCF_INKBOUNDS 0x00000200 +#define PCF_ACCEL_W_INKBOUNDS 0x00000100 +#define PCF_COMPRESSED_METRICS 0x00000100 + +#define PCF_FORMAT_MATCH(a,b) (((a)&PCF_FORMAT_MASK) == ((b)&PCF_FORMAT_MASK)) + +#define PCF_GLYPH_PAD_MASK (3<<0) +#define PCF_BYTE_MASK (1<<2) +#define PCF_BIT_MASK (1<<3) +#define PCF_SCAN_UNIT_MASK (3<<4) + +#define PCF_BYTE_ORDER(f) (((f) & PCF_BYTE_MASK)?MSBFirst:LSBFirst) +#define PCF_BIT_ORDER(f) (((f) & PCF_BIT_MASK)?MSBFirst:LSBFirst) +#define PCF_GLYPH_PAD_INDEX(f) ((f) & PCF_GLYPH_PAD_MASK) +#define PCF_GLYPH_PAD(f) (1<> 4) +#define PCF_SCAN_UNIT(f) (1<