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
|
/*
* "$Id: pstext.h 9042 2010-03-24 00:45:34Z mike $"
*
* Common PostScript text definitions for CUPS.
*
* Copyright 2008-2010 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
* Include necessary headers...
*/
#include "common.h"
#include <cups/transcode.h>
/*
* Constants...
*/
#define PS_NORMAL 0 /* Normal text */
#define PS_BOLD 1 /* Bold text */
#define PS_ITALIC 2 /* Italic text */
#define PS_BOLDITALIC 3 /* Bold italic text */
#define PS_LEFT 1 /* Left-justified text */
#define PS_CENTER 0 /* Center-justified text */
#define PS_RIGHT -1 /* Right-justified text */
/*
* Structures...
*/
typedef struct ps_text_s /**** PostScript font data ****/
{
char *glyphs[65536]; /* PostScript glyphs for Unicode */
int num_fonts; /* Number of fonts to use */
char *fonts[256][4]; /* Fonts to use */
cups_array_t *unique; /* Unique fonts */
unsigned short chars[65536], /* 0xffcc (ff = font, cc = char) */
codes[65536]; /* Unicode glyph mapping to fonts */
int widths[256], /* Widths of each font */
directions[256];/* Text directions for each font */
float size; /* Current text size */
int style; /* Current text style */
} ps_text_t;
/*
* Functions...
*/
extern void psTextEmbedFonts(ps_text_t *fonts);
extern void psTextListFonts(ps_text_t *fonts);
extern ps_text_t *psTextInitialize(void);
extern void psTextUTF8(ps_text_t *fonts, float size, int style,
int align, const char *text);
extern void psTextUTF32(ps_text_t *fonts, float size, int style,
int align, const cups_utf32_t *text,
int textlen);
/*
* End of "$Id: pstext.h 9042 2010-03-24 00:45:34Z mike $".
*/
|