Home | History | Annotate | Download | only in include
      1 /*
      2  * prntfont.h
      3  *
      4  * Declarations for Windows NT printer driver font metrics
      5  *
      6  * This file is part of the w32api package.
      7  *
      8  * Contributors:
      9  *   Created by Filip Navara <xnavara (at) volny.cz>
     10  *
     11  * THIS SOFTWARE IS NOT COPYRIGHTED
     12  *
     13  * This source code is offered for use in the public domain. You may
     14  * use, modify or distribute it freely.
     15  *
     16  * This code is distributed in the hope that it will be useful but
     17  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
     18  * DISCLAIMED. This includes but is not limited to warranties of
     19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     20  *
     21  */
     22 
     23 #ifndef __PRNTFONT_H
     24 #define __PRNTFONT_H
     25 
     26 #define UNIFM_VERSION_1_0		0x10000
     27 #define UNI_GLYPHSETDATA_VERSION_1_0	0x10000
     28 
     29 #define UFM_SOFT	1
     30 #define UFM_CART        2
     31 #define UFM_SCALABLE    4
     32 
     33 #define DF_TYPE_HPINTELLIFONT	0
     34 #define DF_TYPE_TRUETYPE	1
     35 #define DF_TYPE_PST1		2
     36 #define DF_TYPE_CAPSL		3
     37 #define DF_TYPE_OEM1		4
     38 #define DF_TYPE_OEM2		5
     39 #define DF_NOITALIC		1
     40 #define DF_NOUNDER		2
     41 #define DF_XM_CR		4
     42 #define DF_NO_BOLD		8
     43 #define DF_NO_DOUBLE_UNDERLINE	16
     44 #define DF_NO_STRIKETHRU	32
     45 #define DF_BKSP_OK		64
     46 
     47 #define MTYPE_COMPOSE			1
     48 #define MTYPE_DIRECT			2
     49 #define MTYPE_PAIRED			4
     50 #define MTYPE_FORMAT_MASK		7
     51 #define MTYPE_SINGLE			8
     52 #define MTYPE_DOUBLE			16
     53 #define MTYPE_DOUBLEBYTECHAR_MASK	24
     54 #define MTYPE_REPLACE			32
     55 #define MTYPE_ADD			64
     56 #define MTYPE_DISABLE			128
     57 #define MTYPE_PREDEFIN_MASK		192
     58 
     59 #define CC_NOPRECNV	0x0000FFFF
     60 #define CC_DEFAULT	0
     61 #define CC_CP437	-1
     62 #define CC_CP850	-2
     63 #define CC_CP863	-3
     64 #define CC_BIG5		-10
     65 #define CC_ISC		-11
     66 #define CC_JIS		-12
     67 #define CC_JIS_ANK	-13
     68 #define CC_NS86		-14
     69 #define CC_TCA		-15
     70 #define CC_GB2312	-16
     71 #define CC_SJIS		-17
     72 #define CC_WANSUNG	-18
     73 
     74 #define UFF_FILE_MAGIC		'UFF1'
     75 #define UFF_VERSION_NUMBER	0x10001
     76 #define FONT_DIR_SORTED		1
     77 #define FONT_REC_SIG            'CERF'
     78 #define WINNT_INSTALLER_SIG     'IFTN'
     79 
     80 #define FONT_FL_UFM             0x0001
     81 #define FONT_FL_IFI             0x0002
     82 #define FONT_FL_SOFTFONT        0x0004
     83 #define FONT_FL_PERMANENT_SF    0x0008
     84 #define FONT_FL_DEVICEFONT      0x0010
     85 #define FONT_FL_GLYPHSET_GTT    0x0020
     86 #define FONT_FL_GLYPHSET_RLE    0x0040
     87 #define FONT_FL_RESERVED        0x8000
     88 
     89 #define DATA_UFM_SIG        'MFUD'
     90 #define DATA_IFI_SIG        'IFID'
     91 #define DATA_GTT_SIG        'TTGD'
     92 #define DATA_CTT_SIG        'TTCD'
     93 #define DATA_VAR_SIG        'RAVD'
     94 
     95 #define FG_CANCHANGE	128
     96 #define WM_FI_FILENAME	900
     97 
     98 #define GET_UNIDRVINFO(pUFM) ((PUNIDRVINFO)((ULONG_PTR)(pUFM) + (pUFM)->loUnidrvInfo))
     99 #define GET_IFIMETRICS(pUFM) ((IFIMETRICS*)((ULONG_PTR)(pUFM) + (pUFM)->loIFIMetrics))
    100 #define GET_EXTTEXTMETRIC(pUFM) ((EXTTEXTMETRIC*)((ULONG_PTR)(pUFM) + (pUFM)->loExtTextMetric))
    101 #define GET_WIDTHTABLE(pUFM) ((PWIDTHTABLE)((ULONG_PTR)(pUFM) + (pUFM)->loWidthTable))
    102 #define GET_KERNDATA(pUFM) ((PKERNDATA)((ULONG_PTR)(pUFM) + (pUFM)->loKernPair))
    103 #define GET_SELECT_CMD(pUni) ((PCHAR)(pUni) + (pUni)->SelectFont.loOffset)
    104 #define GET_UNSELECT_CMD(pUni) ((PCHAR)(pUni) + (pUni)->UnSelectFont.loOffset)
    105 #define GET_GLYPHRUN(pGTT) ((PGLYPHRUN)((ULONG_PTR)(pGTT) + ((PUNI_GLYPHSETDATA)pGTT)->loRunOffset))
    106 #define GET_CODEPAGEINFO(pGTT) ((PUNI_CODEPAGEINFO)((ULONG_PTR)(pGTT) + ((PUNI_GLYPHSETDATA)pGTT)->loCodePageOffset))
    107 #define GET_MAPTABLE(pGTT) ((PMAPTABLE)((ULONG_PTR)(pGTT) + ((PUNI_GLYPHSETDATA)pGTT)->loMapTableOffset))
    108 
    109 typedef struct _UNIFM_HDR
    110 {
    111   DWORD  dwSize;
    112   DWORD  dwVersion;
    113   ULONG  ulDefaultCodepage;
    114   LONG  lGlyphSetDataRCID;
    115   DWORD  loUnidrvInfo;
    116   DWORD  loIFIMetrics;
    117   DWORD  loExtTextMetric;
    118   DWORD  loWidthTable;
    119   DWORD  loKernPair;
    120   DWORD  dwReserved[2];
    121 } UNIFM_HDR, *PUNIFM_HDR;
    122 
    123 typedef struct _INVOC
    124 {
    125   DWORD  dwCount;
    126   DWORD  loOffset;
    127 } INVOC, *PINVOC;
    128 
    129 typedef struct _UNIDRVINFO
    130 {
    131   DWORD  dwSize;
    132   DWORD  flGenFlags;
    133   WORD  wType;
    134   WORD  fCaps;
    135   WORD  wXRes;
    136   WORD  wYRes;
    137   SHORT  sYAdjust;
    138   SHORT  sYMoved;
    139   WORD  wPrivateData;
    140   SHORT  sShift;
    141   INVOC  SelectFont;
    142   INVOC  UnSelectFont;
    143   WORD  wReserved[4];
    144 } UNIDRVINFO, *PUNIDRVINFO;
    145 
    146 typedef struct _EXTTEXTMETRIC
    147 {
    148   SHORT  emSize;
    149   SHORT  emPointSize;
    150   SHORT  emOrientation;
    151   SHORT  emMasterHeight;
    152   SHORT  emMinScale;
    153   SHORT  emMaxScale;
    154   SHORT  emMasterUnits;
    155   SHORT  emCapHeight;
    156   SHORT  emXHeight;
    157   SHORT  emLowerCaseAscent;
    158   SHORT  emLowerCaseDescent;
    159   SHORT  emSlant;
    160   SHORT  emSuperScript;
    161   SHORT  emSubScript;
    162   SHORT  emSuperScriptSize;
    163   SHORT  emSubScriptSize;
    164   SHORT  emUnderlineOffset;
    165   SHORT  emUnderlineWidth;
    166   SHORT  emDoubleUpperUnderlineOffset;
    167   SHORT  emDoubleLowerUnderlineOffset;
    168   SHORT  emDoubleUpperUnderlineWidth;
    169   SHORT  emDoubleLowerUnderlineWidth;
    170   SHORT  emStrikeOutOffset;
    171   SHORT  emStrikeOutWidth;
    172   WORD  emKernPairs;
    173   WORD  emKernTracks;
    174 } EXTTEXTMETRIC, *PEXTTEXTMETRIC;
    175 
    176 typedef struct _WIDTHRUN
    177 {
    178   WORD  wStartGlyph;
    179   WORD  wGlyphCount;
    180   DWORD  loCharWidthOffset;
    181 } WIDTHRUN, *PWIDTHRUN;
    182 
    183 typedef struct _WIDTHTABLE
    184 {
    185   DWORD  dwSize;
    186   DWORD  dwRunNum;
    187   WIDTHRUN  WidthRun[1];
    188 } WIDTHTABLE, *PWIDTHTABLE;
    189 
    190 typedef struct _KERNDATA
    191 {
    192   DWORD  dwSize;
    193   DWORD  dwKernPairNum;
    194   FD_KERNINGPAIR  KernPair[1];
    195 } KERNDATA, *PKERNDATA;
    196 
    197 typedef struct _UNI_GLYPHSETDATA
    198 {
    199   DWORD  dwSize;
    200   DWORD  dwVersion;
    201   DWORD  dwFlags;
    202   LONG  lPredefinedID;
    203   DWORD  dwGlyphCount;
    204   DWORD  dwRunCount;
    205   DWORD  loRunOffset;
    206   DWORD  dwCodePageCount;
    207   DWORD  loCodePageOffset;
    208   DWORD  loMapTableOffset;
    209   DWORD  dwReserved[2];
    210 } UNI_GLYPHSETDATA, *PUNI_GLYPHSETDATA;
    211 
    212 typedef struct _UNI_CODEPAGEINFO
    213 {
    214   DWORD  dwCodePage;
    215   INVOC  SelectSymbolSet;
    216   INVOC  UnSelectSymbolSet;
    217 } UNI_CODEPAGEINFO, *PUNI_CODEPAGEINFO;
    218 
    219 typedef struct _GLYPHRUN
    220 {
    221   WCHAR  wcLow;
    222   WORD  wGlyphCount;
    223 } GLYPHRUN, *PGLYPHRUN;
    224 
    225 typedef struct _TRANSDATA
    226 {
    227   BYTE  ubCodePageID;
    228   BYTE  ubType;
    229   union
    230   {
    231     SHORT  sCode;
    232     BYTE  ubCode;
    233     BYTE  ubPairs[2];
    234   } uCode;
    235 } TRANSDATA, *PTRANSDATA;
    236 
    237 typedef struct _MAPTABLE {
    238   DWORD  dwSize;
    239   DWORD  dwGlyphNum;
    240   TRANSDATA  Trans[1];
    241 } MAPTABLE, *PMAPTABLE;
    242 
    243 typedef struct _UFF_FILEHEADER {
    244   DWORD  dwSignature;
    245   DWORD  dwVersion;
    246   DWORD  dwSize;
    247   DWORD  nFonts;
    248   DWORD  nGlyphSets;
    249   DWORD  nVarData;
    250   DWORD  offFontDir;
    251   DWORD  dwFlags;
    252   DWORD  dwReserved[4];
    253 } UFF_FILEHEADER, *PUFF_FILEHEADER;
    254 
    255 typedef struct _UFF_FONTDIRECTORY {
    256   DWORD  dwSignature;
    257   WORD  wSize;
    258   WORD  wFontID;
    259   SHORT  sGlyphID;
    260   WORD  wFlags;
    261   DWORD  dwInstallerSig;
    262   DWORD  offFontName;
    263   DWORD  offCartridgeName;
    264   DWORD  offFontData;
    265   DWORD  offGlyphData;
    266   DWORD  offVarData;
    267 } UFF_FONTDIRECTORY, *PUFF_FONTDIRECTORY;
    268 
    269 typedef struct _DATA_HEADER {
    270   DWORD  dwSignature;
    271   WORD  wSize;
    272   WORD  wDataID;
    273   DWORD  dwDataSize;
    274   DWORD  dwReserved;
    275 } DATA_HEADER, *PDATA_HEADER;
    276 
    277 typedef struct _OEMFONTINSTPARAM {
    278   DWORD  cbSize;
    279   HANDLE  hPrinter;
    280   HANDLE  hModule;
    281   HANDLE  hHeap;
    282   DWORD  dwFlags;
    283   PWSTR  pFontInstallerName;
    284 } OEMFONTINSTPARAM, *POEMFONTINSTPARAM;
    285 
    286 #endif /* __PRNTFONT_H */
    287