forked from MapServer/MapServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fontcache.h
87 lines (71 loc) · 1.76 KB
/
fontcache.h
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
#include "mapserver.h"
#include "uthash.h"
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
#include FT_OUTLINE_H
#ifdef USE_FRIBIDI
#if (defined(_WIN32) && !defined(__CYGWIN__)) || defined(HAVE_FRIBIDI2)
#include "fribidi.h"
#else
#include <fribidi/fribidi.h>
#endif
#include <hb-ft.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct { /* this one can remain private */
unsigned int unicode;
unsigned int codepoint;
UT_hash_handle hh;
} index_element;
typedef struct {
void *hbparentfont;
void *hbfont;
void *funcs;
int cursize;
} hb_font_element;
typedef struct {
unsigned int codepoint;
unsigned int size;
} glyph_element_key;
struct glyph_element{
glyph_element_key key;
glyph_metrics metrics;
UT_hash_handle hh;
};
typedef struct {
glyph_element *glyph;
} outline_element_key;
typedef struct {
outline_element_key key;
FT_Outline outline;
UT_hash_handle hh;
} outline_element;
typedef struct {
glyph_element *glyph;
} bitmap_element_key;
typedef struct {
bitmap_element_key key;
void *bitmap;
UT_hash_handle hh;
} bitmap_element;
struct face_element{
char *font;
FT_Face face;
index_element *index_cache;
glyph_element *glyph_cache;
outline_element *outline_cache;
hb_font_element *hbfont;
UT_hash_handle hh;
};
face_element* msGetFontFace(char *key, fontSetObj *fontset);
outline_element* msGetGlyphOutline(face_element *face, glyph_element *glyph);
glyph_element* msGetBitmapGlyph(rendererVTableObj *renderer, unsigned int size, unsigned int unicode);
unsigned int msGetGlyphIndex(face_element *face, unsigned int unicode);
glyph_element* msGetGlyphByIndex(face_element *face, unsigned int size, unsigned int codepoint);
int msIsGlyphASpace(glyphObj *glyph);
#ifdef __cplusplus
}
#endif