2010-05-21 00:10:45 -07:00
|
|
|
#ifndef _EVAS_FONT_PRIVATE_H
|
2010-05-30 20:31:49 -07:00
|
|
|
# define _EVAS_FONT_PRIVATE_H
|
2011-01-30 02:36:39 -08:00
|
|
|
#include "evas_font_ot.h"
|
2010-05-21 00:10:45 -07:00
|
|
|
|
2010-05-30 20:31:49 -07:00
|
|
|
#ifdef BUILD_PTHREAD
|
|
|
|
extern LK(lock_font_draw); // for freetype2 API calls
|
2010-09-01 06:15:04 -07:00
|
|
|
extern LK(lock_bidi); // for fribidi API calls
|
2011-01-30 02:36:39 -08:00
|
|
|
extern LK(lock_ot); // for harfbuzz calls
|
2010-05-21 00:10:45 -07:00
|
|
|
#endif
|
|
|
|
|
2010-07-20 05:09:46 -07:00
|
|
|
# if defined(EVAS_FRAME_QUEUING) || defined(BUILD_PIPE_RENDER)
|
2010-05-30 20:31:49 -07:00
|
|
|
# define FTLOCK() LKL(lock_font_draw)
|
|
|
|
# define FTUNLOCK() LKU(lock_font_draw)
|
2010-05-21 00:10:45 -07:00
|
|
|
|
2010-09-01 06:15:04 -07:00
|
|
|
# define BIDILOCK() LKL(lock_bidi)
|
|
|
|
# define BIDIUNLOCK() LKU(lock_bidi)
|
2011-01-30 02:36:39 -08:00
|
|
|
|
|
|
|
# define OTLOCK() LKL(lock_ot)
|
|
|
|
# define OTUNLOCK() LKU(lock_ot)
|
2010-05-30 20:31:49 -07:00
|
|
|
# else
|
2011-01-30 02:33:24 -08:00
|
|
|
# define FTLOCK(x)
|
|
|
|
# define FTUNLOCK(x)
|
2010-05-21 00:10:45 -07:00
|
|
|
|
2011-01-30 02:33:24 -08:00
|
|
|
# define BIDILOCK()
|
|
|
|
# define BIDIUNLOCK()
|
2010-05-21 00:10:45 -07:00
|
|
|
|
2010-10-29 05:55:42 -07:00
|
|
|
void evas_common_font_source_unload(RGBA_Font_Source *fs);
|
|
|
|
void evas_common_font_source_reload(RGBA_Font_Source *fs);
|
|
|
|
|
|
|
|
void evas_common_font_int_promote(RGBA_Font_Int *fi);
|
|
|
|
void evas_common_font_int_use_increase(int size);
|
|
|
|
void evas_common_font_int_use_trim(void);
|
|
|
|
void evas_common_font_int_unload(RGBA_Font_Int *fi);
|
|
|
|
void evas_common_font_int_reload(RGBA_Font_Int *fi);
|
2011-01-30 02:33:24 -08:00
|
|
|
/* Macros for text walking */
|
2011-01-30 02:36:39 -08:00
|
|
|
# define OTLOCK()
|
|
|
|
# define OTUNLOCK()
|
|
|
|
# endif
|
2011-01-30 02:33:43 -08:00
|
|
|
|
2011-01-30 02:42:07 -08:00
|
|
|
# define EVAS_FONT_ROUND_26_6_TO_INT(x) \
|
|
|
|
(((0x3F & x) > 31) ? ((x >> 6) + 1) : (x >> 6))
|
|
|
|
|
2011-01-30 02:36:39 -08:00
|
|
|
# define EVAS_FONT_CHARACTER_IS_INVISIBLE(x) ( \
|
2011-01-30 02:33:43 -08:00
|
|
|
((0x200C <= (x)) && ((x) <= 0x200D)) || /* ZWNJ..ZWH */ \
|
|
|
|
((0x200E <= (x)) && ((x) <= 0x200F)) || /* BIDI stuff */ \
|
|
|
|
((0x202A <= (x)) && ((x) <= 0x202E)) /* BIDI stuff */ \
|
|
|
|
)
|
|
|
|
|
2011-01-30 02:36:39 -08:00
|
|
|
# define EVAS_FONT_WALK_ORIG_LEN (_len)
|
|
|
|
|
|
|
|
# ifdef OT_SUPPORT
|
|
|
|
# include "evas_font_ot_walk.x"
|
|
|
|
# endif
|
|
|
|
|
|
|
|
# include "evas_font_default_walk.x"
|
2011-01-30 02:33:24 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @def EVAS_FONT_WALK_TEXT_INIT
|
|
|
|
* @internal
|
|
|
|
* This macro defines the variables that will later be used with the following
|
|
|
|
* macros, and by font handling functions.
|
|
|
|
* @see EVAS_FONT_WALK_TEXT_START
|
|
|
|
* @see EVAS_FONT_WALK_TEXT_WORK
|
|
|
|
* @see EVAS_FONT_WALK_TEXT_END
|
|
|
|
*/
|
2011-01-30 02:36:39 -08:00
|
|
|
# define EVAS_FONT_WALK_TEXT_INIT() \
|
2011-01-30 02:33:24 -08:00
|
|
|
int pen_x = 0, pen_y = 0; \
|
2011-01-30 02:36:39 -08:00
|
|
|
size_t char_index; \
|
2011-01-30 02:33:24 -08:00
|
|
|
FT_UInt prev_index; \
|
|
|
|
FT_Face pface = NULL; \
|
2011-01-30 02:36:39 -08:00
|
|
|
int _len = eina_unicode_strlen(text); \
|
|
|
|
(void) _len; /* We don't have to use it */ \
|
2011-01-30 02:33:24 -08:00
|
|
|
(void) pen_y; /* Sometimes it won't be used */
|
|
|
|
|
2010-05-21 00:10:45 -07:00
|
|
|
#endif /* !_EVAS_FONT_PRIVATE_H */
|