hb-ft: cast to float to help windows sqrtf

This commit is contained in:
Khaled Hosny 2022-08-02 16:09:27 +02:00 committed by Behdad Esfahbod
parent 6549aec89d
commit 40a3468906
1 changed files with 7 additions and 7 deletions

View File

@ -431,7 +431,7 @@ hb_ft_get_glyph_h_advances (hb_font_t* font, void* font_data,
#ifdef HAVE_FT_GET_TRANSFORM #ifdef HAVE_FT_GET_TRANSFORM
FT_Matrix matrix; FT_Matrix matrix;
FT_Get_Transform (ft_face, &matrix, nullptr); FT_Get_Transform (ft_face, &matrix, nullptr);
float x_mult = sqrtf (matrix.xx * matrix.xx + matrix.xy * matrix.xy) / 65536.f; float x_mult = sqrtf ((float)matrix.xx * matrix.xx + matrix.xy * matrix.xy) / 65536.f;
#else #else
float x_mult = font->x_scale < 0 ? -1 : +1; float x_mult = font->x_scale < 0 ? -1 : +1;
#endif #endif
@ -469,7 +469,7 @@ hb_ft_get_glyph_v_advance (hb_font_t *font,
#ifdef HAVE_FT_GET_TRANSFORM #ifdef HAVE_FT_GET_TRANSFORM
FT_Matrix matrix; FT_Matrix matrix;
FT_Get_Transform (ft_font->ft_face, &matrix, nullptr); FT_Get_Transform (ft_font->ft_face, &matrix, nullptr);
float y_mult = sqrtf (matrix.yx * matrix.yx + matrix.yy * matrix.yy) / 65536.f; float y_mult = sqrtf ((float)matrix.yx * matrix.yx + matrix.yy * matrix.yy) / 65536.f;
#else #else
float y_mult = font->y_scale < 0 ? -1 : +1; float y_mult = font->y_scale < 0 ? -1 : +1;
#endif #endif
@ -501,8 +501,8 @@ hb_ft_get_glyph_v_origin (hb_font_t *font,
#ifdef HAVE_FT_GET_TRANSFORM #ifdef HAVE_FT_GET_TRANSFORM
FT_Matrix matrix; FT_Matrix matrix;
FT_Get_Transform (ft_face, &matrix, nullptr); FT_Get_Transform (ft_face, &matrix, nullptr);
float x_mult = sqrtf (matrix.xx * matrix.xx + matrix.xy * matrix.xy) / 65536.f; float x_mult = sqrtf ((float)matrix.xx * matrix.xx + matrix.xy * matrix.xy) / 65536.f;
float y_mult = sqrtf (matrix.yx * matrix.yx + matrix.yy * matrix.yy) / 65536.f; float y_mult = sqrtf ((float)matrix.yx * matrix.yx + matrix.yy * matrix.yy) / 65536.f;
#else #else
float x_mult = font->x_scale < 0 ? -1 : +1; float x_mult = font->x_scale < 0 ? -1 : +1;
float y_mult = font->y_scale < 0 ? -1 : +1; float y_mult = font->y_scale < 0 ? -1 : +1;
@ -556,8 +556,8 @@ hb_ft_get_glyph_extents (hb_font_t *font,
#ifdef HAVE_FT_GET_TRANSFORM #ifdef HAVE_FT_GET_TRANSFORM
FT_Matrix matrix; FT_Matrix matrix;
FT_Get_Transform (ft_face, &matrix, nullptr); FT_Get_Transform (ft_face, &matrix, nullptr);
float x_mult = sqrtf (matrix.xx * matrix.xx + matrix.xy * matrix.xy) / 65536.f; float x_mult = sqrtf ((float)matrix.xx * matrix.xx + matrix.xy * matrix.xy) / 65536.f;
float y_mult = sqrtf (matrix.yx * matrix.yx + matrix.yy * matrix.yy) / 65536.f; float y_mult = sqrtf ((float)matrix.yx * matrix.yx + matrix.yy * matrix.yy) / 65536.f;
#else #else
float x_mult = font->x_scale < 0 ? -1 : +1; float x_mult = font->x_scale < 0 ? -1 : +1;
float y_mult = font->y_scale < 0 ? -1 : +1; float y_mult = font->y_scale < 0 ? -1 : +1;
@ -666,7 +666,7 @@ hb_ft_get_font_h_extents (hb_font_t *font HB_UNUSED,
#ifdef HAVE_FT_GET_TRANSFORM #ifdef HAVE_FT_GET_TRANSFORM
FT_Matrix matrix; FT_Matrix matrix;
FT_Get_Transform (ft_face, &matrix, nullptr); FT_Get_Transform (ft_face, &matrix, nullptr);
float y_mult = sqrtf (matrix.yx * matrix.yx + matrix.yy * matrix.yy) / 65536.f; float y_mult = sqrtf ((float)matrix.yx * matrix.yx + matrix.yy * matrix.yy) / 65536.f;
#else #else
float y_mult = font->y_scale < 0 ? -1 : +1; float y_mult = font->y_scale < 0 ? -1 : +1;
#endif #endif