⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 metfonts.h

📁 nucleus 文件系统,内核和彩色图形系统,在小系统上非常好用
💻 H
字号:
/*************************************************************************/
/*                                                                       */
/*         Copyright (c) 1997 - 1999 Accelerated Technology, Inc.        */
/*                                                                       */
/* PROPRIETARY RIGHTS of Accelerated Technology are involved in the      */
/* subject matter of this material.  All manufacturing, reproduction,    */
/* use, and sales rights pertaining to this subject matter are governed  */
/* by the license agreement.  The recipient of this software implicitly  */
/* accepts the terms of the license.                                     */
/*                                                                       */
/*************************************************************************/

/*************************************************************************/
/*                                                                       */
/* FILE NAME                                            VERSION          */
/*                                                                       */
/*      metfonts.h                                       1.6             */
/*                                                                       */
/* COMPONENT                                                             */
/*                                                                       */
/*      All                                                              */
/*                                                                       */
/* DESCRIPTION                                                           */
/*                                                                       */
/*      This file defines the GRAFIX fontHeader structure and text       */
/*		macros.															 */
/*                                                                       */
/* AUTHOR                                                                */
/*                                                                       */
/*      Robert G. Burrill, Accelerated Technology, Inc.                  */
/*                                                                       */
/* DATA STRUCTURES                                                       */
/*                                                                       */
/*      None                                                             */
/*                                                                       */
/* FUNCTIONS                                                             */
/*                                                                       */
/*      None                                                             */
/*                                                                       */
/* DEPENDENCIES                                                          */
/*                                                                       */
/*      None                                                             */
/*                                                                       */
/* HISTORY                                                               */
/*                                                                       */
/*         NAME            DATE                    REMARKS               */
/*                                                                       */
/*                                                                       */
/*************************************************************************/

typedef struct _fontRcd		/* Font Header Record Structure				*/
{
	byte fontVer;				/* Font format version number			*/
	byte fontRev;				/* Font style revision designator		*/
	byte nameLen;				/* Font name length (number of chars)	*/
	byte fontBaseName[16];		/* Font Base Name (ASCIIZ)				*/
	byte fontSuffix1[10];		/* Font suffix 1						*/
	byte fontSuffix2[10];		/* Font suffix 2						*/
	byte fontSuffix3[10];		/* Font suffix 3						*/
	byte fontFacing;			/* Synthesized font facing flags		*/
	byte fontSign[8];			/* "METAFONT" signature					*/
	byte fontWeight;			/* Font weight							*/
	byte fontCoding;			/* Character set encoding				*/
	long fontSize;				/* Buffer size needed to hold font		*/
	short fontMax;				/* Maximum character code				*/
	short fontMin;				/* Minimum character code				*/
	short fontPtSize;			/* Point Size							*/
	short fontfamily;			/* Font family code						*/
	short fontStyle;			/* Device style							*/
	short fontFlags;			/* Font flags							*/
	long fontColor[2];			/* Font character & background color	*/
	byte minChar;				/* Minimum ASCII character code			*/
	byte maxChar;				/* Maximum ASCII character code			*/
	short chWidth;				/* Fixed space character width			*/
	short chHeight;				/* Character height (ascent+decent)		*/
	short chKern;				/* Fixed space character offset (+/-)	*/
	short ascent;				/* Ascent								*/
	short decent;				/* Decent								*/
	short leading;				/* Leading (newBas=oldBas+chHgt+leading)*/
	short chBad;				/* Char to show for undefined codes		*/
	point chCenter;				/* Icon or Marker center (X,Y)			*/
	short chAngle;				/* Italicise slant angle				*/
	short chUnder;				/* recommended txUnder setting			*/
	short chScore;				/* recommended txScore setting			*/
	short fontRsvd;				/* (reserved for future use)			*/
	long locTbl;				/* offset to character location table	*/
	long ofwdTbl;				/* offset to character width/offset table*/
	long kernTbl;				/* offset to kerning pairs table		*/
	long sizeTbl;				/* offset to size/rotate table (stroked)*/
	long bmapTbl;				/* offset to font bitmap data record	*/
	long rowTbl;				/* offset to rowTable data area			*/
	long fontTbl;				/* offset to font image/nodes table		*/
	long fontNotice;			/* offset to trademk/cpyright notice	*/
	long fontSupplier;			/* offset to name of font supplier		*/
	long fontAuthor;			/* offset to name of font author		*/
	long fontInfo;				/* offset to miscellaneous font info	*/
	long fontDate;				/* offset to font creation date			*/
	word fontSpacing[2];		/* Vertical spacing between baselines	*/
	word fontLowHgt[2];			/* baseline to top of lowercase 'x'		*/
	word fontCapHgt[2];			/* baseline to top of capital 'H'		*/
	word fontAscent[2];			/* baseline to top of lowercase 'd'		*/
	word fontDescent[2];		/* baseline to bottom of lowercase 'p'	*/
	word fontMaxWid[2];			/* maximum character width				*/
	word fontAvgWid[2];			/* average character width				*/
	word fontEmWid[2];			/* Em space width						*/
	long offwidTbl[16];			/* offset to facing off/wid tables		*/
} fontRcd;

