SmartPDF - lightweight pdf viewer app for rosapps
[reactos.git] / rosapps / smartpdf / fitz / include / fitz / wld_text.h
1 /*
2 * Fitz display tree text node.
3 *
4 * The text node is an optimization to reference glyphs in a font resource
5 * and specifying an individual transform matrix for each one.
6 *
7 * The trm field contains the a, b, c and d coefficients.
8 * The e and f coefficients come from the individual elements,
9 * together they form the transform matrix for the glyph.
10 *
11 * Glyphs are referenced by glyph ID.
12 * The Unicode text equivalent is kept in a separate array
13 * with indexes into the glyph array.
14 *
15
16 TODO the unicode textels
17
18 struct fz_textgid_s { float e, f; int gid; };
19 struct fz_textucs_s { int idx; int ucs; };
20
21 */
22
23 typedef struct fz_textel_s fz_textel;
24
25 struct fz_textel_s
26 {
27 float x, y;
28 int cid;
29 };
30
31 struct fz_textnode_s
32 {
33 fz_node super;
34 fz_font *font;
35 fz_matrix trm;
36 int len, cap;
37 fz_textel *els;
38 };
39
40 fz_error *fz_newtextnode(fz_textnode **textp, fz_font *face);
41 fz_error *fz_clonetextnode(fz_textnode **textp, fz_textnode *oldtext);
42 fz_error *fz_addtext(fz_textnode *text, int g, float x, float y);
43 fz_error *fz_endtext(fz_textnode *text);
44