summaryrefslogtreecommitdiffstats
path: root/private/sdktools/fontedit/fontedit.h
blob: f0065875a3257e7aaa1f379416b658d2e06f4458 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
#include <stdlib.h>

#define   WIDER_LEFT 1
#define   WIDER_RIGHT 2
#define   WIDER_BOTH 3
#define   NARROWER_LEFT 4
#define   NARROWER_RIGHT 5
#define   NARROWER_BOTH 6
#define   WIDTH 7
#define   BOX_WIDTH 8

#define   BOX_REFRESH 10                /* Restore char to original form */
#define   BOX_CLEAR 11
#define   BOX_FILL 12
#define   BOX_INV 13
#define   BOX_HATCH 14
#define   BOX_UNDO 15                   /* Undo last change */
#define   BOX_LEFTRIGHT 16              /* Flip left to right */
#define   BOX_TOPBOTTOM 17              /* Flip top over bottom */
#define   BOX_COPY 18
#define   BOX_PASTE 19

#define   ROW_ADD 21
#define   ROW_DEL 22

#define   COL_ADD 31
#define   COL_DEL 32


#define   ID_EDIT 34
#define   ID_PATH 35
#define   ID_LISTBOX 36
#define   ID_FACE_NAME 37
#define   ID_FONT_NAME 38
#define   ID_COPYRIGHT 39

#define   FONT_START 40                 /* Generated if win fontedit arg. */

#define   FONT_LOAD 41                  /* Codes for Font Window */
#define   FONT_SAVE 42
#define   FONT_HEADER 43
#define   FONT_COPY 44
#define   FONT_PASTE 45                 /* Paste in without rescaling */
#define   FONT_ABOUT 46                 /* Display the about box */
#define   FONT_RESIZE 47                /* Go to Resize Dialog Box */
#define   FONT_NEW 95                   /* Menu id: create new font */

#define   FONT_HELP_CONTENTS 50         /* HELP menu constants */
#define   FONT_HELP_SEARCH   51         /* HELP menu constants */


#define   ID_FIRST_CHAR 48              /* First character in the font */
#define   ID_LAST_CHAR 49               /* Last character in the font */

#define   ID_POINTS 50                  /* Nominal Point Size */
#define   ID_VERT_RES 51                /* Nominal Vertical Resolution */
#define   ID_HORIZ_RES 52               /* Nominal Horizontal Resolution */
#define   ID_ASCENT 53                  /* Height of Ascent */
#define   ID_EXT_LEADING 54             /* Height of External Leading */
#define   ID_INT_LEADING 55             /* Height of Internal Leading */

#define   FONT_EXIT 56                  /* exit the font editor */

#define   ID_ITALIC 60                  /* Flag for Italic Fonts */
#define   ID_UNDERLINE 61               /* Flag for Underlined Fonts */
#define   ID_STRIKEOUT 62               /* Flag for Struckout Fonts */
#define   ID_ANSI 63                    /* 0 = ANSI, 255 = other */
#define   ID_OEM 64
#define   ID_CHAR_SET 65
#define   ID_DEFAULT_CHAR 66            /* Default for undefined Chars. */
#define   ID_BREAK_CHAR 67
#define   ID_SYMBOL 68

#define   ID_UNKNOWN 70
#define   ID_ROMAN 71
#define   ID_SWISS 72                   /* Pitch Families */
#define   ID_MODERN 73
#define   ID_SCRIPT 74
#define   ID_DECORATIVE 75

#define   ID_PIX_HEIGHT 80              /* Height of Characters */
#define   ID_WIDTH 81                   /* Fixed or Maximum Width */
#define   ID_WIDTH_TEXT 82              /* Caption for above */
#define   ID_AVERAGE 83                 /* Average Character Width */
#define   ID_FIXED 84                   /* Fixed Width Font */
#define   ID_VARIABLE 85                /* Variable width font */

#define   ID_THIN 86
#define   ID_EXTRALIGHT 87
#define   ID_LIGHT 88
#define   ID_NORMAL 89
#define   ID_MEDIUM 90
#define   ID_SEMIBOLD 91
#define   ID_BOLD 92
#define   ID_EXTRABOLD 93
#define   ID_HEAVY 94
#define   ID_BOXOPEN 96                /* dialog box frame id for File Open */
#define   FONT_SAVEAS 97