typedef struct _ofswid		/* Offset/Width Table Entry					*/
{
	byte wid;					/* character width (unsigned)			*/
	byte ofs;					/* character offset (signed)			*/
} ofswid;

/* fontFlags */
#define fixSpace		0x01	/* Fixed(1)/Proportional(0) spaced font */
#define fontType		0x02	/* Stroked(1) or bitmap(0) font */
#define iconFile		0x04	/* Icon/marker(1) or Font(0) file */

/* TextFace() constants */
#define faceBold		0x01
#define faceItalic		0x02
#define faceUnderline	0x04
#define faceStrikeout	0x08
#define faceHalftone	0x10
#define faceMirrorX		0x20	/* mirror are stroked faces only */
#define faceMirrorY		0x40
#define faceProportional 0x80


/* TextAlign() constants */
#define alignLeft		0
#define alignCenter		1
#define alignRight		2

#define alignBaseline	0
#define alignBottom		1
#define alignMiddle		2
#define alignTop		3

/* TextPath() constants */
#define pathRight		0
#define pathUp			900
#define pathLeft		1800
#define pathDown		2700

/* "StrokeFlags" status bits */
#define path			0x01	/* txPath  zero(0)/non-zero(1) */
#define angle			0x02	/* txAngle zero(0)/non-zero(1) */
#define slant			0x04	/* txSlant zero(0)/non-zero(1) */
#define signSlantSin	0x10	/* sinSlant +(0) or -(1) */
#define signSlantCos	0x20	/* cosSlant +(0) or -(1) */

#define fxSpac			chBad	/* the chBad font field is fixed space for stroked */

/* macros for text width routines (str1*.asm) - - - - - - - - - - - - - - - - */

#define rtnLcl			1		/* Return width in local(1) or global(0) coordinates */

/* Save the current pen level and position and hide the pen.*/
#define TXW_PSH \
	savLocX = LocX;\
	savLocY = LocY;\
	savPenX = grafPort.pnLoc.X;\
	savPenY = grafPort.pnLoc.Y;\
	grafPort.pnLevel--;

/* Restore the current pen level and position and show the pen. (Local)*/
#define TXW_POPLcl \
	grafPort.pnLevel++;\
	width = grafPort.pnLoc.X - savPenX;\
	LocY = savLocY;\
	LocX = savLocX;\
	grafPort.pnLoc.Y = savPenY;\
	thePort->pnLoc.Y = savPenY;\
	grafPort.pnLoc.X = savPenX;\
	thePort->pnLoc.X = savPenX;

/* Restore the current pen level and position and show the pen. (Global)*/
#define TXW_POPGbl \
	grafPort.pnLevel++;\
	width = grafPort.pnLoc.X - savLocX;\
	LocY = savLocY;\
	LocX = savLocX;\
	grafPort.pnLoc.Y = savPenY;\
	thePort->pnLoc.Y = savPenY;\
	grafPort.pnLoc.X = savPenX;\
	thePort->pnLoc.X = savPenX;

#if	 rtnLcl	/* - - - - - - - - */
#define TXW_POP TXW_POPLcl
#else	/* rtnGbl */
#define TXW_POP TXW_POPGbl
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -