- added FT_Get_SubGlyph_Info API to freetype.h - small fix to lsb/rsb delta computations - cleaning up Jamfile
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 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
diff --git a/ChangeLog b/ChangeLog
index 43b3856..7d616e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-03-23 David Turner <david@freetype.org>
+
+ * include/freetype/freetype.h, include/freetype/internal/ftgloadr.h,
+ src/base/ftobjs.c: adding FT_Get_SubGlyph_Info API to retrieve subglyph
+ data. Note that we do not expose FT_SubGlyphRec here !
+
+ * src/autofit/afloader.c: compute lsb_delta and rsb_delta correctly
+ in edge cases
+
2006-03-22 Werner Lemberg <wl@gnu.org>
* src/cache/ftccache.c, (ftc_node_mru_up, FTC_Cache_Lookup)
diff --git a/Jamfile b/Jamfile
index 48cfd19..e99d4cf 100644
--- a/Jamfile
+++ b/Jamfile
@@ -76,10 +76,8 @@ FT2_COMPONENTS ?= autofit # auto-fitter
cache # cache sub-system
cff # CFF/CEF font driver
cid # PostScript CID-keyed font driver
- #gxvalid # validation of TrueTypeGX/AAT tables
gzip # support for gzip-compressed files
lzw # support for LZW-compressed files
- #otvalid # validation of OpenType tables
pcf # PCF font driver
pfr # PFR/TrueDoc font driver
psaux # common PostScript routines module
@@ -127,6 +125,7 @@ if $(DEBUG_HINTER)
#
HDRS += $(FT2_INCLUDE) ;
+
# We need to #define FT2_BUILD_LIBRARY so that our sources find the
# internal headers
#
diff --git a/devel/ftoption.h b/devel/ftoption.h
index da3559a..d326089 100644
--- a/devel/ftoption.h
+++ b/devel/ftoption.h
@@ -436,7 +436,7 @@ FT_BEGIN_HEADER
/* Do not #undef this macro here, since the build system might */
/* define it for certain configurations only. */
/* */
-#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
+#define xxTT_CONFIG_OPTION_BYTECODE_INTERPRETER
/*************************************************************************/
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 3bde8a8..488bc54 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -3222,6 +3222,64 @@ FT_BEGIN_HEADER
FT_Vector_Transform( FT_Vector* vec,
const FT_Matrix* matrix );
+ /**
+ * @macro: FT_SUBGLYPH_FLAG_XXX
+ *
+ * @description:
+ * a list of constant used to describe each subglyph
+ *
+ * @values:
+ * FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::
+ * FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::
+ * FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::
+ * FT_SUBGLYPH_FLAG_SCALE ::
+ * FT_SUBGLYPH_FLAG_XY_SCALE ::
+ * FT_SUBGLYPH_FLAG_2X2 ::
+ * FT_SUBGLYPH_FLAG_USE_MY_METRICS ::
+ */
+#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
+#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
+#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
+#define FT_SUBGLYPH_FLAG_SCALE 8
+#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
+#define FT_SUBGLYPH_FLAG_2X2 0x80
+#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
+
+ /**
+ * @func: FT_Get_SubGlyph_Info
+ *
+ * @description:
+ * a function used to retrieve a description of a given subglyph.
+ * only use it when 'glyph->format' is FT_GLYPH_FORMAT_COMPOSITE, or
+ * an error will be returned
+ *
+ * @input:
+ * glyph :: source glyph slot
+ * sub_index :: index of subglyph. must be less than 'glyph->num_subglyphs'
+ *
+ * @output:
+ * p_index :: subglyph glyph index
+ * p_flags :: subglyph flags, see @FT_SUBGLYPH_FLAG_XXX
+ * p_arg1 :: subglyph first argument (if any)
+ * p_arg2 :: subglyph second argument (if any)
+ * p_transform :: subglyph transform (if any)
+ *
+ * @return:
+ * error code. 0 means success
+ *
+ * @note:
+ * the values of *p_arg1, *p_arg2 and *p_transform must be interpreted
+ * depending on the flags returns in *p_flags. See the TrueType specification
+ * for details
+ */
+ FT_EXPORT( FT_Error )
+ FT_Get_SubGlyph_Info( FT_GlyphSlot glyph,
+ FT_UInt sub_index,
+ FT_Int *p_index,
+ FT_UInt *p_flags,
+ FT_Int *p_arg1,
+ FT_Int *p_arg2,
+ FT_Matrix *p_transform );
/* */
diff --git a/include/freetype/internal/ftgloadr.h b/include/freetype/internal/ftgloadr.h
index 2aaff0d..1b83c68 100644
--- a/include/freetype/internal/ftgloadr.h
+++ b/include/freetype/internal/ftgloadr.h
@@ -43,6 +43,7 @@ FT_BEGIN_HEADER
typedef struct FT_GlyphLoaderRec_* FT_GlyphLoader ;
+#if 0 /* now in freetype.h since 2.2 */
#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
@@ -50,7 +51,7 @@ FT_BEGIN_HEADER
#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
#define FT_SUBGLYPH_FLAG_2X2 0x80
#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
-
+#endif
typedef struct FT_SubGlyphRec_
{
diff --git a/src/autofit/afloader.c b/src/autofit/afloader.c
index 98a4a39..7f110ab 100644
--- a/src/autofit/afloader.c
+++ b/src/autofit/afloader.c
@@ -224,8 +224,14 @@
else
#endif /* !AF_USE_WARPER */
{
+ FT_Pos pp1x = loader->pp1.x;
+ FT_Pos pp2x = loader->pp2.x;
+
loader->pp1.x = FT_PIX_ROUND( loader->pp1.x );
loader->pp2.x = FT_PIX_ROUND( loader->pp2.x );
+
+ slot->lsb_delta = loader->pp1.x - pp1x;
+ slot->rsb_delta = loader->pp2.x - pp2x;
}
}
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 821571a..5ebfdf5 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -3861,4 +3861,33 @@
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Get_SubGlyph_Info( FT_GlyphSlot glyph,
+ FT_UInt sub_index,
+ FT_Int *p_index,
+ FT_UInt *p_flags,
+ FT_Int *p_arg1,
+ FT_Int *p_arg2,
+ FT_Matrix *p_transform )
+ {
+ FT_Error error = FT_Err_Invalid_Argument;
+
+ if ( glyph != NULL &&
+ glyph->format == FT_GLYPH_FORMAT_COMPOSITE &&
+ sub_index < glyph->num_subglyphs )
+ {
+ FT_SubGlyph subg = glyph->subglyphs + sub_index;
+
+ *p_index = subg->index;
+ *p_flags = subg->flags;
+ *p_arg1 = subg->arg1;
+ *p_arg2 = subg->arg2;
+ *p_transform = subg->transform;
+ }
+ return error;
+ }
+
+
+
/* END */