summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/mfluadir/otfcc/lib/libcff/cff-charset.h
blob: b0a422251c7f8306c742e1988682db6c3673a249 (plain)
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
#ifndef CARYLL_cff_CHARSET_H
#define CARYLL_cff_CHARSET_H

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "support/util.h"
#include "cff-util.h"
#include "cff-value.h"

enum {
	cff_CHARSET_ISOADOBE = 0,
	cff_CHARSET_UNSPECED = 0,
	cff_CHARSET_EXPERT = 1,
	cff_CHARSET_EXPERTSUBSET = 2,
	cff_CHARSET_FORMAT0 = 3,
	cff_CHARSET_FORMAT1 = 4,
	cff_CHARSET_FORMAT2 = 5,
};

// CFF Charset Structures
typedef struct {
	uint8_t format;
	uint16_t *glyph;
} cff_CharsetFormat0;

typedef struct {
	uint16_t first;
	uint8_t nleft;
} cff_CharsetRangeFormat1;

typedef struct {
	uint8_t format;
	cff_CharsetRangeFormat1 *range1;
} cff_CharsetFormat1;

typedef struct {
	uint16_t first;
	uint16_t nleft;
} cff_CharsetRangeFormat2;

typedef struct {
	uint8_t format;
	cff_CharsetRangeFormat2 *range2;
} cff_CharsetFormat2;

typedef struct {
	uint32_t t;
	uint32_t s; // size
	union {
		cff_CharsetFormat0 f0;
		cff_CharsetFormat1 f1;
		cff_CharsetFormat2 f2;
	};
} cff_Charset;

void cff_close_Charset(cff_Charset cset);
void cff_extract_Charset(uint8_t *data, int32_t offset, uint16_t nchars, cff_Charset *charsets);
caryll_Buffer *cff_build_Charset(cff_Charset cset);

#endif