1 #ifndef _EVAS_FONT_PRIVATE_H
2 # define _EVAS_FONT_PRIVATE_H
3 #include "evas_font_ot.h"
6 extern LK(lock_font_draw); // for freetype2 API calls
7 extern LK(lock_bidi); // for fribidi API calls
8 extern LK(lock_ot); // for harfbuzz calls
9 # define FTLOCK() LKL(lock_font_draw)
10 # define FTUNLOCK() LKU(lock_font_draw)
12 # define BIDILOCK() LKL(lock_bidi)
13 # define BIDIUNLOCK() LKU(lock_bidi)
15 /* Macros for text walking */
16 # define OTLOCK() LKL(lock_ot)
17 # define OTUNLOCK() LKU(lock_ot)
25 /* Macros for text walking */
30 void evas_common_font_source_unload(RGBA_Font_Source *fs);
31 void evas_common_font_source_reload(RGBA_Font_Source *fs);
33 void evas_common_font_int_promote(RGBA_Font_Int *fi);
34 void evas_common_font_int_use_increase(int size);
35 void evas_common_font_int_use_trim(void);
36 void evas_common_font_int_unload(RGBA_Font_Int *fi);
37 void evas_common_font_int_reload(RGBA_Font_Int *fi);
39 /* 6th bit is on is the same as frac part >= 0.5 */
40 # define EVAS_FONT_ROUND_26_6_TO_INT(x) \
41 (((x + 0x20) & -0x40) >> 6)
43 # define EVAS_FONT_CHARACTER_IS_INVISIBLE(x) ( \
44 ((0x200C <= (x)) && ((x) <= 0x200D)) || /* ZWNJ..ZWH */ \
45 ((0x200E <= (x)) && ((x) <= 0x200F)) || /* BIDI stuff */ \
46 ((0x202A <= (x)) && ((x) <= 0x202E)) /* BIDI stuff */ \
50 // do proper round (up or down like 1.4 -> 1 and 1.6 -> 2 etc
51 # define FONT_METRIC_CONV(val, dv, scale) \
52 (((long long)((val) * (scale)) + (long long)((dv) * (dv) / 2LL)) \
53 / (long long)((dv) * (dv)))
54 # define FONT_METRIC_ROUNDUP(val) \
57 // truncate/round down
58 # define FONT_METRIC_CONV(val, dv, scale) \
59 (((val) * (scale)) / ((dv) * (dv)))
60 # define FONT_METRIC_ROUNDUP(val) \
64 # include "evas_font_default_walk.x"
65 #endif /* !_EVAS_FONT_PRIVATE_H */