1 /*
2  Copyright (C) 2016-2017 Alexander Borisov
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 
18  Author: lex.borisov@gmail.com (Alexander Borisov)
19 */
20 
21 #ifndef MyFONT_HEAD_H
22 #define MyFONT_HEAD_H
23 #pragma once
24 
25 #include "myfont/myosi.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 struct myfont_table_head {
32     uint32_t version;
33     uint32_t fontRevision;
34     uint32_t checkSumAdjustment;
35     uint32_t magicNumber;
36     uint16_t flags;
37     uint16_t unitsPerEm;
38     uint32_t created[2];  // 64bit
39     uint32_t modified[2]; // 64bit
40     int16_t  xMin;
41     int16_t  yMin;
42     int16_t  xMax;
43     int16_t  yMax;
44     uint16_t macStyle;
45     uint16_t lowestRecPPEM;
46     int16_t  fontDirectionHint;
47     int16_t  indexToLocFormat;
48     int16_t  glyphDataFormat;
49 }
50 typedef myfont_table_head_t;
51 
52 #include "myfont/myfont.h"
53 
54 struct myfont_font;
55 
56 mystatus_t myfont_load_table_head(myfont_font_t *mf, uint8_t* data, size_t data_size);
57 
58 float myfont_head_yMax_pixel(myfont_font_t *mf, float font_size);
59 
60 #ifdef __cplusplus
61 } /* extern "C" */
62 #endif
63 
64 #endif /* MyFONT_HEAD_H */
65