aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-02-29[cff, truetype] Always set up default variable instance.Ben Wanger
For default variable instances `cff_face_init` did not set the blend. This mostly worked as later use of the unset blend produced the default variation. However, if a user called `TT_Get_MM_Var` the blend would be partially set up, but not fully. In particular the number of axes, the axis definitions, and the instance locations would be set up, but not the current instance location (`coords` and `normalizedcoords`). This could lead to the default instances of CFF2 fonts erroring on any use of `blend`. Ensure the default variable instance is fully set up by always calling `FT_Set_Named_Instance` on a variable face. * src/cff/cffobjs.c (cff_face_init): Call `FT_Set_Named_Instance` on default instances. * src/truetype/ttobjs.c (tt_face_init): Ditto. Fixes #1268.
2024-02-23* src/truetype/ttgxvar.c (ft_var_to_normalized): Integer overflow.Werner Lemberg
Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66543
2024-01-27Update all copyright notices.Alexei Podtelezhnikov
2024-01-27* src/sfnt/ttgpos.c (tt_gpos_get_glyph_class): Fix warning C4018.Alexei Podtelezhnikov
2024-01-27Add support for kerning from 'GPOS' tables.David Saltzman
This commit adds support for kerning from 'GPOS' tables, while maintaining support for basic 'kern' tables. `FT_HAS_KERNING` will be true for a font with either available and `FT_Get_Kerning` will still use the basic 'kern' table data if avilable, otherwise check the GPOS 'kern' feature. This feature is disabled by default; it can be enabled with the `TT_CONFIG_OPTION_GPOS_KERNING` flag. Only basic kerning (pair positioning with just an x advance) is supported from the GPOS layout features; support for that was added to make the existing `FT_Get_Kerning` API more consistently functional. FreeType does not intend to extend itself to further GPOS functionality though; a higher-level library like HarfBuzz can be used instead for that. * include/freetype/config/ftoption.h, include/devel/ftoption.h (TT_CONFIG_OPTION_GPOS_KERNING): New configuration option. * include/freetype/internal/fttrace.h: Add `ttgpos` trace handler. * include/freetype/internal/sfnt.h (SFNT_Interface): Add `load_gpos` and `get_gpos_kerning` fields. (FT_DEFINE_SFNT_INTERFACE): Updated. * include/freetype/internal/tttypes.h: Include `fttypes.h`. (TT_FaceRec) [TT_CONFIG_OPTION_GPOS_KERNING]: Add `gpos_table` and `gpos_kerning_available` fields. * src/sfnt/ttgpos.c, src/sfnt/ttgpos.h: New files. * src/sfnt/sfdriver.c [TT_CONFIG_OPTION_GPOS_KERNING]: Include `ttgpos.h`. (sfnt_interface): Updated. * src/sfnt/sfnt.c: Include `ttgpos.c`. * src/sfnt/sfobjs.c [TT_CONFIG_OPTION_GPOS_KERNING]: Include `ttgpos.h`. (sfnt_load_face) [TT_CONFIG_OPTION_GPOS_KERNING]: Load and free GPOS kerning data; check GPOS kerning availability. * src/truetype/ttdriver.c (tt_get_kerning): Use GPOS kerning if there's no 'kern' table.
2024-01-14[smooth] Remove SSE2.Alexei Podtelezhnikov
As a result of 7b308a29dd10, the regular 64-bit execution is now faster than SSE2. The rendering speed of script fonts at 64 ppem or larger is improved by about 3% without SSE2. See !314 for the testing results. * src/smooth/ftgrays.c (gray_render_conic)[FT_INT64]: Remove SSE2 code.
2024-01-13* CMakeLists.txt: Accommodate MingGW.Alexei Podtelezhnikov
See https://github.com/StephanTLavavej/mingw-distro/issues/97.
2024-01-08* src/sfnt/ttcolr.c (find_base_glyph_v1_record): Fix build in C90 mode.Ozkan Sezer
2024-01-06[base] Fix up Mac resource forks and dfonts.Alexei Podtelezhnikov
* src/base/ftobjs.c (IsMacResource): Assign `face_index`. * src/base/ftmac.c (FT_New_Face_From_Suitcase): Ditto after rework.
2024-01-04[sfnt] Restrict POST version 1.0.Alexei Podtelezhnikov
A font has surfaced with `post` version 1.0 and fewer than 258 glyphs. Its glyphs did not correspond to their names. We now reject such `post` strictly following specifications. * src/sfnt/ttpost.c (tt_face_get_ps_name): Check the number of glyphs for version 1.0.
2024-01-03* .gitlab-ci.yml: Use detached CI pipelines. Alexei Podtelezhnikov
See issue freedesktop/freedesktop#540.
2024-01-02[sfnt] Guard access in 'COLR' v1 glyph binary search.Werner Lemberg
Reported as https://bugs.chromium.org/p/chromium/issues/detail?id=1505216 * src/sfnt/ttcolr.c (find_base_glyph_v1_record): Guard access of the search pointer during binary search. The pointer needs to be checked as we go as the test that compares number of v1 glyphs with table size at the time of loading the table is not sufficient on its own. A scenario is possible in which the `BaseGlyphRecord` list extends into non-`BaseGlyphRecord` parts of the 'COLR' v1 table (but passed the size comparison check). Then, at those locations, invalid glyph ID values are read and may provoke an invalid read due to reassigning min and max values during the binary search.
2023-12-18[ci] Add support for MSBuild on Windows.Alexei Podtelezhnikov
This adds msbuild job for VS2019 (x64). * .gitlab-ci.yml: Added "windows msbuild vs2019 amd64".
2023-12-14[CFF] Extract `BlueValues` as `Fixed` rather than `Int`.Skef Iterum
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[psaux] Improve tracing.Skef Iterum
* src/psaux/psintrp.c (cf2_doBlend, cf2_interpT2CharString [cf2_cmdBLEND]): Show blended values.
2023-12-14* vms_make.com: Switch to `clang`.Jouk Jansen
Also add proper bzip2 support.
2023-12-14* src/truetype/ttgxvar.c (ft_var_to_normalized): Fix undefined left-shift.Werner Lemberg
Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=63723
2023-12-06[msbuild] Streamline the process.Alexei Podtelezhnikov
MSBuild.exe can now be fired from the root folder without options. * builds/windows/vc2010/freetype.sln: Relocated to... * MSBuild.sln: ... here with minor changes. * MSBuild.rsp: New file with command line options. * docs/INSTALL: Reference `MSBuild.sln`.
2023-12-01* src/raster/ftraster.c (Draw_Sweep): Swap stub conditions.Alexei Podtelezhnikov
2023-12-01* src/raster/ftmisc.h (FT_MulDiv): Remove unused copy.Alexei Podtelezhnikov
2023-11-27[raster] Speed up Bézier arches with extrema.Alexei Podtelezhnikov
While it is recommended to have an explicit point at each curve extrema, they might be missing or outline could be rotated. This leads to excessive bisections in raster to find them. This change helps to decrease the number of bisections. The scanline intersections remain monotonous, of course. * src/raster/ftraster.c (Conic_To, Cubic_To): Check that control points cross the scanlines to bisect.
2023-11-25* docs/*: Typos.Alexei Podtelezhnikov
2023-11-24[raster] Eliminate intensive flow checking.Alexei Podtelezhnikov
* src/raster/ftraster.c (Draw_Sweep): Pass the flow increment. (Increment): Accept the flow increment.
2023-11-23* src/raster/ftraster.c: Comments, defines, includes, cleanups.Alexei Podtelezhnikov
2023-11-21* src/raster/ftraster.c (FT_Outline_Get_CBox ) [STANDALONE_]: Removed.Alexei Podtelezhnikov
2023-11-21* src/raster/ftraster.c (Draw_Sweep): No-fault return. Alexei Podtelezhnikov
(Render_Single_Pass): Updated.
2023-11-21[raster] Sweep polishing. Alexei Podtelezhnikov
* src/raster/ftraster.c (*_Sweep_Span): Polish. (*_Sweep_Drop): Restore tracing, polish. (Draw_Sweep): Simplify the dropout processing loop.
2023-11-21[raster] Rearrange dropout control.Alexei Podtelezhnikov
This reduces the code duplication. * src/raster/ftraster.c (Function_Sweep_Span): Change signature. (Vertical_Sweep_Drop, Horizontal_Sweep_Drop): Focus on pixel setting and move duplicated the dropout control logic to... (Draw_Sweep): ... this function and refactor. (Vertical_Sweep_Span, Horizontal_Sweep_Span): Minor.
2023-11-20[raster] Use bitwise dropout mode interpretation.Alexei Podtelezhnikov
* src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop, Draw_Sweep, Render_GLyph): Interpret dropout mode using bit masks.
2023-11-16* docs/CHANGES: Updated.Alexei Podtelezhnikov
2023-11-15[raster] Keep only bottom y-turns.Alexei Podtelezhnikov
This results in noticeable performance improvement. * src/raster/ftraster.c (Insert_Y_Turns): All bottom y-turns are still sorted and stored; only the maximum top y-turn is recorded now. The function is renamed. (End_Profile): Updated accordingly. (Convert_Glyph): Reserve space for the top value.
2023-11-15* src/raster/ftraster.c (End_Profile): Reduce branching. Alexei Podtelezhnikov
(InsNew): Tweak condition.
2023-11-15* src/raster/ftraster.c (Draw_Sweep): Use more natural loop.Alexei Podtelezhnikov
2023-11-14[raster] Dissolve a loop.Alexei Podtelezhnikov
* src/raster/ftraster.c (End_Profile): Set initial `X` here... (Draw_Sweep): ... instead of here; delay the `start` decrement.
2023-11-14* src/raster/ftraster.c: Comments.Alexei Podtelezhnikov
2023-11-14[raster] Stylistic changes. Alexei Podtelezhnikov
* src/raster/ftraster.c (Line_To): Code it similar to curves; shortcut the flat lines here... (Line_Up): ... instead of here.
2023-11-14[raster] Revise overshoot setting. Alexei Podtelezhnikov
* src/raster/ftraster.c (New_Profile, End_Profile): Deal with overshoots locally. (Line_To, Conic_To, Cubic_To): Update callers.
2023-11-14* src/raster/ftraster.c (Conic_To, Cubic_To): Fix recent regression.Alexei Podtelezhnikov
2023-11-13* include/freetype/ftimage.h: Fix type and link.Alexei Podtelezhnikov
2023-11-13* src/raster/ftraster.c (Increment): Minor tweak.Alexei Podtelezhnikov
2023-11-12[raster] Get rid of the fresh flag.Alexei Podtelezhnikov
* src/raster/ftraster.c (black_TWorker): Remove the fresh flag. (New_Profile): Set the starting scanline here based on the current coordinate and initialize the joint crossing if necessary. (Line_Up, Bezier_Up): Do not deal with fresh and joint starts at all. (Line_Down, Bezier_Down): Simplify. (Conic_To, Cubic_To): Update the current coordinate after each subsection.
2023-11-11[raster] Get rid of the joint flag.Alexei Podtelezhnikov
* src/raster/ftraster.c (Line_Up, Bezier_Up): Deal with the scanline joints directly based on the initial y-coordinate. (New_Profile, black_TWorker): Remove the boolean flag.
2023-11-11* src/raster/ftraster.c (Line_Up, Bezier_Up): Check "between" earlier.Alexei Podtelezhnikov
2023-11-10* src/raster/ftraster.c (Line_Up): Updated and fixed up.Alexei Podtelezhnikov
This largely synchronizes the entries into `Line_Up` and `Bezier_Up`. Minor bugs in the remainder calculations and accumulations are fixed.
2023-11-09* src/raster/ftraster.c (End_Profile, Convert_Glyph): Clean up.Alexei Podtelezhnikov
2023-11-09* src/raster/ftraster.c (Bezier_Up): Improve joint and loop.Alexei Podtelezhnikov
2023-11-06[raster] Harmonize target bitmap navigation.Alexei Podtelezhnikov
* src/raster/ftraster.c (black_TWorker): Store signed maximum indexes in both directions instead of unsigned dimensions of the original bitmap. (*_Sweep_*, Render_Glyph, ft_black_render): Updated all users.
2023-11-05* src/raster/ftraster.c (Bezier_Up): Improve flow.Alexei Podtelezhnikov
2023-11-05[raster] Reshuffle code for readability.Alexei Podtelezhnikov
* src/raster/ftraster.c (Render_Glyph): Setup the rendering pool here. (ft_black_render): Setup the target bitmap helpers here.
2023-11-03[raster] Improve profile accounting during sweeping.Alexei Podtelezhnikov
* src/raster/ftraster.c (TProfile): Get rid of `countL`. (Draw_Sweep): Use `start` for countdown to activation. (Horizontal_Sweep_Drop, Vertical_Sweep_Drop): Rely on `height` and `offset` to verify profile ends for the stub detection.