Re: [1/5] gdi32: Fix the advance width in synthetic bold glyphs when using scaling factors.
On Tue, Nov 03, 2015 at 03:06:24PM +0900, Akihiro Sagawa wrote:
@@ -6297,6 +6299,14 @@ static inline BOOL is_identity_MAT2(const MAT2 *matrix) return !memcmp(matrix, &identity, sizeof(MAT2)); }
+static inline void calc_unit_vector(FT_Vector *vec) +{ + FT_Fixed len; + len = pFT_Vector_Length(vec); + vec->x = (vec->x << 6) / len; + vec->y = (vec->y << 6) / len; +}
You need to check for division by zero. Huw.
On Thu, 5 Nov 2015 11:22:26 +0000, Huw Davies wrote:
On Tue, Nov 03, 2015 at 03:06:24PM +0900, Akihiro Sagawa wrote:
@@ -6297,6 +6299,14 @@ static inline BOOL is_identity_MAT2(const MAT2 *matrix) return !memcmp(matrix, &identity, sizeof(MAT2)); }
+static inline void calc_unit_vector(FT_Vector *vec) +{ + FT_Fixed len; + len = pFT_Vector_Length(vec); + vec->x = (vec->x << 6) / len; + vec->y = (vec->y << 6) / len; +}
You need to check for division by zero.
Huw.
Good catch. Thanks for reviewing. Akihiro Sagawa
participants (2)
-
Akihiro Sagawa -
Huw Davies