[autofit] Add more debugging functions. * src/autofit/afhints.c (af_glyph_hints_get_num_segments, af_glyph_hints_get_segment_offset): New functions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
diff --git a/ChangeLog b/ChangeLog
index 25f6b03..145099d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-05-01 Just Fill Bugs <mozbugbox@yahoo.com.au>
+ Werner Lemberg <wl@gnu.org>
+
+ [autofit] Add more debugging functions.
+
+ * src/autofit/afhints.c (af_glyph_hints_get_num_segments,
+ af_glyph_hints_get_segment_offset): New functions.
+
2011-05-01 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
Add new option `--disable-mmap' to configure script.
diff --git a/src/autofit/afhints.c b/src/autofit/afhints.c
index 70c1054..be832ab 100644
--- a/src/autofit/afhints.c
+++ b/src/autofit/afhints.c
@@ -277,6 +277,69 @@
#endif
+ /* Fetch number of segments. */
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+ FT_Error
+ af_glyph_hints_get_num_segments( AF_GlyphHints hints,
+ FT_Int dimension,
+ FT_Int* num_segments )
+ {
+ AF_Dimension dim;
+ AF_AxisHints axis;
+
+
+ dim = ( dimension == 0 ) ? AF_DIMENSION_HORZ : AF_DIMENSION_VERT;
+
+ axis = &hints->axis[dim];
+ *num_segments = axis->num_segments;
+
+ return AF_Err_Ok;
+ }
+#ifdef __cplusplus
+ }
+#endif
+
+
+ /* Fetch offset of segments into user supplied offset array. */
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+ FT_Error
+ af_glyph_hints_get_segment_offset( AF_GlyphHints hints,
+ FT_Int dimension,
+ FT_Int idx,
+ FT_Pos* offset )
+ {
+ AF_Dimension dim;
+ AF_AxisHints axis;
+ AF_Segment seg;
+
+
+ if ( !offset )
+ return AF_Err_Invalid_Argument;
+
+ dim = ( dimension == 0 ) ? AF_DIMENSION_HORZ : AF_DIMENSION_VERT;
+
+ axis = &hints->axis[dim];
+
+ if ( idx < 0 || idx >= axis->num_segments )
+ return AF_Err_Invalid_Argument;
+
+ seg = &axis->segments[idx];
+ *offset = (dim == AF_DIMENSION_HORZ) ? seg->first->ox
+ : seg->first->oy;
+
+ return AF_Err_Ok;
+ }
+#ifdef __cplusplus
+ }
+#endif
+
+
/* Dump the array of linked edges. */
#ifdef __cplusplus
@@ -349,6 +412,30 @@
}
+ FT_Error
+ af_glyph_hints_get_num_segments( AF_GlyphHints hints,
+ FT_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,
+ FT_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 )
{