freetype2/include/freetype
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
..
config Replace `sprintf` with `snprintf`. 2023-05-23 13:18:01 +02:00
internal [CFF] Extract `BlueValues` as `Fixed` rather than `Int`. 2023-12-14 07:17:01 +01:00
freetype.h * Version 2.13.2 released. 2023-08-25 20:12:52 +02:00
ftadvanc.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftbbox.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftbdf.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftbitmap.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftbzip2.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftcache.h * include/freetype/ftcache.h: Typo, punctuation. 2023-05-12 05:59:00 +02:00
ftchapters.h API documentation: Re-organize chapters and sections 2023-04-30 14:42:11 +00:00
ftcid.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftcolor.h The 'COLR' v1 API will no longer be experimental in the next release. 2023-01-19 07:17:14 +01:00
ftdriver.h s/this is,/that is,/ 2023-04-27 06:24:48 +02:00
fterrdef.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
fterrors.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftfntfmt.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftgasp.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftglyph.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftgxval.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftgzip.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftimage.h * include/freetype/ftimage.h: Fix type and link. 2023-11-13 23:15:00 -05:00
ftincrem.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftlcdfil.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftlist.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftlogging.h Add missing end quote of a string in the example code of FT_Trace_Set_Level 2023-05-19 14:11:57 -04:00
ftlzw.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftmac.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftmm.h [truetype] Fix deactivation of variation font handling. 2023-05-06 18:53:50 +02:00
ftmodapi.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftmoderr.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftotval.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftoutln.h fix typo in FT_Outline_Decompose note 2023-10-08 23:34:28 +00:00
ftparams.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftpfr.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftrender.h Mark FT_Renderer_Class::raster_class as pointer to const 2023-06-05 12:06:24 -04:00
ftsizes.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftsnames.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftstroke.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftsynth.h * src/base/ftsynth.c (FT_GlyphSlot_AdjustWeight): New API. 2023-03-16 03:28:59 +00:00
ftsystem.h * include/freetype/ftsystem.h (FT_Stream_IoFunc): Improve documentation. 2023-03-16 05:26:48 +01:00
fttrigon.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
fttypes.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ftwinfnt.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
otsvg.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
t1tables.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ttnameid.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
tttables.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
tttags.h Update all copyright notices. 2023-01-17 09:18:25 +01:00