include/mscvpdb.h: Use flexible array members for the rest of structures.
[wine.git] / dlls / wineps.drv / font.c
blob671b22bd6d399cae325235d4a6debf68c70969be
1 /*
2 * PostScript driver font functions
4 * Copyright 1998 Huw D M Davies
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include <stdarg.h>
21 #include <string.h>
22 #include <assert.h>
23 #include <stdlib.h>
25 #include "windef.h"
26 #include "winbase.h"
27 #include "wingdi.h"
28 #include "winnls.h"
29 #include "winspool.h"
30 #include "winternl.h"
32 #include "psdrv.h"
33 #include "wine/debug.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
37 /***********************************************************************
38 * SelectFont
40 HFONT PSDRV_SelectFont( print_ctx *ctx, HFONT hfont, UINT *aa_flags )
42 struct font_info font_info;
44 ctx->font.set = UNSET;
46 if (ExtEscape(ctx->hdc, PSDRV_GET_BUILTIN_FONT_INFO, 0, NULL,
47 sizeof(font_info), (char *)&font_info))
49 ctx->font.fontloc = Builtin;
51 else
53 ctx->font.fontloc = Download;
54 ctx->font.fontinfo.Download = NULL;
56 return hfont;
59 /***********************************************************************
60 * PSDRV_SetFont
62 BOOL PSDRV_SetFont( print_ctx *ctx, BOOL vertical )
64 PSDRV_WriteSetColor(ctx, &ctx->font.color);
65 if (vertical && (ctx->font.set == VERTICAL_SET)) return TRUE;
66 if (!vertical && (ctx->font.set == HORIZONTAL_SET)) return TRUE;
68 switch(ctx->font.fontloc) {
69 case Builtin:
70 PSDRV_WriteSetBuiltinFont(ctx);
71 break;
72 case Download:
73 PSDRV_WriteSetDownloadFont(ctx, vertical);
74 break;
75 default:
76 ERR("fontloc = %d\n", ctx->font.fontloc);
77 assert(1);
78 break;
80 if (vertical)
81 ctx->font.set = VERTICAL_SET;
82 else
83 ctx->font.set = HORIZONTAL_SET;
84 return TRUE;