#define   ID_FORMAT2 102                /* Windows 2.0 Font Format */
#define   ID_FORMAT3 103                /* Windows 3.0 Font Format */

/* string IDS for strings in resource file - LR */
#define IDS_NOMPTSIZENOTOK          0
#define IDS_NOMVERTRESNOTOK         1
#define IDS_NOMHORRESNOTOK          2
#define IDS_ASCENTTOOBIG            3
#define IDS_ASCENTNOTOK             4
#define IDS_EXTLEADNOTOK            5
#define IDS_INTLEADTOOBIG           6
#define IDS_INTLEADNOTOK            7
#define IDS_CHARSETOUTOFBOUNDS      8
#define IDS_DEFCHAROUTSIDEFONT      9
#define IDS_DEFCHARNOTOK           10
#define IDS_BREAKCHAROUTSIDEFONT   11
#define IDS_BREAKCHARNOTOK         12
#define IDS_UNKNOWNFACE            13
#define IDS_NOVARTOFIXCHANGE       14
#define IDS_TOOBIGFOR20            15
#define IDS_HEIGHTOUTOFBOUNDS      16
#define IDS_WIDTHOUTOFBOUNDS       17
#define IDS_CHAR1MORETHANDCHAR     18
#define IDS_CHAR1NOTOK             19
#define IDS_LASTCHARTOOSMALL       20
#define IDS_LASTCHARNOTOK          21
#define IDS_CANNOTOPENCLIP         22
#define IDS_COPYINGTOCLIP          23
#define IDS_NOTENOUGHMEM           24
#define IDS_ALLOCATINGSPACE        25
#define IDS_FONTEDIT               26
#define IDS_FONTSHOW               27
#define IDS_DOTFNT                 28
#define IDS_BLANKDASHBLANK         29
#define IDS_ERROROPENINGFILE       30
#define IDS_ERRORREADINGHDR        31
#define IDS_UNKNOWNFORMAT          32
#define IDS_ERRORREADINGBODY       33
#define IDS_FILETOOLARGE           34
#define IDS_ERRORWRITINGHDR        35
#define IDS_ERRORWRITINGOFFSETS    36
#define IDS_ERRORWRITINGBODY       37
#define IDS_STARDOTFNT             38
#define IDS_UNKNOWN                39
#define IDS_MAXWIDTH               40
#define IDS_CHARPIXELWIDTH         41
#define IDS_ABOUT                  42
#define IDS_DHEADER                43
#define IDS_DRESIZE                44
#define IDS_DWIDTH                 45
#define IDS_EDLIMITS0TO64          46
#define IDS_MAXWIDTHINCREASE       47
#define IDS_CANNOTCHANGEWIDTH      48
#define IDS_WARNING                49
#define IDS_INCORRECTPIXWIDTH      50
#define IDS_MAXWIDTHOUTOFBOUNDS    51
#define IDS_AVGWIDTHOUTOFBOUNDS    52
#define IDS_WIDTHBYTESNOTOK        53
#define IDS_BITSOFFSETNOTOK        54
#define IDS_TABLEWIDTHSBAD         55
#define IDS_TABLEOFFSETSBAD        56
#define IDS_COLOR                  57
#define IDS_APPWORKSPACE           58
#define IDS_FILEREADONLY           59

#define     IDS_APPNAME            60
#define     IDS_IFN                61
#define     IDS_FNF                62
#define     IDS_REF                63
#define     IDS_SCC                64
#define     IDS_EOF                65
#define     IDS_ECF                66
#define     IDS_FRO                67
#define     IDS_EXT                68
#define     IDS_EXTDESC            69
#define     IDS_NEW_FONT           70
#define     IDS_ERRORCLIP          71
#define     IDS_CHAR		72
#define     IDS_WIDTH		73
#define     IDS_HEIGHT          74

#define     IDS_HELPFILE        75


#define CSTRINGS                   76   /* total number of strings in
                                           resource file */
#define CCHSTRINGSMAX              4096 /* total length of all strings
                                           loaded must be <= this */
#define CCHCOLORSTRING             15   /* size of App Workspace color inf.
                                           string loaded from win.ini */
#ifdef JAPAN
#define ID_SHIFTJIS                76
#endif

/*****************************************************************************/
/*              Typedef's etc.                                               */
/*****************************************************************************/

