forked from enlightenment/efl
Evas font engine: Fixed a couple of issues:
1. Fixed double-kerning with the DEFAULT walker. 2. Removed unused var with the OT walker. 3. Fixed a bit of the documentation in the walkers. SVN revision: 56459
This commit is contained in:
parent
3b88692aa7
commit
34426d8c6e
|
@ -5,9 +5,9 @@
|
||||||
/**
|
/**
|
||||||
* @def EVAS_FONT_UPDATE_KERN()
|
* @def EVAS_FONT_UPDATE_KERN()
|
||||||
* @internal
|
* @internal
|
||||||
* This macro updates pen_x and kern according to kerning.
|
* This macro updates kern according to kerning.
|
||||||
* This macro assumes the following variables exist:
|
* This macro assumes the following variables exist:
|
||||||
* intl_props, char_index, adv, fi, kern, pen_x
|
* intl_props, char_index, fi, kern, index, prev_index
|
||||||
*/
|
*/
|
||||||
#ifdef BIDI_SUPPORT
|
#ifdef BIDI_SUPPORT
|
||||||
#define EVAS_FONT_UPDATE_KERN(is_visual) \
|
#define EVAS_FONT_UPDATE_KERN(is_visual) \
|
||||||
|
@ -20,13 +20,13 @@
|
||||||
if (intl_props && (intl_props->bidi.dir == EVAS_BIDI_DIRECTION_RTL) && \
|
if (intl_props && (intl_props->bidi.dir == EVAS_BIDI_DIRECTION_RTL) && \
|
||||||
visible && !is_visual) \
|
visible && !is_visual) \
|
||||||
{ \
|
{ \
|
||||||
if (evas_common_font_query_kerning(fi, index, prev_index, &kern)) \
|
if (!evas_common_font_query_kerning(fi, index, prev_index, &kern)) \
|
||||||
pen_x += kern; \
|
kern = 0; \
|
||||||
} \
|
} \
|
||||||
else \
|
else \
|
||||||
{ \
|
{ \
|
||||||
if (evas_common_font_query_kerning(fi, prev_index, index, &kern)) \
|
if (!evas_common_font_query_kerning(fi, prev_index, index, &kern)) \
|
||||||
pen_x += kern; \
|
kern = 0; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
while (0)
|
while (0)
|
||||||
|
@ -35,8 +35,8 @@
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
(void) is_visual; \
|
(void) is_visual; \
|
||||||
if (evas_common_font_query_kerning(fi, prev_index, index, &kern)) \
|
if (!evas_common_font_query_kerning(fi, prev_index, index, &kern)) \
|
||||||
pen_x += kern; \
|
kern = 0; \
|
||||||
} \
|
} \
|
||||||
while (0)
|
while (0)
|
||||||
#endif
|
#endif
|
||||||
|
@ -44,19 +44,14 @@
|
||||||
/**
|
/**
|
||||||
* @def EVAS_FONT_WALK_DEFAULT_TEXT_VISUAL_START
|
* @def EVAS_FONT_WALK_DEFAULT_TEXT_VISUAL_START
|
||||||
* @internal
|
* @internal
|
||||||
* This runs through the variable text while updating char_index,
|
* This runs through the text in visual order while updating char_index,
|
||||||
* which is the current index in the text. This macro exposes (inside
|
* which is the current index in the text.
|
||||||
* the loop) the following vars:
|
|
||||||
* adv - advancement
|
|
||||||
* _gl - the current unicode code point
|
|
||||||
* bear_x, bear_y, width - info about the bitmap
|
|
||||||
* pen_x, pen_y - (also available outside of the loop, but updated here)
|
|
||||||
* fg - the font glyph.
|
|
||||||
* index, prev_index - font indexes.
|
|
||||||
* Does not end with a ;
|
* Does not end with a ;
|
||||||
|
* Take a look at EVAS_FONT_WALK_DEFAULT_X_OFF and the like.
|
||||||
* @see EVAS_FONT_WALK_DEFAULT_TEXT_INIT
|
* @see EVAS_FONT_WALK_DEFAULT_TEXT_INIT
|
||||||
* @see EVAS_FONT_WALK_DEFAULT_TEXT_WORK
|
* @see EVAS_FONT_WALK_DEFAULT_TEXT_WORK
|
||||||
* @see EVAS_FONT_WALK_DEFAULT_TEXT_END
|
* @see EVAS_FONT_WALK_DEFAULT_TEXT_END
|
||||||
|
* @see EVAS_FONT_WALK_DEFAULT_TEXT_LOGICAL_START
|
||||||
*/
|
*/
|
||||||
#define EVAS_FONT_WALK_DEFAULT_TEXT_VISUAL_START() \
|
#define EVAS_FONT_WALK_DEFAULT_TEXT_VISUAL_START() \
|
||||||
do \
|
do \
|
||||||
|
@ -87,23 +82,18 @@
|
||||||
int _gl, kern; \
|
int _gl, kern; \
|
||||||
_gl = *text; \
|
_gl = *text; \
|
||||||
if (_gl == 0) break;
|
if (_gl == 0) break;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @def EVAS_FONT_WALK_DEFAULT_TEXT_LOGICAL_START
|
* @def EVAS_FONT_WALK_DEFAULT_TEXT_LOGICAL_START
|
||||||
* @internal
|
* @internal
|
||||||
* FIXME: update
|
* This runs through the text in logical order while updating char_index,
|
||||||
* This runs through the variable text while updating char_index,
|
* which is the current index in the text.
|
||||||
* which is the current index in the text. This macro exposes (inside
|
|
||||||
* the loop) the following vars:
|
|
||||||
* adv - advancement
|
|
||||||
* _gl - the current unicode code point
|
|
||||||
* bear_x, bear_y, width - info about the bitmap
|
|
||||||
* pen_x, pen_y - (also available outside of the loop, but updated here)
|
|
||||||
* fg - the font glyph.
|
|
||||||
* index, prev_index - font indexes.
|
|
||||||
* Does not end with a ;
|
* Does not end with a ;
|
||||||
|
* Take a look at EVAS_FONT_WALK_DEFAULT_X_OFF and the like.
|
||||||
* @see EVAS_FONT_WALK_DEFAULT_TEXT_INIT
|
* @see EVAS_FONT_WALK_DEFAULT_TEXT_INIT
|
||||||
* @see EVAS_FONT_WALK_DEFAULT_TEXT_WORK
|
* @see EVAS_FONT_WALK_DEFAULT_TEXT_WORK
|
||||||
* @see EVAS_FONT_WALK_DEFAULT_TEXT_END
|
* @see EVAS_FONT_WALK_DEFAULT_TEXT_END
|
||||||
|
* @see EVAS_FONT_WALK_DEFAULT_TEXT_VISUAL_START
|
||||||
*/
|
*/
|
||||||
#define EVAS_FONT_WALK_DEFAULT_TEXT_LOGICAL_START() \
|
#define EVAS_FONT_WALK_DEFAULT_TEXT_LOGICAL_START() \
|
||||||
do \
|
do \
|
||||||
|
|
|
@ -8,19 +8,14 @@
|
||||||
/**
|
/**
|
||||||
* @def EVAS_FONT_WALK_OT_TEXT_VISUAL_START
|
* @def EVAS_FONT_WALK_OT_TEXT_VISUAL_START
|
||||||
* @internal
|
* @internal
|
||||||
* This runs through the variable text while updating char_index,
|
* This runs through the text in visual order while updating char_index,
|
||||||
* which is the current index in the text. This macro exposes (inside
|
* which is the current index in the text.
|
||||||
* the loop) the following vars:
|
|
||||||
* adv - advancement
|
|
||||||
* gl - the current unicode code point
|
|
||||||
* bear_x, bear_y, width - info about the bitmap
|
|
||||||
* pen_x, pen_y - (also available outside of the loop, but updated here)
|
|
||||||
* fg - the font glyph.
|
|
||||||
* index, prev_index - font indexes.
|
|
||||||
* Does not end with a ;
|
* Does not end with a ;
|
||||||
|
* Take a look at EVAS_FONT_WALK_OT_X_OFF and the like.
|
||||||
* @see EVAS_FONT_WALK_OT_TEXT_INIT
|
* @see EVAS_FONT_WALK_OT_TEXT_INIT
|
||||||
* @see EVAS_FONT_WALK_OT_TEXT_WORK
|
* @see EVAS_FONT_WALK_OT_TEXT_WORK
|
||||||
* @see EVAS_FONT_WALK_OT_TEXT_END
|
* @see EVAS_FONT_WALK_OT_TEXT_END
|
||||||
|
* @see EVAS_FONT_WALK_OT_TEXT_LOGICAL_START
|
||||||
*/
|
*/
|
||||||
#define EVAS_FONT_WALK_OT_TEXT_VISUAL_START() \
|
#define EVAS_FONT_WALK_OT_TEXT_VISUAL_START() \
|
||||||
do \
|
do \
|
||||||
|
@ -34,24 +29,18 @@
|
||||||
{ \
|
{ \
|
||||||
FT_UInt index; \
|
FT_UInt index; \
|
||||||
RGBA_Font_Glyph *fg; \
|
RGBA_Font_Glyph *fg; \
|
||||||
int kern; \
|
|
||||||
/**
|
/**
|
||||||
* @def EVAS_FONT_WALK_OT_TEXT_LOGICAL_START
|
* @def EVAS_FONT_WALK_OT_TEXT_LOGICAL_START
|
||||||
* @internal
|
* @internal
|
||||||
* FIXME: not up to date
|
* This runs through the text in logical order while updating char_index,
|
||||||
* This runs through the variable text while updating char_index,
|
* which is the current index in the text.
|
||||||
* which is the current index in the text. This macro exposes (inside
|
|
||||||
* the loop) the following vars:
|
|
||||||
* adv - advancement
|
|
||||||
* gl - the current unicode code point
|
|
||||||
* bear_x, bear_y, width - info about the bitmap
|
|
||||||
* pen_x, pen_y - (also available outside of the loop, but updated here)
|
|
||||||
* fg - the font glyph.
|
|
||||||
* index, prev_index - font indexes.
|
|
||||||
* Does not end with a ;
|
* Does not end with a ;
|
||||||
|
* Take a look at EVAS_FONT_WALK_OT_X_OFF and the like.
|
||||||
* @see EVAS_FONT_WALK_OT_TEXT_INIT
|
* @see EVAS_FONT_WALK_OT_TEXT_INIT
|
||||||
* @see EVAS_FONT_WALK_OT_TEXT_WORK
|
* @see EVAS_FONT_WALK_OT_TEXT_WORK
|
||||||
* @see EVAS_FONT_WALK_OT_TEXT_END
|
* @see EVAS_FONT_WALK_OT_TEXT_END
|
||||||
|
* @see EVAS_FONT_WALK_OT_TEXT_VISUAL_START
|
||||||
*/
|
*/
|
||||||
#define EVAS_FONT_WALK_OT_TEXT_LOGICAL_START() \
|
#define EVAS_FONT_WALK_OT_TEXT_LOGICAL_START() \
|
||||||
do \
|
do \
|
||||||
|
@ -77,7 +66,6 @@
|
||||||
{ \
|
{ \
|
||||||
FT_UInt index; \
|
FT_UInt index; \
|
||||||
RGBA_Font_Glyph *fg; \
|
RGBA_Font_Glyph *fg; \
|
||||||
int kern; \
|
|
||||||
|
|
||||||
/*FIXME: doc */
|
/*FIXME: doc */
|
||||||
#define EVAS_FONT_WALK_OT_X_OFF \
|
#define EVAS_FONT_WALK_OT_X_OFF \
|
||||||
|
@ -130,7 +118,6 @@
|
||||||
LKU(fi->ft_mutex); \
|
LKU(fi->ft_mutex); \
|
||||||
continue; \
|
continue; \
|
||||||
} \
|
} \
|
||||||
kern = 0; \
|
|
||||||
if (EVAS_FONT_CHARACTER_IS_INVISIBLE(text[EVAS_FONT_WALK_OT_POS])) \
|
if (EVAS_FONT_CHARACTER_IS_INVISIBLE(text[EVAS_FONT_WALK_OT_POS])) \
|
||||||
{ \
|
{ \
|
||||||
visible = 0; \
|
visible = 0; \
|
||||||
|
|
Loading…
Reference in New Issue