Fix infinite loop bug in tilde fix, added then commented out a bunch of non-working GSUB handling
This commit is contained in:
parent
75876af476
commit
ed574779d7
|
@ -187,8 +187,17 @@ af_lookup_vertical_seperation_type( AF_ReverseCharacterMap map, FT_Int glyph_ind
|
||||||
FT_LOCAL_DEF( FT_Int )
|
FT_LOCAL_DEF( FT_Int )
|
||||||
af_lookup_tilde_correction_type( AF_ReverseCharacterMap map, FT_Int glyph_index ) {
|
af_lookup_tilde_correction_type( AF_ReverseCharacterMap map, FT_Int glyph_index ) {
|
||||||
FT_UInt32 codepoint = af_reverse_character_map_lookup( map, glyph_index );
|
FT_UInt32 codepoint = af_reverse_character_map_lookup( map, glyph_index );
|
||||||
if ( codepoint == 0xF1 ) {
|
/* bits are: apply stretch, apply segment removal */
|
||||||
return 1;
|
if ( codepoint == 0xF1 ) { /*n tilde*/
|
||||||
|
return 0b01;
|
||||||
|
}
|
||||||
|
else if ( codepoint == 0xE3 ) /*a tilde*/
|
||||||
|
{
|
||||||
|
return 0b11;
|
||||||
|
}
|
||||||
|
else if ( codepoint == 0xF5 ) /*o tilde*/
|
||||||
|
{
|
||||||
|
return 0b10;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -336,7 +345,8 @@ af_reverse_character_map_new( AF_ReverseCharacterMap *map, AF_FaceGlobals global
|
||||||
af_reverse_character_map_entry_compare
|
af_reverse_character_map_entry_compare
|
||||||
);
|
);
|
||||||
|
|
||||||
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
|
#if 0
|
||||||
|
/*#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ*/
|
||||||
hb_font_t *hb_font = globals->hb_font;
|
hb_font_t *hb_font = globals->hb_font;
|
||||||
hb_face_t *hb_face = hb_font_get_face( hb_font );
|
hb_face_t *hb_face = hb_font_get_face( hb_font );
|
||||||
hb_set_t *feature_indicies = hb_set_create();
|
hb_set_t *feature_indicies = hb_set_create();
|
||||||
|
@ -350,8 +360,6 @@ af_reverse_character_map_new( AF_ReverseCharacterMap *map, AF_FaceGlobals global
|
||||||
feature_indicies
|
feature_indicies
|
||||||
);
|
);
|
||||||
hb_codepoint_t feature_index = HB_SET_VALUE_INVALID;
|
hb_codepoint_t feature_index = HB_SET_VALUE_INVALID;
|
||||||
|
|
||||||
FT_UInt added_entries = 0;
|
|
||||||
while ( hb_set_next(feature_indicies, &feature_index) )
|
while ( hb_set_next(feature_indicies, &feature_index) )
|
||||||
{
|
{
|
||||||
hb_codepoint_t output_glyph_index;
|
hb_codepoint_t output_glyph_index;
|
||||||
|
@ -366,6 +374,20 @@ af_reverse_character_map_new( AF_ReverseCharacterMap *map, AF_FaceGlobals global
|
||||||
glyphs_output);
|
glyphs_output);
|
||||||
/*Don't consider anything involving context. Just do the
|
/*Don't consider anything involving context. Just do the
|
||||||
simple cases*/
|
simple cases*/
|
||||||
|
FT_TRACE4(("num inputs: %d\n", hb_set_get_population( glyphs_input )));
|
||||||
|
FT_TRACE4(("num outputs: %d\n", hb_set_get_population( glyphs_output )));
|
||||||
|
FT_TRACE4(("num before: %d\n", hb_set_get_population( glyphs_before )));
|
||||||
|
FT_TRACE4(("num after: %d\n", hb_set_get_population( glyphs_after )));
|
||||||
|
hb_codepoint_t input = HB_SET_VALUE_INVALID;
|
||||||
|
while ( hb_set_next( glyphs_input, &input ) )
|
||||||
|
{
|
||||||
|
FT_TRACE4(("input: %d\n", input));
|
||||||
|
}
|
||||||
|
hb_codepoint_t output = HB_SET_VALUE_INVALID;
|
||||||
|
while ( hb_set_next( glyphs_output, &output ) )
|
||||||
|
{
|
||||||
|
FT_TRACE4(("output: %d\n", output));
|
||||||
|
}
|
||||||
if ( hb_set_get_population( glyphs_before ) > 0 ||
|
if ( hb_set_get_population( glyphs_before ) > 0 ||
|
||||||
hb_set_get_population( glyphs_after ) > 0 )
|
hb_set_get_population( glyphs_after ) > 0 )
|
||||||
{
|
{
|
||||||
|
@ -378,18 +400,22 @@ af_reverse_character_map_new( AF_ReverseCharacterMap *map, AF_FaceGlobals global
|
||||||
|
|
||||||
hb_codepoint_t input_glyph_index = HB_SET_VALUE_INVALID;
|
hb_codepoint_t input_glyph_index = HB_SET_VALUE_INVALID;
|
||||||
const AF_AdjustmentDatabaseEntry* input_entry = NULL;
|
const AF_AdjustmentDatabaseEntry* input_entry = NULL;
|
||||||
FT_UInt32 input_codepoint;
|
FT_UInt32 input_codepoint = 0;
|
||||||
while ( hb_set_next( glyphs_input, &input_glyph_index ) ) {
|
while ( hb_set_next( glyphs_input, &input_glyph_index ) ) {
|
||||||
input_codepoint = af_reverse_character_map_lookup_( *map, input_glyph_index, oldlength );
|
FT_TRACE4(("input glyph: %d\n", input_glyph_index));
|
||||||
if ( input_codepoint == 0 )
|
FT_UInt32 inner_codepoint = af_reverse_character_map_lookup_( *map, input_glyph_index, oldlength );
|
||||||
|
if ( inner_codepoint == 0 )
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const AF_AdjustmentDatabaseEntry* entry = af_adjustment_database_lookup( input_codepoint );
|
const AF_AdjustmentDatabaseEntry* entry = af_adjustment_database_lookup( inner_codepoint );
|
||||||
if ( entry == NULL )
|
if ( entry == NULL )
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ( input_codepoint == 0 ) {
|
||||||
|
input_codepoint = inner_codepoint;
|
||||||
|
}
|
||||||
|
|
||||||
if ( input_entry == NULL )
|
if ( input_entry == NULL )
|
||||||
{
|
{
|
||||||
|
@ -404,6 +430,10 @@ af_reverse_character_map_new( AF_ReverseCharacterMap *map, AF_FaceGlobals global
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( input_codepoint == 0 )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
output_glyph_index = HB_SET_VALUE_INVALID;
|
output_glyph_index = HB_SET_VALUE_INVALID;
|
||||||
hb_set_next( glyphs_output, &output_glyph_index );
|
hb_set_next( glyphs_output, &output_glyph_index );
|
||||||
|
|
|
@ -2809,13 +2809,18 @@ af_remove_segments_containing_point(AF_GlyphHints hints, AF_Point point)
|
||||||
{
|
{
|
||||||
AF_Segment seg = &segments[i];
|
AF_Segment seg = &segments[i];
|
||||||
FT_Bool remove = 0;
|
FT_Bool remove = 0;
|
||||||
for ( AF_Point p = seg->first; p <= seg->last; p = p->next )
|
AF_Point p = seg->first;
|
||||||
|
while ( 1 )
|
||||||
{
|
{
|
||||||
if ( p == point )
|
if ( p == point )
|
||||||
{
|
{
|
||||||
remove = 1;
|
remove = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (p == seg->last) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
p = p->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( remove )
|
if ( remove )
|
||||||
|
@ -2856,7 +2861,7 @@ af_latin_stretch_tildes_step_2( AF_GlyphHints hints,
|
||||||
FT_Int glyph_index,
|
FT_Int glyph_index,
|
||||||
AF_ReverseCharacterMap reverse_charmap )
|
AF_ReverseCharacterMap reverse_charmap )
|
||||||
{
|
{
|
||||||
if (af_lookup_tilde_correction_type(reverse_charmap, glyph_index)) {
|
if (af_lookup_tilde_correction_type(reverse_charmap, glyph_index) & 1) {
|
||||||
FT_Int highest_contour = af_find_highest_contour(hints);
|
FT_Int highest_contour = af_find_highest_contour(hints);
|
||||||
AF_Point first_point = hints->contours[highest_contour];
|
AF_Point first_point = hints->contours[highest_contour];
|
||||||
|
|
||||||
|
@ -2872,18 +2877,17 @@ af_latin_stretch_tildes_step_2( AF_GlyphHints hints,
|
||||||
&& p->prev->flags & AF_FLAG_CONTROL
|
&& p->prev->flags & AF_FLAG_CONTROL
|
||||||
&& p->next->flags & AF_FLAG_CONTROL*/ 1 )
|
&& p->next->flags & AF_FLAG_CONTROL*/ 1 )
|
||||||
{
|
{
|
||||||
|
FT_TRACE4(("%p", p));
|
||||||
af_remove_segments_containing_point( hints, p );
|
af_remove_segments_containing_point( hints, p );
|
||||||
}
|
}
|
||||||
} while ( p != first_point );
|
} while ( p != first_point );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
af_latin_stretch_tildes( AF_GlyphHints hints,
|
af_latin_stretch_tildes( AF_GlyphHints hints,
|
||||||
FT_Int glyph_index,
|
FT_Int glyph_index,
|
||||||
AF_ReverseCharacterMap reverse_charmap ) {
|
AF_ReverseCharacterMap reverse_charmap ) {
|
||||||
if ( af_lookup_tilde_correction_type( reverse_charmap, glyph_index ) ) {
|
if ( af_lookup_tilde_correction_type( reverse_charmap, glyph_index ) & 2 ) {
|
||||||
FT_Int highest_contour = af_find_highest_contour( hints );
|
FT_Int highest_contour = af_find_highest_contour( hints );
|
||||||
AF_Point p = hints->contours[highest_contour];
|
AF_Point p = hints->contours[highest_contour];
|
||||||
AF_Point first_point = p;
|
AF_Point first_point = p;
|
||||||
|
@ -4116,7 +4120,7 @@ static void traceheight(FT_UInt num, AF_GlyphHints hints) {
|
||||||
|
|
||||||
if ( AF_HINTS_DO_VERTICAL( hints ) )
|
if ( AF_HINTS_DO_VERTICAL( hints ) )
|
||||||
{
|
{
|
||||||
/*af_latin_stretch_tildes( hints, glyph_index, metrics->root.reverse_charmap );*/
|
af_latin_stretch_tildes( hints, glyph_index, metrics->root.reverse_charmap );
|
||||||
axis = &metrics->axis[AF_DIMENSION_VERT];
|
axis = &metrics->axis[AF_DIMENSION_VERT];
|
||||||
error = af_latin_hints_detect_features( hints,
|
error = af_latin_hints_detect_features( hints,
|
||||||
axis->width_count,
|
axis->width_count,
|
||||||
|
|
Loading…
Reference in New Issue