// typedef unsigned char CHAR;  /* ... since we use these to index */

/* font file header (Adaptation Guide section 6.4) */
typedef struct {
    WORD        Version;              /* Always 17985 for the Nonce */
    DWORD       Size;                 /* Size of whole file */
    CHAR        Copyright[60];
    WORD        Type;                 /* Raster Font if Type & 1 == 0 */
    WORD        Points;               /* Nominal Point size */
    WORD        VertRes;              /* Nominal Vertical resolution */
    WORD        HorizRes;             /* Nominal Horizontal resolution */
    WORD        Ascent;               /* Height of Ascent */
    WORD        IntLeading;           /* Internal (Microsoft) Leading */
    WORD        ExtLeading;           /* External (Microsoft) Leading */
    BYTE        Italic;               /* Italic font if set */
    BYTE        Underline;            /* Etc. */
    BYTE        StrikeOut;            /* Etc. */
    WORD        Weight;               /* Weight: 200 = regular */
    BYTE        CharSet;              /* ANSI=0. other=255 */
    WORD        PixWidth;             /* Fixed width. 0 ==> Variable */
    WORD        PixHeight;            /* Fixed Height */
    BYTE        Family;               /* Pitch and Family */
    WORD        AvgWidth;             /* Width of character 'X' */
    WORD        MaxWidth;             /* Maximum width */
    BYTE        FirstChar;            /* First character defined in font */
    BYTE        LastChar;             /* Last character defined in font */
    BYTE        DefaultChar;          /* Sub. for out of range chars. */
    BYTE        BreakChar;            /* Word Break Character */
    WORD        WidthBytes;           /* No.Bytes/row of Bitmap */
    DWORD       Device;               /* Pointer to Device Name string */
    DWORD       Face;                   /* Pointer to Face Name String */
    DWORD       BitsPointer;            /* Pointer to Bit Map */
    DWORD       BitsOffset;             /* Offset to Bit Map */
} FontHeaderType;           /* Above pointers all rel. to start of file */


typedef struct {
    WORD        fsVersion;
    DWORD       fsSize;
    CHAR        fsCopyright[60];
    WORD        fsType;               /* Type field for the font              */
    WORD        fsPoints;             /* Point size of font                   */
    WORD        fsVertRes;            /* Vertical digitization                */
    WORD        fsHorizRes;           /* Horizontal digitization              */
    WORD        fsAscent;             /* Baseline offset from char cell top   */
    WORD        fsInternalLeading;    /* Internal leading included in font    */
    WORD        fsExternalLeading;    /* Prefered extra space between lines   */
    BYTE        fsItalic;             /* Flag specifying if italic            */
    BYTE        fsUnderline;          /* Flag specifying if underlined        */
    BYTE        fsStrikeOut;          /* Flag specifying if struck out        */
    WORD        fsWeight;             /* Weight of font                       */
    BYTE        fsCharSet;            /* Character set of font                */
    WORD        fsPixWidth;           /* Width field for the font             */
    WORD        fsPixHeight;          /* Height field for the font            */
    BYTE        fsPitchAndFamily;     /* Flag specifying pitch and family     */
    WORD        fsAvgWidth;           /* Average character width              */
    WORD        fsMaxWidth;           /* Maximum character width              */
    BYTE        fsFirstChar;          /* First character in the font          */
    BYTE        fsLastChar;           /* Last character in the font           */
    BYTE        fsDefaultChar;        /* Default character for out of range   */
    BYTE        fsBreakChar;          /* Character to define wordbreaks       */
    WORD        fsWidthBytes;         /* Number of bytes in each row          */
    DWORD       fsDevice;             /* Offset to device name                */
    DWORD       fsFace;               /* Offset to face name                  */
    DWORD       fsBitsPointer;        /* Bits pointer                         */
    DWORD       fsBitsOffset;         /* Offset to the begining of the bitmap */
	BYTE		fsDBfiller;			  /* Word alignment for the offset table  */

    DWORD       fsFlags;              /* Bit flags                            */
    WORD        fsAspace;             /* Global A space, if any               */
    WORD        fsBspace;             /* Global B space, if any               */
    WORD        fsCspace;             /* Global C space, if any               */
    DWORD       fsColorPointer;       /* offset to color table, if any        */
    DWORD       fsReserved[4];        /*                                      */
    BYTE        fsCharOffset;         /* Area for storing the char. offsets   */

} FontHeader30;

