[autofit] Add wrapper function for `FT_Get_Char_Index'.
Yet-to-come changes will provide HarfBuzz functionality for the new function. * src/autofit/hbshim.c (af_get_char_index): New function. * src/autofit/hbshim.h: Updated. * src/autofit/afcjk.c (af_cjk_metrics_init_widths, af_cjk_metrics_init_blues, af_cjk_metrics_check_digits): Updated. * src/autofit/aflatin.c (af_latin_metrics_init_widths, af_latin_metrics_init_blues, af_latin_metrics_check_digits): Updated.
This commit is contained in:
parent
6af01a04b1
commit
17af586e05
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,20 @@
|
||||||
|
2013-12-28 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
[autofit] Add wrapper function for `FT_Get_Char_Index'.
|
||||||
|
|
||||||
|
Yet-to-come changes will provide HarfBuzz functionality for the new
|
||||||
|
function.
|
||||||
|
|
||||||
|
* src/autofit/hbshim.c (af_get_char_index): New function.
|
||||||
|
* src/autofit/hbshim.h: Updated.
|
||||||
|
|
||||||
|
* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
|
||||||
|
af_cjk_metrics_init_blues, af_cjk_metrics_check_digits): Updated.
|
||||||
|
|
||||||
|
* src/autofit/aflatin.c (af_latin_metrics_init_widths,
|
||||||
|
af_latin_metrics_init_blues, af_latin_metrics_check_digits):
|
||||||
|
Updated.
|
||||||
|
|
||||||
2013-12-28 Werner Lemberg <wl@gnu.org>
|
2013-12-28 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
[autofit] Use `global' HarfBuzz font object.
|
[autofit] Use `global' HarfBuzz font object.
|
||||||
|
|
|
@ -101,7 +101,8 @@
|
||||||
[style_class->script];
|
[style_class->script];
|
||||||
|
|
||||||
|
|
||||||
glyph_index = FT_Get_Char_Index( face, script_class->standard_char );
|
glyph_index = af_get_char_index( &metrics->root,
|
||||||
|
script_class->standard_char );
|
||||||
if ( glyph_index == 0 )
|
if ( glyph_index == 0 )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
|
@ -297,7 +298,7 @@
|
||||||
GET_UTF8_CHAR( ch, p );
|
GET_UTF8_CHAR( ch, p );
|
||||||
|
|
||||||
/* load the character in the face -- skip unknown or empty ones */
|
/* load the character in the face -- skip unknown or empty ones */
|
||||||
glyph_index = FT_Get_Char_Index( face, ch );
|
glyph_index = af_get_char_index( &metrics->root, ch );
|
||||||
if ( glyph_index == 0 )
|
if ( glyph_index == 0 )
|
||||||
{
|
{
|
||||||
FT_TRACE5(( " U+%04lX unavailable\n", ch ));
|
FT_TRACE5(( " U+%04lX unavailable\n", ch ));
|
||||||
|
@ -479,7 +480,7 @@
|
||||||
FT_UInt glyph_index;
|
FT_UInt glyph_index;
|
||||||
|
|
||||||
|
|
||||||
glyph_index = FT_Get_Char_Index( face, i );
|
glyph_index = af_get_char_index( &metrics->root, i );
|
||||||
if ( glyph_index == 0 )
|
if ( glyph_index == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,8 @@
|
||||||
[style_class->script];
|
[style_class->script];
|
||||||
|
|
||||||
|
|
||||||
glyph_index = FT_Get_Char_Index( face, script_class->standard_char );
|
glyph_index = af_get_char_index( &metrics->root,
|
||||||
|
script_class->standard_char );
|
||||||
if ( glyph_index == 0 )
|
if ( glyph_index == 0 )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
|
@ -296,7 +297,7 @@
|
||||||
GET_UTF8_CHAR( ch, p );
|
GET_UTF8_CHAR( ch, p );
|
||||||
|
|
||||||
/* load the character in the face -- skip unknown or empty ones */
|
/* load the character in the face -- skip unknown or empty ones */
|
||||||
glyph_index = FT_Get_Char_Index( face, ch );
|
glyph_index = af_get_char_index( &metrics->root, ch );
|
||||||
if ( glyph_index == 0 )
|
if ( glyph_index == 0 )
|
||||||
{
|
{
|
||||||
FT_TRACE5(( " U+%04lX unavailable\n", ch ));
|
FT_TRACE5(( " U+%04lX unavailable\n", ch ));
|
||||||
|
@ -745,7 +746,7 @@
|
||||||
FT_UInt glyph_index;
|
FT_UInt glyph_index;
|
||||||
|
|
||||||
|
|
||||||
glyph_index = FT_Get_Char_Index( face, i );
|
glyph_index = af_get_char_index( &metrics->root, i );
|
||||||
if ( glyph_index == 0 )
|
if ( glyph_index == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -267,6 +267,22 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FT_UInt
|
||||||
|
af_get_char_index( AF_StyleMetrics metrics,
|
||||||
|
FT_ULong charcode )
|
||||||
|
{
|
||||||
|
FT_Face face;
|
||||||
|
|
||||||
|
|
||||||
|
if ( !metrics )
|
||||||
|
return FT_THROW( Invalid_Argument );
|
||||||
|
|
||||||
|
face = metrics->globals->face;
|
||||||
|
|
||||||
|
return FT_Get_Char_Index( face, charcode );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* to be always excluded */
|
/* to be always excluded */
|
||||||
COVERAGE(nalt, 'n', 'a', 'l', 't'); /* Alternate Annotation Forms (?) */
|
COVERAGE(nalt, 'n', 'a', 'l', 't'); /* Alternate Annotation Forms (?) */
|
||||||
|
@ -274,7 +290,27 @@
|
||||||
/* COVERAGE(ruby, 'r', 'u', 'b', 'y') */ /* (only for Japanese) */
|
/* COVERAGE(ruby, 'r', 'u', 'b', 'y') */ /* (only for Japanese) */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* FT_CONFIG_OPTION_USE_HARFBUZZ */
|
|
||||||
|
#else /* !FT_CONFIG_OPTION_USE_HARDBUZZ */
|
||||||
|
|
||||||
|
|
||||||
|
FT_UInt
|
||||||
|
af_get_char_index( AF_StyleMetrics metrics,
|
||||||
|
FT_ULong charcode )
|
||||||
|
{
|
||||||
|
FT_Face face;
|
||||||
|
|
||||||
|
|
||||||
|
if ( !metrics )
|
||||||
|
return FT_THROW( Invalid_Argument );
|
||||||
|
|
||||||
|
face = metrics->globals->face;
|
||||||
|
|
||||||
|
return FT_Get_Char_Index( face, charcode );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ */
|
||||||
|
|
||||||
|
|
||||||
/* END */
|
/* END */
|
||||||
|
|
|
@ -38,12 +38,22 @@ FT_BEGIN_HEADER
|
||||||
AF_StyleClass style_class,
|
AF_StyleClass style_class,
|
||||||
FT_Byte* gstyles );
|
FT_Byte* gstyles );
|
||||||
|
|
||||||
|
FT_UInt
|
||||||
|
af_get_char_index( AF_StyleMetrics metrics,
|
||||||
|
FT_ULong charcode );
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|
||||||
FT_END_HEADER
|
FT_END_HEADER
|
||||||
|
|
||||||
|
|
||||||
#endif /* FT_CONFIG_OPTION_USE_HARFBUZZ */
|
#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ */
|
||||||
|
|
||||||
|
FT_UInt
|
||||||
|
af_get_char_index( AF_StyleMetrics metrics,
|
||||||
|
FT_ULong charcode );
|
||||||
|
|
||||||
|
#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ */
|
||||||
|
|
||||||
#endif /* __HBSHIM_H__ */
|
#endif /* __HBSHIM_H__ */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue