Werner Lemberg pushed to branch master at FreeType / FreeType
Commits:
-
7bed7a02
by Ben Wagner at 2023-06-03T07:02:12+02:00
Fix some `FT_Fixed` vs. `FT_Long` confusion.
`FT_Fixed` and `FT_Long` are both typedef'ed to be `signed long`. However,
`FT_Fixed` implies that the lower 16 bits are being used to express
fractional values and so these two types should not be confused.
* include/freetype/internal/services/svmm.h (FT_Set_MM_Blend_Func): Use
`FT_Fixed` for `coords`. Users are passing `FT_Fixed` and implementations
are taking `FT_Fixed`.
(FT_Get_MM_Blend_Func): Ditto.
* src/autofit/afcjk.c (af_cjk_metrics_check_digits): Use `FT_Long` for
`advance` and `old_advance`. `advance`'s address is passed as `FT_Long*` to
`af_shaper_get_elem`, which writes the advance in em units (not fixed). The
exact value is not important here as it is only compared to check whether it
has changed.
* src/autofit/aflatin.c (af_latin_metrics_check_digits): Ditto.
3 changed files:
Changes:
include/freetype/internal/services/svmm.h
... |
... |
@@ -60,9 +60,9 @@ FT_BEGIN_HEADER |
60
|
60
|
/* use return value -1 to indicate that the new coordinates */
|
61
|
61
|
/* are equal to the current ones; no changes are thus needed */
|
62
|
62
|
typedef FT_Error
|
63
|
|
- (*FT_Set_MM_Blend_Func)( FT_Face face,
|
64
|
|
- FT_UInt num_coords,
|
65
|
|
- FT_Long* coords );
|
|
63
|
+ (*FT_Set_MM_Blend_Func)( FT_Face face,
|
|
64
|
+ FT_UInt num_coords,
|
|
65
|
+ FT_Fixed* coords );
|
66
|
66
|
|
67
|
67
|
typedef FT_Error
|
68
|
68
|
(*FT_Get_Var_Design_Func)( FT_Face face,
|
... |
... |
@@ -78,9 +78,9 @@ FT_BEGIN_HEADER |
78
|
78
|
FT_UInt *instance_index );
|
79
|
79
|
|
80
|
80
|
typedef FT_Error
|
81
|
|
- (*FT_Get_MM_Blend_Func)( FT_Face face,
|
82
|
|
- FT_UInt num_coords,
|
83
|
|
- FT_Long* coords );
|
|
81
|
+ (*FT_Get_MM_Blend_Func)( FT_Face face,
|
|
82
|
+ FT_UInt num_coords,
|
|
83
|
+ FT_Fixed* coords );
|
84
|
84
|
|
85
|
85
|
typedef FT_Error
|
86
|
86
|
(*FT_Get_Var_Blend_Func)( FT_Face face,
|
src/autofit/afcjk.c
... |
... |
@@ -567,8 +567,8 @@ |
567
|
567
|
af_cjk_metrics_check_digits( AF_CJKMetrics metrics,
|
568
|
568
|
FT_Face face )
|
569
|
569
|
{
|
570
|
|
- FT_Bool started = 0, same_width = 1;
|
571
|
|
- FT_Fixed advance = 0, old_advance = 0;
|
|
570
|
+ FT_Bool started = 0, same_width = 1;
|
|
571
|
+ FT_Long advance = 0, old_advance = 0;
|
572
|
572
|
|
573
|
573
|
/* If HarfBuzz is not available, we need a pointer to a single */
|
574
|
574
|
/* unsigned long value. */
|
src/autofit/aflatin.c
... |
... |
@@ -1065,8 +1065,8 @@ |
1065
|
1065
|
af_latin_metrics_check_digits( AF_LatinMetrics metrics,
|
1066
|
1066
|
FT_Face face )
|
1067
|
1067
|
{
|
1068
|
|
- FT_Bool started = 0, same_width = 1;
|
1069
|
|
- FT_Fixed advance = 0, old_advance = 0;
|
|
1068
|
+ FT_Bool started = 0, same_width = 1;
|
|
1069
|
+ FT_Long advance = 0, old_advance = 0;
|
1070
|
1070
|
|
1071
|
1071
|
/* If HarfBuzz is not available, we need a pointer to a single */
|
1072
|
1072
|
/* unsigned long value. */
|
|