summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Add new load flag `FT_LOAD_NO_SVG`.Werner Lemberg2023-05-151-4/+9
| | | | | | | | | | | | | | Modern color fonts often contain both an 'SVG' and 'COLR' table. FreeType always preferred 'SVG' over 'COLR' (this was a design decision), however, this might not be the right choice for the user. The new flags makes FreeType ignore the 'SVG' table while loading a glyph. Fixes #1229. * include/freetype/freetype.h (FT_LOAD_NO_SVG): New macro. * src/base/ftobjs.c (FT_Load_Glyph), src/cff/cffgload.c (cff_slot_load), src/truetype/ttgload.c (TT_Load_Glyph): Use it.
* * include/freetype/ftcache.h: Typo, punctuation.Werner Lemberg2023-05-121-10/+9
|
* * include/freetype/ftcache.h: Formatted and updated.Alexei Podtelezhnikov2023-05-111-42/+43
|
* * include/freetype/internal/t1types.h: Fix the indentation.suzuki toshiya2023-05-121-13/+13
|
* [truetype] Fix style name handling for variation fonts.Werner Lemberg2023-05-061-0/+5
| | | | | | | | | | | * include/freetype/internal/tttypes.h (TT_FaceRec): New field `non_var_style_name`. * src/sfnt/sfobjs.c (sfnt_load_face): Initialize `non_var_style_name`. (sfnt_done_face): Free `non_var_style_name`. * src/truetype/ttgxvar.c (TT_Set_Named_Instance): Restore non-VF style name if switching back to non-VF mode.
* [truetype] Fix PostScript name handling for variation fonts.Werner Lemberg2023-05-061-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A variation font's PostScript name of a named instance is usually different from the PostScript name of an unnamed instance. However, if a change between a named instance and an unnamed instance with exactly the same design axis values happened, it was possible that the PostScript name wasn't correctly updated. This commit reorganizes the code to handle this issue within the top-level API functions, using a new service to trigger recomputation of the PostScript name. * include/freetype/internal/services/svmm.h (FT_Construct_PS_Name_Func): New typedef. (FT_Service_MultiMasters): New field `construct_ps_name`. (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated. * src/base/ftmm.c (FT_Set_Var_Design_Coordinates, FT_Set_MM_Blend_Coordinates, FT_Set_Var_Blend_Coordinates): Call `mm->construct_ps_name` to handle `postscript_name`. (FT_Set_Named_Instance): Call `mm->construct_ps_name` to handle `postscript_name`. Use shortcut. * src/cff/cffdrivr.c (cff_construct_ps_name): New function. (cff_service_multi_masters): Updated. * src/truetype/ttgxvar.c (tt_set_mm_blend): Don't handle `postscript_name`. (TT_Set_MM_Blend): Simplify. (TT_Set_Named_Instance): Return -1 if axis values haven't changed. Don't set `face_index`. (tt_construct_ps_name): New function. * src/truetype/ttgxvar.h: Updated. * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated. * src/type1/t1driver.c (t1_service_multi_masters): Updated. * src/type1/t1load.c (T1_Set_MM_Blend): Simplify.
* * include/freetype/internal/services/svmm.h: Minor changes.Werner Lemberg2023-05-061-5/+5
|
* [truetype] Fix deactivation of variation font handling.Werner Lemberg2023-05-061-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the documentation, the functions `FT_Set_Named_Instance`, `FT_Set_MM_Design_Coordinates`, `FT_Set_Var_Design_Coordinates`, and `FT_Set_Var_Blend_Coordinates` can unset the `FT_FACE_FLAG_VARIATION` flag. (The same is true for `FT_Set_MM_WeightVector` but this information was accidentally omitted from the documentation.) However, if a call of these functions didn't change the axis values this could fail because internal shortcuts exited too early. This commit reorganizes the code to handle `FT_FACE_FLAG_VARIATION` in the top-level API functions, also taking care of the issue at hand. * src/base/ftmm.c (FT_Set_MM_Design_Coordinates, FT_Set_MM_WeightVector, FT_Set_Var_Design_Coordinates, FT_Set_MM_Blend_Coordinates, FT_Set_Var_Blend_Coordinates): Handle `FT_FACE_FLAG_VARIATION`. * src/truetype/ttgxvar.c (TT_Set_MM_Blend, TT_Set_Var_Design, TT_Set_Named_Instance) Don't handle `FT_FACE_FLAG_VARIATION`. * src/type1/t1load.c (T1_Set_MM_Blend, T1_Set_MM_WeightVector, T1_Set_MM_Design): Ditto. * src/cff/cffobjs.c (cff_face_init): Use `FT_Set_Named_Instance` instead of low-level functions. * src/truetype/ttobjs.c (tt_face_init): Ditto.
* s/set_instance/set_named_instance/Werner Lemberg2023-05-061-5/+5
| | | | | | | | | | | | | | | | | | | * include/freetype/internal/services/svmm.h (FT_Set_Instance_Func): Renamed to... (FT_Set_Named_Instance_Func): ...this. (FT_Service_MultiMasters): Rename `set_instance` to `set_named_instance`. (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated. * src/base/ftmm.c (FT_Set_Named_Instance): Updated. * src/cff/cffdrivr.c (cff_set_instance): Renamed to... (cff_set_named_instance): ...this. (cff_service_multi_masters): Updated. * src/cff/cffobjs.c (cff_face_init): Updated. * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated. * src/type1/t1driver.c (t1_service_multi_masters): Updated.
* New Variation Font function `FT_Get_Default_Named_Instance`.Werner Lemberg2023-05-063-37/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/freetype/ftmm.h, src/base/ftmm.c (FT_Get_Default_Named_Instance): New function. * include/freetype/internal/services/svmm.h (FT_Get_Default_Named_Instance_Func): New typedef. (FT_Service_MultiMasters): New field `get_default_named_instance`. (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated. * include/freetype/internal/tttypes.h (TT_Face): New field `var_default_named_instance`. * src/sfnt/sfobjc.s (sfnt_init_face): Initialize `var_default_named_instance`. * src/cff/cffdrivr.c (cff_get_default_named_instance): New function. (cff_service_multi_masters): Updated. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Initialize `var_default_named_instance`. (TT_Get_Default_Named_Instance): New function. * src/truetype/ttgxvar.h: Updated. * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated. * src/type1/t1driver.c (t1_service_multi_masters): Updated. * docs/CHANGES: Updated.
* [cid] Improve tracing messages; formatting.Werner Lemberg2023-05-061-0/+1
|
* API documentation: Re-organize chapters and sectionsWerner Lemberg2023-04-302-118/+412
| | | | | | | * Split the very long 'Base Interface' section into smaller sections. * Split the 'Core API' chapter into two chapters. * Remove single enumeration values from `@order` fields since they have no effect.
* Minor documentation updates.Werner Lemberg2023-04-282-21/+30
|
* s/this is,/that is,/Werner Lemberg2023-04-274-11/+11
|
* Improve/add source comments and documentation.Werner Lemberg2023-04-251-7/+5
|
* [services] FT_Size_Reset_Func to return FT_ErrorBen Wagner2023-04-191-1/+1
| | | | | | | | | | | | | | The `MetricsVariations` `FT_Size_Reset_Func` is currently defined to return `void`, but the implementations return `FT_Error`. Even though the pointers passed will be the same at runtime, calling a function through a pointer of a different type from the original function pointer type is undefined behavior. This may be caught at runtime by Control Flow Integrity with something like clang's `cfi-icall`. Issue: https://crbug.com/1433651 * include/freetype/internal/services/svmetric.h (FT_Size_Reset_Func): return `FT_Error` instead of `void`.
* [sfnt, truetype] Add `size_reset` to `MetricsVariations`.Ben Wagner2023-04-112-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a generalization of commit ``` commit e6699596af5c5d6f0ae0ea06e19df87dce088df8 Author: Werner Lemberg <wl@gnu.org> Date: Thu Feb 2 11:38:04 2017 +0100 [truetype] Fix MVAR post-action handling. ``` It is also possible for plain `CFF ` style fonts to contain an `fvar` and `MVAR` table and use `cff_metrics_adjust`. `tt_size_reset` should only be called with `TT_Size` and never with `CFF_Size`. Allow the "metrics-variations" service to specify the correct function (if any) to reset `FT_Size`s after adjusting metrics. * src/truetype/ttobjs.c (tt_size_reset): Split off some functionality into... (tt_size_reset_height): ... this new function. * src/truetype/ttdriver.c (tt_service_metrics_variations): Add `size_reset`. (tt_size_select, tt_size_request): Updated. * src/truetype/ttobjs.h: Updated. * include/freetype/internal/services/svmetric.h (MetricsVariations): Add `size_reset`. (FT_DEFINE_SERVICE_METRICSVARIATIONSREC): Updated. * include/freetype/internal/tttypes.h (TT_FaceRec_): Rename `var` to `tt_var` and add `face_var`. * src/cff/cffdrivr.c (cff_service_metrics_variations): Add `size_reset`. (cff_hadvance_adjust, cff_metrics_adjust): Updated. * src/cff/cffobjs.c (cff_face_init): Use `face_var`. * src/sfnt/sfobjs.c (sfnt_init_face): Initialize `face_var`. * src/sfnt/ttmtx.c (tt_face_get_metrics): Use `tt_var`. * src/truetype/ttgxvar.c (tt_size_reset_iterator): Renamed to... (ft_size_reset_iterator): ... this new function. Call `size_reset`. (tt_apply_mvar): Pass `size_reset` to `ft_size_reset_iterator`. Fixes #1211
* Align `char_next` return types.Alexei Podtelezhnikov2023-04-101-1/+1
| | | | | | | This is mostly cosmetic because FT_UInt and FT_UInt32 are likely identical. * src/sfnt/ttcmap.c, src/cff/cffcmap.c, src/psaux/t1cmap.c, src/psnames/psmodule.c, include/freetype/internal/service/svpcsmap.h, src/pfr/pfrcmap.c, src/winfonts/winfnt.c (*_char_next): return FT_UInt.
* [sfnt] Consolidate POST version 2.0 and 2.5 (pt 1).Alexei Podtelezhnikov2023-04-011-60/+7
| | | | | | | | | | | The deprecated POST version 2.5 can be handled using the data structures of version 2.0. The goal is to reduce the footprint. * include/freetype/internal/tttypes.h (TT_Post_Names): Absorb and... (TT_Post_20, TT_Post_25): ... remove these structures. src/sfnt/ttpost.c (load_post_names, tt_face_get_ps_name, tt_face_free_ps_names, load_format_20): Updated accordingly. (load_format_25): ditto and convert offsets to glyph indices.
* [sfnt] Streamline POST format 2.0 handing (cont'd).Alexei Podtelezhnikov2023-03-291-1/+1
| | | | | | | * src/sfnt/ttpost.c (load_format_20): Co-allocate the string data and their pointers, which makes it easier to handle and free them. (tt_face_free_ps_names): Updated. * include/freetype/internal/tttypes.h (TT_Post_20): Update type.
* * include/freetype/ftsystem.h (FT_Stream_IoFunc): Improve documentation.Werner Lemberg2023-03-161-12/+4
| | | | Fixes #1208.
* * src/base/ftsynth.c (FT_GlyphSlot_AdjustWeight): New API.Alexei Podtelezhnikov2023-03-161-0/+12
|
* * include/freetype/internal/compiler-macros.h (FALL_THROUGH): Update.Werner Lemberg2023-03-011-1/+1
| | | | | | This follows https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00200.html
* [truetype] Treat 38 as 40 without Infinality.Alexei Podtelezhnikov2023-02-271-1/+1
| | | | | * include/freetype/ftdriver.h (TT_INTERPRETER_VERSION_38): Reinstate. * src/truetype/ttdriver.c (tt_property_set): Fallback from 38 to 40.
* * include/freetype/internal/compiler-macros.h (FALL_THROUGH): Update.Werner Lemberg2023-02-261-2/+5
| | | | | | This follows https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00159.html
* [truetype] Hide Infinality.Alexei Podtelezhnikov2023-02-172-46/+10
| | | | | | | | Remove Infinality as an option before its complete extraction. * include/freetype/ftoption.h: Remove the Infinality option. * devel/ftoption.h: Ditto. * include/freetype/ftdriver.h (TT_INTERPRETER_VERSION_38): Is 40 now.
* Documentation improvement for `FT_Bitmap`.Werner Lemberg2023-02-161-1/+7
| | | | Fixes #1205.
* [type1/MM] Round design coordinates.Alexei Podtelezhnikov2023-02-101-5/+5
| | | | | | | | | | The design coordinates for MM fonts were not rounded. For example, `FT_Get_Var_Design_Coordinates` returned values with fractional part. * src/type1/t1load.c (mm_axis_unmap): Refactor with rounding. * include/freetype/ftmm.h (FT_Var_Axis, FT_Set_Var_Design_Coordinates, FT_Get_Var_Design_Coordinates): Reword documentation.
* * Version 2.13 released.VER-2-13-0Werner Lemberg2023-02-092-3/+3
| | | | | | | | | | | | | | | | | | | | | ========================== Tag sources with `VER-2-13-0'. * docs/VERSION.TXT: Add entry for version 2.13. * docs/CHANGES: Updated. * README, src/base/ftver.rc, builds/windows/vc2010/index.html, builds/windows/visualc/index.html, builds/windows/visualce/index.html, builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html, docs/freetype-config.1: s/2.12.1/2.13/, s/2121/2130/. * include/freetype/freetype.h (FREETYPE_MINOR): Set to 13. (FREETYPE_PATCH): Set to 0. * builds/unix/configure.raw (version_info): Set to 25:0:19. * CMakeLists.txt (VERSION_MINOR): Set to 13. (VERSION_PATCH): Set to 0.
* Comment on `FT_GlyphSlot_Slant'.Alexei Podtelezhnikov2023-02-091-1/+3
|
* Fix 'fall-through' warning messages.Werner Lemberg2023-02-081-0/+13
| | | | | | | Modern compilers get more insistent on that... * include/freetype/internal/compiler-macros.h (FALL_THROUGH): Define. * src/*: Use it instead of `/* fall through */` comments.
* Avoid reserved identifiers that are globally defined.Werner Lemberg2023-02-082-10/+10
| | | | | | | | | | | This is mandated by the C99 standard, and clang 15 produces zillions of warnings otherwise. * devel/ftoption.h, include/freetype/config/ftoption.h, include/freetype/internal/ftmemory.h, src/autofit/afhints.h, src/autofit/afmodule.c, src/autofit/aftypes.h, src/base/ftadvanc.c, src/base/ftdbgmem.c, src/base/ftstream.c, src/bdf/bdflib.c, src/truetype/ttinterp.c: Replace identifiers of the form `_foo` with `foo_`.
* * src/base/ftsynth.c (FT_GlyphSlot_Slant): Add vertical slant.Alexei Podtelezhnikov2023-02-071-2/+4
| | | | * include/freetype/ftsynth.h (FT_GlyphSlot_Slant): Update it.
* Comment on optional ascender and descender.Alexei Podtelezhnikov2023-02-041-2/+2
|
* The 'COLR' v1 API will no longer be experimental in the next release.Werner Lemberg2023-01-191-90/+33
|
* Update all copyright notices.Werner Lemberg2023-01-1797-97/+97
|
* [sfnt] Remove temporary runtime flag for variable 'COLR' v1.Dominik Röttsches2023-01-161-46/+3
| | | | | | | | | | | | | | | Fixes #1187. * src/sfnt/ttcolr.c (top level, read_paint, tt_face_load_colr, tt_face_free_colr, get_deltas_for_var_index_base, tt_face_get_color_glyph_clipbox, tt_face_get_colorline_stops): Remove macro definition `VARIABLE_COLRV1_ENABLED` and its usage. * src/truetype/ttdriver.c (tt_property_set): Remove parsing of 'TEMPORARY-enable-variable-colrv1' property name. * src/truetype/ttobjs.h (TT_DriverRec): Remove `enable_variable_colrv1` flag.
* * include/freetype/internal/ftcalc.h (FT_MSB): Support Open Watcom 2.0.Jiří Malák2022-12-061-5/+5
| | | | Closes !232.
* Add `TT_CONFIG_OPTION_NO_BORING_EXPANSION` configuration macro.Dominik Röttsches2022-11-121-0/+18
| | | | | | | | | | | This gives users a possibility to deactivate new features not (yet) in the OpenType standard. * include/freetype/config/ftoption.h, devel/ftoption.h (TT_CONFIG_OPTION_NO_BORING_EXPANSION): New macro. * src/truetype/ttgxvar.c (ft_var_load_avar): Use it to disable 'avar' version 2.0 support.
* [build] fix for make multisuzuki toshiya2022-11-081-0/+1
| | | | | | | | Fix "make multi" by MR !223 * include/freetype/internal/services/svmm.h: include ftmm.h to define FT_Get_MM_Func. * src/truetype/ttgxvar.h: include ftmmtypes.h to use GX_AVarTable properly. * src/base/ftmac.c: include ftdebug.h to use FT_THROW() properly.
* Replace '1/64th' (and similar entries) with '1/64' in docs and comments.Werner Lemberg2022-10-246-11/+11
|
* * include/freetype/*: Fix documentation typos.Ivan Panchenko2022-10-243-18/+17
|
* * src/base/ftsynth.c (FT_GlyphSlot_Slant): New API with custom slant.Liu Kunpeng(柳鲲鹏)2022-10-161-1/+6
| | | | * include/freetype/ftsynth.h (FT_GlyphSlot_Slant): Declare it.
* Note the lack of floating-point data types.Alexei Podtelezhnikov2022-10-142-2/+6
|
* [cff] Remove `FT_CONFIG_OPTION_NO_GLYPH_NAMES`.Werner Lemberg2022-10-101-8/+12
| | | | | | | | | This ancient option stayed completely undocumented. Given that the 'cff' driver requires the 'psnames' module, it makes no sense today to have this macro. * src/cff/cffdrivr.c (cff_services), src/cff/cffobjs.c (cff_face_init): Remove corresponding conditional code.
* Minor comment changes.Werner Lemberg2022-10-101-4/+4
|
* Improve FT_Get_Name_Index docs and place it next to FT_Get_Glyph_Name.Alexei Podtelezhnikov2022-10-041-94/+96
|
* [base] FT_Attach_Stream: Make `parameters` argument constant.Ali Chraghi2022-09-291-2/+2
|
* [psaux] Remove unused structure field.Alexei Podtelezhnikov2022-07-311-4/+0
| | | | | * include/freetype/internal/psaux.h (PS_TableRec): Remove `num_elems`. * src/psaux/psobjs.c (ps_table_new): Remoove its initialization.
* * src/base/ftglyph.c (FT_Get_Glyph): Set `*aglyph` to NULL in case of error.Werner Lemberg2022-07-291-3/+3
|