diff --git a/src/autofit/afhints.c b/src/autofit/afhints.c index 70c1054..22092b0 100644 --- a/src/autofit/afhints.c +++ b/src/autofit/afhints.c @@ -276,6 +276,55 @@ } #endif + /* Fetch number of segments */ +#ifdef __cplusplus + extern "C" { +#endif + FT_Error + af_glyph_hints_get_num_segments( AF_GlyphHints hints, + int dimension, + FT_Int* num_segments ) + { + FT_Error error = AF_Err_Ok; + AF_AxisHints axis = &hints->axis[dimension]; + + *num_segments = axis->num_segments; + + return error; + } +#ifdef __cplusplus + } +#endif + + /* fetch offset of segments. User supply the offset array. */ +#ifdef __cplusplus + extern "C" { +#endif + FT_Error + af_glyph_hints_get_segment_offset( AF_GlyphHints hints, + int dimension, + FT_Int idx, + FT_Pos* offset ) + { + FT_Error error = AF_Err_Ok; + AF_AxisHints axis = &hints->axis[dimension]; + AF_Segment segments = axis->segments; + AF_Segment limit = segments + idx; + AF_Segment seg; + + + for ( seg = segments; seg < limit; seg++ ) + { + *offset = dimension == AF_DIMENSION_HORZ ? (int)seg->first->ox + : (int)seg->first->oy; + offset++; + } + + return error; + } +#ifdef __cplusplus + } +#endif /* Dump the array of linked edges. */ @@ -348,6 +397,27 @@ FT_UNUSED( hints ); } + FT_Error + af_glyph_hints_get_num_segments( AF_GlyphHints hints, + int dimension, + FT_Int* num_segments ) + { + FT_UNUSED( hints ); + FT_UNUSED( dimension ); + FT_UNUSED( num_segments ); + } + + FT_Error + af_glyph_hints_get_segment_offset( AF_GlyphHints hints, + int dimension, + FT_Int idx, + FT_Pos* offset ) + { + FT_UNUSED( hints ); + FT_UNUSED( dimension ); + FT_UNUSED( idx ); + FT_UNUSED( offset ); + } void af_glyph_hints_dump_edges( AF_GlyphHints hints )