>> Anyways, since VC 2010 is a frequently used compiler, we have to
>> find a workaround. Behdad, any ideas?
>
> I do not have the compiler but I would try braces around {the
> constants}. Then you can use it to initialize a temp array to
> transfer in the appropriate place at last.
>
> FT_Int params[] = CFF_CONFIG_OPTION_DARKENING_PARAMETERS;
>
> driver->darken_params[0] = params[0];
> driver->darken_params[1] = params[1];
> driver->darken_params[2] = params[2];
Unfortunately, if you use braces there is no possibility for the
clever *compile-time* check
typedef int static_assert_darkening_parameters[
( x1 < 0 || x2 < 0 || x3 < 0 || x4 < 0 ||
y1 < 0 || y2 < 0 || y3 < 0 || y4 < 0 ||
x1 > x2 || x2 > x3 || x3 > x4 ||
y1 > 500 || y2 > 500 || y3 > 500 || y4 > 500 ) ? -1 : +1];
This code expands to the invalid
typedef int static_assert_darkening_parameters[-1];
if one of the assertions is invalid.
Another suggestion is to simply have eight constants:
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 500
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 400
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 1000
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 275
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 1667
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 275
CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 2333
CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 0
John, does this work if you pass those values to
SET_DARKENING_PARAMETERS_0?
Werner
_______________________________________________
Freetype-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype-devel