XenevaOS
Loading...
Searching...
No Matches
ttf.h
Go to the documentation of this file.
1
30#ifndef __TTF_H__
31#define __TTF_H__
32
33#include <stdint.h>
34#include <_xeneva.h>
35#include "font.h"
36#include "chitralekha.h"
37
38/* ttf table tags */
39#define TTF_TABLE_CMAP 'cmap' //character to glyph mapping
40#define TTF_TABLE_GLYF 'glyf' //glyph data
41#define TTF_TABLE_HEAD 'head' //font header
42#define TTF_TABLE_HHEA 'hhea' //horizontal header
43#define TTF_TABLE_HMTX 'hmtx' //horizontal metrics
44#define TTF_TABLE_LOCA 'loca' //index to location
45#define TTF_TABLE_MAXP 'maxp' //maximum profile
46#define TTF_TABLE_NAME 'name' //naming
47#define TTF_TABLE_POST 'post' //PostScript
48
49/* true type --data type definitions*/
51typedef int32_t Fixed;
52typedef int16_t FWord;
56
57#pragma pack(push,1)
58typedef struct _ttftable_ {
59 unsigned char* base;
60 unsigned int len;
62#pragma pack(pop)
63
82#pragma pack(pop)
83
84#pragma pack(push,1)
92#pragma pack(pop)
93
94#pragma pack(push,1)
101#pragma pack(pop)
102
103#pragma pack(push,1)
123#pragma pack(pop)
124
125#pragma pack(push,1)
126/* CMAP Tables */
131#pragma pack(pop)
132
133#pragma pack(push,1)
139#pragma pack(pop)
140
141#pragma pack(push,1)
147#pragma pack(pop)
148
149#pragma pack(push,1)
157#pragma pack(pop)
158
159#pragma pack(push,1)
165#pragma pack(pop)
166
167#pragma pack(push,1)
177#pragma pack(pop)
178
179#pragma pack(push,1)
197
198
206
207#pragma pack(pop)
208
209
210
211/*
212* TTFLoadFont -- load and start decoding ttf font
213* @param buffer -- pointer to font file buffer
214*/
215TTFont* TTFLoadFont(ChCanvas* canv,unsigned char* buffer);
216
217/*
218* TTFSetFontSize -- scale font for output on display device
219* @param font -- Pointer to font object
220* @param pointSz -- size of the point
221*/
222void TTFSetFontSize(TTFont * font, float pointSz);
223#endif
int int32_t
Definition acefiex.h:160
unsigned int uint32_t
Definition acefiex.h:163
short int int16_t
Definition acefiex.h:159
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
unsigned short int uint16_t
Definition acefiex.h:162
Definition chitralekha.h:43
Definition ttf.h:150
uint16_t reserved
Definition ttf.h:152
uint32_t len
Definition ttf.h:153
uint16_t format
Definition ttf.h:151
uint32_t nGroups
Definition ttf.h:155
uint32_t language
Definition ttf.h:154
Definition ttf.h:160
uint32_t endCharCode
Definition ttf.h:162
uint32_t startCharCode
Definition ttf.h:161
uint32_t startGlyphCode
Definition ttf.h:163
Definition ttf.h:168
uint16_t len
Definition ttf.h:170
uint16_t language
Definition ttf.h:171
uint16_t searchRange
Definition ttf.h:173
uint16_t segCountX2
Definition ttf.h:172
uint16_t format
Definition ttf.h:169
uint16_t entrySelector
Definition ttf.h:174
Definition ttf.h:142
uint16_t format
Definition ttf.h:143
uint16_t len
Definition ttf.h:144
uint16_t language
Definition ttf.h:145
Definition ttf.h:199
FWord yMin
Definition ttf.h:202
FWord xMin
Definition ttf.h:201
FWord yMax
Definition ttf.h:204
int16_t numContours
Definition ttf.h:200
FWord xMax
Definition ttf.h:203
Definition ttf.h:104
longDateTime created
Definition ttf.h:111
uint16_t unitsPerEm
Definition ttf.h:110
Fixed fontRevision
Definition ttf.h:106
uint32_t magicNumber
Definition ttf.h:108
int16_t glyphDataFormat
Definition ttf.h:121
int16_t fontDirectionHint
Definition ttf.h:119
uint16_t flags
Definition ttf.h:109
int16_t indexToLocFormat
Definition ttf.h:120
longDateTime modified
Definition ttf.h:112
uint32_t checkSumAdjustment
Definition ttf.h:107
uint16_t macStyle
Definition ttf.h:117
uint16_t lowestRecPPEM
Definition ttf.h:118
FWord xMax
Definition ttf.h:115
FWord yMax
Definition ttf.h:116
Fixed version
Definition ttf.h:105
FWord xMin
Definition ttf.h:113
FWord yMin
Definition ttf.h:114
Definition ttf.h:180
uint16_t maxContours
Definition ttf.h:184
uint16_t maxSizeOfInstructions
Definition ttf.h:193
uint16_t maxComponentElements
Definition ttf.h:194
Fixed version
Definition ttf.h:181
uint16_t maxComponentDepth
Definition ttf.h:195
uint16_t maxStackElements
Definition ttf.h:192
uint16_t maxZones
Definition ttf.h:187
uint16_t numGlyphs
Definition ttf.h:182
uint16_t maxComponentPoints
Definition ttf.h:185
uint16_t maxTwilightPoints
Definition ttf.h:188
uint16_t maxComponentContours
Definition ttf.h:186
uint16_t maxFunctionDefs
Definition ttf.h:190
uint16_t maxStorage
Definition ttf.h:189
uint16_t maxPoints
Definition ttf.h:183
uint16_t maxInstructionDefs
Definition ttf.h:191
Definition ttf.h:85
uint16_t rangeShift
Definition ttf.h:90
uint16_t numTables
Definition ttf.h:87
uint32_t scalerType
Definition ttf.h:86
uint16_t searchRange
Definition ttf.h:88
uint16_t entrySelector
Definition ttf.h:89
Definition ttf.h:95
uint32_t tag
Definition ttf.h:96
uint32_t offset
Definition ttf.h:98
uint32_t length
Definition ttf.h:99
uint32_t checksum
Definition ttf.h:97
Definition ttf.h:64
TTFTable hhea
Definition ttf.h:69
TTFTable cmap
Definition ttf.h:66
TTFTable maxp
Definition ttf.h:72
unsigned char * memptr
Definition ttf.h:78
TTFTable head
Definition ttf.h:68
uint16_t unitsPerEm
Definition ttf.h:75
unsigned char * cmapStart
Definition ttf.h:76
TTFTable loca
Definition ttf.h:71
TTFTable hmtx
Definition ttf.h:70
TTFTable post
Definition ttf.h:74
TTFTable name
Definition ttf.h:73
uint16_t loca_type
Definition ttf.h:77
unsigned char * base
Definition ttf.h:65
ChCanvas * canv
Definition ttf.h:80
float scale
Definition ttf.h:79
TTFTable glyf
Definition ttf.h:67
Definition ttf.h:127
uint16_t version
Definition ttf.h:128
uint16_t numberSubtable
Definition ttf.h:129
Definition ttf.h:134
uint16_t platformID
Definition ttf.h:135
uint32_t offset
Definition ttf.h:137
uint16_t platformSpecificID
Definition ttf.h:136
Definition ttf.h:58
unsigned int len
Definition ttf.h:60
unsigned char * base
Definition ttf.h:59
struct _off_sub_ TTFOffsetSubtable
int16_t FWord
Definition ttf.h:52
struct _cmap_format4_ TTFCmapFormat4
int16_t shortFrac
Definition ttf.h:50
struct _ttf_cmap_ TTFCmap
struct _ttf_ TTFont
struct _head_tbl_ TTFHead
struct _cmap_format12_grp_ TTFCmapFormat12Group
struct _maxp_ TTFMaxp
uint64_t longDateTime
Definition ttf.h:55
void TTFSetFontSize(TTFont *font, float pointSz)
Definition ttf.cpp:123
struct _cmap_format_ TTFCmapFormat
int16_t F2Dot14
Definition ttf.h:54
struct _ttf_cmap_sub_ TTFCmapSubtable
struct _ttftable_ TTFTable
struct _cmap_format12_ TTFCmapFormat12
uint16_t uFWord
Definition ttf.h:53
int32_t Fixed
Definition ttf.h:51
struct _glyph_desc_ TTFGlyphDesc
TTFont * TTFLoadFont(ChCanvas *canv, unsigned char *buffer)
Definition ttf.cpp:315
struct _table_dir_ TTFTableDirectory