#define   CCHEXTRA             31     /* no. of extra bytes in the 3.0 header */

//
// These are the old glyph info structures.  Since they are not DWORD aligned
// they must be converted to new structure types.
//

typedef struct{
     SHORT GIwidth;
     SHORT GIoffset;
} GLYPHINFO_20;

typedef struct{
     SHORT GIwidth;
     LONG GIoffset;
} GLYPHINFO_30;

#define ClipBoard TRUE

LONG  APIENTRY FontEditWndProc(HWND, WORD, WPARAM, LONG);
LONG  APIENTRY FontShowWndProc(HWND, WORD, WPARAM, LONG);
BOOL  APIENTRY
HeaderProc(
	HWND   hDial,
	WORD   message,
	WPARAM wParam,
	LONG   lParam
	);
BOOL APIENTRY
ReSizeProc(
	HWND   hDial,
	WORD   message,
	WPARAM wParam,
	LONG   lParam
	);
BOOL  APIENTRY
WidthProc(
	HWND   hDial,
	WORD   message,
	WPARAM wParam,
	LONG   lParam
	);

CHAR * FontLoad(CHAR *, OFSTRUCT *);
CHAR * FontSave(CHAR *, OFSTRUCT *);
BOOL ResizeBody();              /* Change Height of Font. MAde return type BOOL istead of VOID - LR */
BOOL ResizeWidths();            /* Change Widths (Fixed Width Fonts).MAde return type BOOL istead of VOID - LR  */
BOOL SpreadWidths(DWORD);            /* Change Widths (Var. Width Fonts). MAde return type BOOL istead of VOID - LR  */
VOID DeleteBitmap();
VOID ExciseChars();             /* Delete part of a font */
BOOL
CharWidth(
    BYTE iChar,                             /* Character to change */
    DWORD wBox                               /* New width */
    );
BOOL NewLastChar(DWORD);             /* MAde return type BOOL istead of VOID - LR */
BOOL NewFirstChar(DWORD);            /* MAde return type BOOL istead of VOID - LR */
#define kBoxLim 65  /* was 49 */

#define wBoxLim 65
#define szNamesMax 32
#define BLACK (LONG)0
#define WHITE (LONG)0x00FFFFFF          /* For SetPixel rgbColor */
#define FILENAMEMAX MAX_PATH          /* Maximum allowed length of file names */


/*********
 the following added 11-Sep-1986 to use dlgsave.c and dlgopen.c
**********/
#define   IDD_OPEN 1    /* dialog box ids */
#define   IDD_SAVE 2
#define   IDD_FORMAT 3

#define     MAX_STR_LEN     128
#define     MAX_FNAME_LEN   128
#define     CBEXTMAX        6   /* Number of bytes in "\*.ext" */


#define NOSAVE  0   /* return flags for DlgFnSave() */
#define NEWSAVE 1
#define OLDSAVE 2

#define NOOPEN  0   /* return flags for DlgFnOpen() */
#define NEWOPEN 1
#define OLDOPEN 2

