freetype2/src
Skef Iterum 8eab511017 [CFF] Extract `BlueValues` as `Fixed` rather than `Int`.
This is a follow-up to commit 26a7f047,

  [cff] Make blend operator work with floats in private dicts.

which addressed the 'party baseline' bug.  However, the reporting user
indicated that the default location and some other points in design space
rendered OK, but other points in design space still had problems.  The most
obvious issue being that the x-heights of lower-case letters did not align;
see

  https://github.com/adobe-fonts/source-serif/issues/121#issuecomment-1773794136

After some analysis we determined that this was due to an interaction
between `BlueValue` rounding and the zone-based algorithm.  In short, for a
point to be considered in a zone it must fall within the bounds of the zone.
(There is a slop factor in some cases, but only a very small one.)  In the
Adobe-contributed side of the code, point values are not integer-rounded,
instead they're kept as (some form of) fixed.  Rounding just the `BlueValues`
means that points that need to be considered within a zone will fall outside
of it at some points in design space.

The majority of this patch changes the storage and parsing of `BlueValues`
to keep them as `FT_Fixed`.  No significant code changes were needed because
the values are converted to `Fixed` anyway when stored in `CF_BlueRec`.  No
attempt was made to address problems in the older pshinter code beyond
converting the values from `FT_Fixed` to `FT_Short` when copying the private
dictionary.  (However, as the point values are also rounded in that code,
the problem is much less likely to occur, although inconsistency between
rounding and truncation could cause an analogous problem.)

* include/freetype/internal/cfftypes.h (CFF_PrivateRec): Use `FT_Fixed` for
`blue_values`, `other_blues`, `family_blues`, and `family_other_blues`.

* src/cff/cffload.c (cff_blend_doBlend): Updated.

* src/cff/cffobjs.c (CFF_fixedToInt): New macro.
(cff_make_private_dict): Use it.

* src/cff/cffparse.h (cff_kind_delta_fixed): New enum value.

* src/cff/cffparse.c (do_fixed): Updated.
(CFF_FIELD_DELTA, CFF_FIELD_DELTA_FIXED, CFF_DELTA_KIND): New set of macros,
replacing `CFF_FIELD_DELTA`.
(cff_parser_run): Updated to handle fixed-float deltas.

* src/cff/cfftoken.h: Updated to use `CFF_FIELD_DELTA_FIXED` for blue
values.

* src/psaux/psblues.c (cf2_blueToFixed): Removed, no longer needed.
(cf2_blues_init): Updated.

* src/pxaux/psft.c, src/pxaux/psft.h (cf2_getBlueValues, cf2_getOtherBlues,
cf2_getFamilyBlues, cf2_getFamilyOtherBlues): Updated signatures.

* src/psaux/psobjs.c (t1_make_subfont): Updated.
2023-12-14 07:17:01 +01:00
..
autofit [autofit] Fix synchronization mistake between FreeType and ttfautohint. 2023-09-05 08:09:31 +02:00
base Comment typos. 2023-09-24 20:09:17 -04:00
bdf Replace `sprintf` with `snprintf`. 2023-05-23 13:18:01 +02:00
bzip2 * src/bzip2/ftbzip2.c: Signature fixes. 2023-05-08 06:26:43 +02:00
cache [cache] Merge functions. 2023-05-12 22:27:08 -04:00
cff [CFF] Extract `BlueValues` as `Fixed` rather than `Int`. 2023-12-14 07:17:01 +01:00
cid [type1, cid, type42] Post-cleanup. 2023-09-09 22:20:00 -04:00
dlg * src/*: Replace leading underscores with trailing ones in dummy variables. 2023-02-26 20:18:54 +01:00
gxvalid * src/gxvalid/gxvcommn.h (GXV_USHORT_TO_SHORT): Removed. 2023-09-25 22:26:15 -04:00
gzip [gzip] Update sources to zlib 1.13. 2023-08-27 09:47:24 +02:00
lzw Fix 'fall-through' warning messages. 2023-02-08 21:09:32 +01:00
otvalid Update all copyright notices. 2023-01-17 09:18:25 +01:00
pcf * src/pcf/pcfutil.c (BSWAP16): Limit clang support. 2023-10-21 19:08:20 -04:00
pfr [pfr] Signature fixes. 2023-05-07 15:57:06 +02:00
psaux [CFF] Extract `BlueValues` as `Fixed` rather than `Int`. 2023-12-14 07:17:01 +01:00
pshinter [pshinter] Signature fixes. 2023-05-07 20:26:12 +02:00
psnames */*: Remove many function pointer casts. 2023-06-03 06:58:09 +02:00
raster * src/raster/ftraster.c (Draw_Sweep): Swap stub conditions. 2023-12-01 23:13:28 -05:00
sdf [sdf] Correct handling of empty glyphs. 2023-06-09 05:38:49 +02:00
sfnt * src/sfnt/ttpost.c (load_format_20): Micro-optimize. 2023-09-06 22:58:46 -04:00
smooth * src/smooth/ftgrays.c: Move the sweep functions... 2023-10-09 22:22:24 -04:00
svg */*: Remove many function pointer casts. 2023-06-03 06:58:09 +02:00
tools * src/tools/apinames.c (read_header_file): Typos. 2023-09-14 13:00:07 +00:00
truetype * src/truetype/ttgxvar.c (ft_var_to_normalized): Fix undefined left-shift. 2023-12-14 06:14:43 +01:00
type1 * src/type1/t1afm.c (t1_get_index): Restore `strlen` call. 2023-09-10 22:34:17 -04:00
type42 [type1, cid, type42] Post-cleanup. 2023-09-09 22:20:00 -04:00
winfonts * src/winfonts/winfnt.c: Signature fixes. 2023-05-07 16:30:21 +02:00