25#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
35#define FT_COMPONENT afshaper
60#define COVERAGE( name, NAME, description, \
61 tag1, tag2, tag3, tag4 ) \
62 static const hb_tag_t name ## _coverage[] = \
64 HB_TAG( tag1, tag2, tag3, tag4 ), \
74#define COVERAGE( name, NAME, description, \
75 tag1, tag2, tag3, tag4 ) \
79 static const hb_tag_t* coverages[] =
89#define SCRIPT( s, S, d, h, H, ss ) h,
92 static const hb_script_t scripts[] =
106 hb_set_t* gsub_lookups =
NULL;
107 hb_set_t* gsub_glyphs =
NULL;
108 hb_set_t* gpos_lookups =
NULL;
109 hb_set_t* gpos_glyphs =
NULL;
112 const hb_tag_t* coverage_tags;
113 hb_tag_t script_tags[] = { HB_TAG_NONE,
119#ifdef FT_DEBUG_LEVEL_TRACE
124 if ( !globals || !style_class || !gstyles )
125 return FT_THROW( Invalid_Argument );
127 face = hb_font_get_face( globals->hb_font );
129 coverage_tags = coverages[style_class->
coverage];
135 hb_ot_tags_from_script(
script,
142 if ( default_script )
144 if ( script_tags[0] == HB_TAG_NONE )
145 script_tags[0] = HB_OT_TAG_DEFAULT_SCRIPT;
148 if ( script_tags[1] == HB_TAG_NONE )
149 script_tags[1] = HB_OT_TAG_DEFAULT_SCRIPT;
150 else if ( script_tags[1] != HB_OT_TAG_DEFAULT_SCRIPT )
151 script_tags[2] = HB_OT_TAG_DEFAULT_SCRIPT;
158 if ( script_tags[0] == HB_OT_TAG_DEFAULT_SCRIPT )
161 if ( script_tags[1] == HB_OT_TAG_DEFAULT_SCRIPT )
162 script_tags[1] = HB_TAG_NONE;
165 gsub_lookups = hb_set_create();
166 hb_ot_layout_collect_lookups(
face,
173 if ( hb_set_is_empty( gsub_lookups ) )
176 FT_TRACE4((
"GSUB lookups (style `%s'):\n"
178 af_style_names[style_class->
style] ));
180#ifdef FT_DEBUG_LEVEL_TRACE
184 gsub_glyphs = hb_set_create();
185 for (
idx = HB_SET_VALUE_INVALID; hb_set_next( gsub_lookups, &
idx ); )
187#ifdef FT_DEBUG_LEVEL_TRACE
193 hb_ot_layout_lookup_collect_glyphs(
face,
202#ifdef FT_DEBUG_LEVEL_TRACE
208 FT_TRACE4((
"GPOS lookups (style `%s'):\n"
210 af_style_names[style_class->
style] ));
212 gpos_lookups = hb_set_create();
213 hb_ot_layout_collect_lookups(
face,
220#ifdef FT_DEBUG_LEVEL_TRACE
224 gpos_glyphs = hb_set_create();
225 for (
idx = HB_SET_VALUE_INVALID; hb_set_next( gpos_lookups, &
idx ); )
227#ifdef FT_DEBUG_LEVEL_TRACE
233 hb_ot_layout_lookup_collect_glyphs(
face,
242#ifdef FT_DEBUG_LEVEL_TRACE
274 for (
idx = HB_SET_VALUE_INVALID; hb_set_next( gsub_lookups,
280 if ( hb_ot_layout_lookup_would_substitute(
face,
idx,
292 FT_TRACE4((
" no blue characters found; style skipped\n" ));
345 hb_set_subtract( gsub_glyphs, gpos_glyphs );
347#ifdef FT_DEBUG_LEVEL_TRACE
348 FT_TRACE4((
" glyphs without GPOS data (`*' means already assigned)" ));
352 for (
idx = HB_SET_VALUE_INVALID; hb_set_next( gsub_glyphs, &
idx ); )
354#ifdef FT_DEBUG_LEVEL_TRACE
355 if ( !(
count % 10 ) )
371#ifdef FT_DEBUG_LEVEL_TRACE
377#ifdef FT_DEBUG_LEVEL_TRACE
385 hb_set_destroy( gsub_lookups );
386 hb_set_destroy( gsub_glyphs );
387 hb_set_destroy( gpos_lookups );
388 hb_set_destroy( gpos_glyphs );
396#define COVERAGE( name, NAME, description, \
397 tag1, tag2, tag3, tag4 ) \
398 static const hb_feature_t name ## _feature[] = \
401 HB_TAG( tag1, tag2, tag3, tag4 ), \
402 1, 0, (unsigned int)-1 \
412#define COVERAGE( name, NAME, description, \
413 tag1, tag2, tag3, tag4 ) \
417 static const hb_feature_t* features[] =
430 return (
void*)hb_buffer_create();
440 hb_buffer_destroy( (hb_buffer_t*)
buf );
448 unsigned int*
count )
456 hb_buffer_t*
buf = (hb_buffer_t*)buf_;
458 hb_codepoint_t
dummy;
462 style_class =
metrics->style_class;
468 hb_font_set_scale(
font, upem, upem );
475 while ( !( *
q ==
' ' || *
q ==
'\0' ) )
480 hb_buffer_clear_contents(
buf );
484 hb_buffer_guess_segment_properties(
buf );
492 hb_buffer_t* hb_buf =
metrics->globals->hb_buf;
495 hb_glyph_info_t* ginfo;
497 unsigned int hb_gcount;
498 hb_glyph_info_t* hb_ginfo;
505 hb_buffer_clear_contents( hb_buf );
506 hb_buffer_add_utf8( hb_buf,
p,
len, 0,
len );
507 hb_buffer_guess_segment_properties( hb_buf );
510 ginfo = hb_buffer_get_glyph_infos(
buf, &gcount );
511 hb_ginfo = hb_buffer_get_glyph_infos( hb_buf, &hb_gcount );
513 if ( gcount == hb_gcount )
518 for (
i = 0;
i < gcount;
i++ )
519 if ( ginfo[
i].codepoint != hb_ginfo[
i].codepoint )
525 hb_buffer_clear_contents(
buf );
530 *
count = hb_buffer_get_length(
buf );
532#ifdef FT_DEBUG_LEVEL_TRACE
535 " input character mapped to multiple glyphs\n" ));
549 hb_buffer_t*
buf = (hb_buffer_t*)buf_;
550 hb_glyph_info_t* ginfo;
551 hb_glyph_position_t* gpos;
557 ginfo = hb_buffer_get_glyph_infos(
buf, &gcount );
558 gpos = hb_buffer_get_glyph_positions(
buf, &gcount );
566 *y_offset = gpos[
idx].y_offset;
568 return ginfo[
idx].codepoint;
612 unsigned int*
count )
626 while ( !( *
p ==
' ' || *
p ==
'\0' ) )
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
#define GET_UTF8_CHAR(ch, p)
enum AF_Blue_Stringset_ AF_Blue_Stringset
#define AF_STYLE_UNASSIGNED
void * af_shaper_buf_create(FT_Face face)
const char * af_shaper_get_cluster(const char *p, AF_StyleMetrics metrics, void *buf_, unsigned int *count)
FT_ULong af_shaper_get_elem(AF_StyleMetrics metrics, void *buf_, unsigned int idx, FT_Long *advance, FT_Long *y_offset)
FT_Error af_shaper_get_coverage(AF_FaceGlobals globals, AF_StyleClass style_class, FT_UShort *gstyles, FT_Bool default_script)
void af_shaper_buf_destroy(FT_Face face, void *buf)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
#define FT_LOAD_IGNORE_TRANSFORM
#define FT_LOAD_NO_HINTING
FT_Get_Char_Index(FT_Face face, FT_ULong charcode)
FT_Get_Advance(FT_Face face, FT_UInt gindex, FT_Int32 load_flags, FT_Fixed *padvance)
#define FT_TRACE1(varformat)
#define FT_TRACE4(varformat)
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLuint GLuint GLsizei count
GLdouble GLdouble GLdouble GLdouble q
GLenum GLuint GLint GLenum face
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static struct msdos_boot_sector bs
INTERNETFEATURELIST feature
AF_Blue_Stringset blue_stringset