#define WORD_LIMIT    65534    /* max. number of bytes that can be
                                  read(written) by M_lread(HFILE_lwrite, , WPARAM*/
#define SEGMENT_SIZE  65536    /* segment length in bytes */

/* abbreviations for accessing resource strings - LR */

#define vszNomPtSizeNotOk       vrgsz[IDS_NOMPTSIZENOTOK      ]
#define vszNomVertResNotOk      vrgsz[IDS_NOMVERTRESNOTOK     ]
#define vszNomHorResNotOk       vrgsz[IDS_NOMHORRESNOTOK      ]
#define vszAscentTooBig         vrgsz[IDS_ASCENTTOOBIG        ]
#define vszAscentNotOk          vrgsz[IDS_ASCENTNOTOK         ]
#define vszExtLeadNotOk         vrgsz[IDS_EXTLEADNOTOK        ]
#define vszIntLeadTooBig        vrgsz[IDS_INTLEADTOOBIG       ]
#define vszIntLeadNotOk         vrgsz[IDS_INTLEADNOTOK        ]
#define vszCharSetOutOfBounds   vrgsz[IDS_CHARSETOUTOFBOUNDS  ]
#define vszDefCharOutsideFont   vrgsz[IDS_DEFCHAROUTSIDEFONT  ]
#define vszDefCharNotOk         vrgsz[IDS_DEFCHARNOTOK        ]
#define vszBreakCharOutsideFont vrgsz[IDS_BREAKCHAROUTSIDEFONT]
#define vszBreakCharNotOk       vrgsz[IDS_BREAKCHARNOTOK      ]
#define vszUnknownFace          vrgsz[IDS_UNKNOWNFACE         ]
#define vszNoVarToFixChange     vrgsz[IDS_NOVARTOFIXCHANGE    ]
#define vszTooBigFor20          vrgsz[IDS_TOOBIGFOR20         ]
#define vszHeightOutOfBounds    vrgsz[IDS_HEIGHTOUTOFBOUNDS   ]
#define vszWidthOutOfBounds     vrgsz[IDS_WIDTHOUTOFBOUNDS    ]
#define vszChar1MoreThanDChar   vrgsz[IDS_CHAR1MORETHANDCHAR  ]
#define vszChar1NotOk           vrgsz[IDS_CHAR1NOTOK          ]
#define vszLastCharTooSmall     vrgsz[IDS_LASTCHARTOOSMALL    ]
#define vszLastCharNotOk        vrgsz[IDS_LASTCHARNOTOK       ]
#define vszCannotOpenClip       vrgsz[IDS_CANNOTOPENCLIP      ]
#define vszCopyingToClip        vrgsz[IDS_COPYINGTOCLIP       ]
#define vszNotEnoughMem         vrgsz[IDS_NOTENOUGHMEM        ]
#define vszAllocatingSpace      vrgsz[IDS_ALLOCATINGSPACE     ]
#define vszFontEdit             vrgsz[IDS_FONTEDIT            ]
#define vszFontShow             vrgsz[IDS_FONTSHOW            ]
#define vszDotFNT               vrgsz[IDS_DOTFNT              ]
#define vszBlankDashBlank       vrgsz[IDS_BLANKDASHBLANK      ]
#define vszErrorOpeningFile     vrgsz[IDS_ERROROPENINGFILE    ]
#define vszErrorReadingHdr      vrgsz[IDS_ERRORREADINGHDR     ]
#define vszUnknownFormat        vrgsz[IDS_UNKNOWNFORMAT       ]
#define vszErrorReadingBody     vrgsz[IDS_ERRORREADINGBODY    ]
#define vszFileTooLarge         vrgsz[IDS_FILETOOLARGE        ]
#define vszErrorWritingHdr      vrgsz[IDS_ERRORWRITINGHDR     ]
#define vszErrorWritingOffsets  vrgsz[IDS_ERRORWRITINGOFFSETS ]
#define vszErrorWritingBody     vrgsz[IDS_ERRORWRITINGBODY    ]
#define vszStarDotFNT           vrgsz[IDS_STARDOTFNT          ]
#define vszUnknown              vrgsz[IDS_UNKNOWN             ]
#define vszMaxWidth             vrgsz[IDS_MAXWIDTH            ]
#define vszCharPixelWidth       vrgsz[IDS_CHARPIXELWIDTH      ]
#define vszABOUT                vrgsz[IDS_ABOUT               ]
#define vszDHeader              vrgsz[IDS_DHEADER             ]
#define vszDResize              vrgsz[IDS_DRESIZE             ]
#define vszDWidth               vrgsz[IDS_DWIDTH              ]
#define vszEdLimits0To64        vrgsz[IDS_EDLIMITS0TO64       ]
#define vszMaxWidthIncrease     vrgsz[IDS_MAXWIDTHINCREASE    ]
#define vszCannotChangeWidth    vrgsz[IDS_CANNOTCHANGEWIDTH   ]
#define vszWarning              vrgsz[IDS_WARNING             ]
#define vszIncorrectPixWidth    vrgsz[IDS_INCORRECTPIXWIDTH   ]
#define vszMaxWidthOutOfBounds  vrgsz[IDS_MAXWIDTHOUTOFBOUNDS ]
#define vszAvgWidthOutOfBounds  vrgsz[IDS_AVGWIDTHOUTOFBOUNDS ]
#define vszWidthBytesNotOk      vrgsz[IDS_WIDTHBYTESNOTOK     ]
#define vszBitsOffsetNotOk      vrgsz[IDS_BITSOFFSETNOTOK     ]
#define vszTableWidthsBad       vrgsz[IDS_TABLEWIDTHSBAD      ]
#define vszTableOffsetsBad      vrgsz[IDS_TABLEOFFSETSBAD     ]
#define vszcolors               vrgsz[IDS_COLOR               ]
#define vszAppWorkspace         vrgsz[IDS_APPWORKSPACE        ]
#define vszFileReadOnly         vrgsz[IDS_FILEREADONLY        ]
#define vszErrorClip            vrgsz[IDS_ERRORCLIP           ]
#define vszCHAR			vrgsz[IDS_CHAR			]
#define vszWIDTH		vrgsz[IDS_WIDTH			]
#define vszHEIGHT		vrgsz[IDS_HEIGHT		]


/*------ fontedit.c -------*/
extern VOID ResizeShow(VOID);
extern VOID ScrollFont(VOID);
extern VOID CharToBox(BYTE);
extern VOID FontRename(CHAR *);
extern VOID BoxToChar(BYTE);
extern DWORD GetkStuff(VOID);

/*------ fontload.c -------*/
extern VOID ToClipboard(BYTE, DWORD, DWORD);
extern VOID BoxToClipboard(POINT, DWORD, DWORD);
extern DWORD ClipboardToBox(POINT, DWORD, DWORD, BOOL);

/*------ fontdlg.c -------*/
BOOL
CommDlgOpen (
	HWND   hWndParent,      /* window handle of parent window */
	OFSTRUCT *pOfstrIn,     /* ptr to current file OFSTRUCT (->cBytes=0 if no
							 * cur. file)*/
	CHAR  *pszNewNameIn,    /* ptr to array which will get new file's name */
	CHAR  *pszExtIn,        /* ptr to current default extension */
	CHAR  *pszAppNameIn,    /* ptr to application name */
	BOOL   fOpenType
	);

BOOL
CommDlgSaveAs(
	HANDLE hInstance,
	HWND   hWndParent,      /* window handle of parent window */
	OFSTRUCT *pOfstrIn,     /* ptr to current file OFSTRUCT (->cBytes=0 if no
							 * cur. file)*/
	CHAR  *pszNewNameIn,    /* ptr to array which will get new file's name
							 * (no path) */
	CHAR  *pszExtIn,        /* ptr to current default extension */
	CHAR  *pszAppNameIn     /* ptr to application name */
	);

BOOL
DlgMergeStrings(
	CHAR   *szSrc,
	CHAR   *szMerge,
	CHAR   *szDst
	);

/*------ fonthead.c -------*/
extern VOID ErrorBox(HWND, CHAR *);

/*------ fontchar.c -------*/
extern VOID ClearBox(VOID);

/*------ fontcvt.c --------*/

BOOL
fConvStructInit ();

VOID
vFontStructFromBuffer (
             PBYTE           pjSourceBuff,
            FontHeaderType  *pfhDestFHStruct
        );

VOID
vBufferFromFontStruct (
             FontHeaderType  *pfhSourceFHStruct,
            PBYTE           pjDestBuff
        );

VOID
vBufferFromFont30Struct (
             FontHeader30    *pfh3SourceFH3Struct,
            PBYTE           pjDestBuff
        );

VOID
vGlyphInfo20FromBuffer (
             PBYTE           pjSourceBuff,
            GLYPHINFO_20   *pgi2DestGI2Struct
        );

VOID
vGlyphInfo30FromBuffer (
             PBYTE           pjSourceBuff,
            GLYPHINFO_30   *pgi3DestGI3Struct
        );

VOID
vBufferFromGlyphInfo20 (
             GLYPHINFO_20    *pgi2SrcGI2Struct,
            PBYTE           pjDestBuff
        );

VOID
vBufferFromGlyphInfo30 (
             GLYPHINFO_30    *pgi3SrcGI3Struct,
            PBYTE           pjDestBuff
        );

#ifdef JAPAN
// dword alligned size of DIB scan in bytes

#define CJ_DIB_SCAN(cx)  ((((cx) + 31) & ~31) >> 3)

#else /* not JAPAN */

#define CJ_DIB_SCAN(cx)  ((cx + 15) >> 4 << 1)

#endif