summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [cache] Revise the hash table accounting.ftc_resizeAlexei Podtelezhnikov2023-05-092-51/+35
| | | | | | | | | | | Instead of counting entries relative to the middle of the hash table, this switches to the absolute counter with the full index range mask. As a result, some calculations become a bit simpler. * src/cache/ftccache.h (FTC_NODE_TOP_FOR_HASH): Revised. * src/cache/ftccache.c (ftc_get_top_node_for_hash): Ditto. (ftc_cache_resize, ftc_cache_init, FTC_Cache_Clear, FTC_Cache_RemoveFaceID): Updated accordingly.
* * src/smooth/ftgrays.c (FT_SSE2): Don't define for VMS.Jouk Jansen2023-05-091-3/+3
|
* * src/cff/cffdrivr.c (cff_glyph_load): Fix guard for `size`.Werner Lemberg2023-05-081-1/+1
| | | | | | | | This was forgotten to change in commit 2b54eba36b (in May 2004). Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58739
* Minor compiler warning fixes.Werner Lemberg2023-05-083-5/+5
| | | | | | | * src/autofit/afcjk.c (af_cjk_get_standard_widths), src/autofit/aflatin.c (af_latin_get_standard_widths): Use `FT_CALLBACK_DEF`. * src/cff/cffparse.c (cff_parser_run): Initialize and fix allocation of `q`.
* * src/psaux/t1cmap.c: Signature fixes.Werner Lemberg2023-05-081-58/+77
|
* * src/bzip2/ftbzip2.c: Signature fixes.Werner Lemberg2023-05-081-7/+12
|
* [cache] Signature fixes.Werner Lemberg2023-05-085-58/+5
| | | | | | | | | | | | * src/cache/ftcglyph.c, src/cache/ftcglyph.h (FTC_GNode_Compare): Remove redundant function. It is equivalent to `ftc_gnode_compare` and becomes completely meaningless with fixed signatures. Update all callers. * src/cache/ftcsbits.c, src/cache/ftcsbits.h (FTC_SNode_Compare): Remove redundant function. It is equivalent to `ftc_snode_compare` and becomes completely meaningless with fixed signatures. Update all callers.
* [sdf] Signature fixes.Werner Lemberg2023-05-073-10/+17
|
* * src/svg/ftsvg.c: Signature fixes.Werner Lemberg2023-05-071-9/+14
|
* [raster] Signature fixes.Werner Lemberg2023-05-072-5/+12
|
* [smooth] Signature fixes.Werner Lemberg2023-05-072-12/+36
|
* [pshinter] Signature fixes.Werner Lemberg2023-05-072-14/+58
| | | | | | | | * src/pshinter/pshrec.c (t1_hints_close, t1_hints_apply): New wrapper functions. (t1_hints_funcs_init): Use them. (t2_hints_close, t2_hints_apply): New wrapper functions. (t2_hints_funcs_init): Use them.
* [autofit] Signature fixes.Werner Lemberg2023-05-079-59/+88
|
* * src/sfnt/ttcmap: Signature fixes.Werner Lemberg2023-05-071-182/+239
|
* * src/pcf/pcfdrivr.c: Signature fix.Werner Lemberg2023-05-071-1/+1
|
* * src/winfonts/winfnt.c: Signature fixes.Werner Lemberg2023-05-071-17/+21
|
* * src/type42/t42parse.c: Signature fixes.Werner Lemberg2023-05-071-42/+50
|
* [pfr] Signature fixes.Werner Lemberg2023-05-072-48/+58
|
* * src/cid/cidload.c: Signature fixes.Werner Lemberg2023-05-071-21/+30
|
* * src/cff/cffcmap.c: Signature fixes.Werner Lemberg2023-05-071-35/+46
|
* * src/type1/t1load.c: Signature fixes.Werner Lemberg2023-05-071-61/+85
|
* [truetype] Signature fixes.Werner Lemberg2023-05-072-2/+4
|
* [base] Signature fixes.Werner Lemberg2023-05-072-22/+40
|
* * src/type42/t42drivr.c: Clean up interface.Werner Lemberg2023-05-071-16/+27
| | | | | | | Ensure that all driver functions use the signature of the service or driver. This avoids pointer mismatches, which are technically undefined behaviour. Recent compilers are more picky in catching them as part of Control Flow Integrity tests.
* * src/type1/*: Clean up interface.Werner Lemberg2023-05-074-52/+67
| | | | | | | Ensure that all driver functions use the signature of the service or driver. This avoids pointer mismatches, which are technically undefined behaviour. Recent compilers are more picky in catching them as part of Control Flow Integrity tests.
* * src/truetype/*: Clean up interface.Werner Lemberg2023-05-077-198/+220
| | | | | | | Ensure that all driver functions use the signature of the service or driver. This avoids pointer mismatches, which are technically undefined behaviour. Recent compilers are more picky in catching them as part of Control Flow Integrity tests.
* * src/sfnt/sfdriver.c, src/sfnt/ttbdf.c: Clean up interface.Werner Lemberg2023-05-073-44/+66
| | | | | | | | | | Ensure that all driver functions use the signature of the service or driver. This avoids pointer mismatches, which are technically undefined behaviour. Recent compilers are more picky in catching them as part of Control Flow Integrity tests. * src/sfnt/sfdriver.c (sfnt_load_table): New wrapper function. (sfnt_service_sfnt_table): Use it.
* * src/psnames/psmodule.c: Use `FT_CALLBACK_DEF`.Werner Lemberg2023-05-071-6/+6
|
* * src/pfr/pfrdrivr.c: face -> pfrface, pfrface -> face.Werner Lemberg2023-05-071-13/+13
|
* * src/pcf/pcfdrivr.c: Clean up interface.Werner Lemberg2023-05-071-58/+62
| | | | | | | Ensure that all driver functions use the signature of the service or driver. This avoids pointer mismatches, which are technically undefined behaviour. Recent compilers are more picky in catching them as part of Control Flow Integrity tests.
* * src/cid/cidriver.c: Clean up interface.Werner Lemberg2023-05-071-20/+24
| | | | | | | Ensure that all driver functions use the signature of the service or driver. This avoids pointer mismatches, which are technically undefined behaviour. Recent compilers are more picky in catching them as part of Control Flow Integrity tests.
* * src/bdf/bdfdrivr.c: Clean up interface.Werner Lemberg2023-05-071-56/+60
| | | | | | | Ensure that all driver functions use the signature of the service or driver. This avoids pointer mismatches, which are technically undefined behaviour. Recent compilers are more picky in catching them as part of Control Flow Integrity tests.
* * src/cff/*: Clean up interface.Werner Lemberg2023-05-074-155/+173
| | | | | | | Ensure that all driver functions use the signature of the service or driver. This avoids pointer mismatches, which are technically undefined behaviour. Recent compilers are more picky in catching them as part of Control Flow Integrity tests.
* [truetype] Fix style name handling for variation fonts.Werner Lemberg2023-05-063-2/+25
| | | | | | | | | | | * 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-068-38/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-066-46/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-066-14/+18
| | | | | | | | | | | | | | | | | | | * 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-0611-91/+249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-063-49/+56
|
* * src/cache/ftccache.c (ftc_node_hash_unlink): Minor.Alexei Podtelezhnikov2023-05-041-1/+1
|
* * src/cache/ftcmru.c (FTC_MruList_RemoveSelection): Purge backwards.Alexei Podtelezhnikov2023-05-031-5/+5
|
* [cache] Revise list cleansing.Alexei Podtelezhnikov2023-05-032-42/+28
| | | | | | | * src/cache/ftcmru.c (FTC_MruList_RemoveSelection): Use one loop to do it. * src/cache/ftcmanag.c (FTC_Manager_Compress, FTC_Manager_FlushN): Streamline loops.
* [t1cid] Improve cid_get_cid_from_glyph_index().suzuki toshiya2023-05-033-59/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Update cid_get_cid_from_glyph_index() to return an error and CID=0 in the case that the specified glyph index points to an invalid entry. cidgload.h (cid_compute_fd_and_offsets): Declare new helper function to set the fd_select and 2 offsets to access the glyph description data. cidgload.c (cid_compute_fd_and_offsets): Move the part loading fd_select and 2 offsets from cid_load_glyph() to here. If the loaded parameters are broken, return the Invalid_Offset error. This function does not load the glyph data, only fills these parameters. (cid_load_glyph): Use new helper function in above. cidriver.c (cid_get_cid_from_glyph_index): Check whether the requested glyph index points to a valid entry, by calling cid_compute_fd_and_offsets(). If it is valid, fill the cid by the glyph index (=CID). If it is invalid, return an error and fill the cid by 0.
* 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.
* * src/sfnt/pngshim.c (Load_SBit_Png): Remove FALL_THROUGH warning.Alexei Podtelezhnikov2023-04-281-4/+1
|
* * src/sfnt/ttload.c (tt_face_load_font_dir): Add another guard.Werner Lemberg2023-04-281-0/+7
| | | | Reject 'OTTO' fonts with no valid tables.
* * src/cff/cffdrivr/c (cff_get_ps_name): Avoid unnecessary crash.Werner Lemberg2023-04-281-1/+1
| | | | | | | | | The situation can happen if `FT_New_Face` (or one of its siblings) is called with a negative index to get the number of contained faces, followed immediately by a call to `FT_Get_Postscript_Name`. While this is not a valid use of the FreeType library there is no need for a crash. Fixes #1219.
* * src/cff/cffdrivr.c (cff_ps_get_font_info): Reject 'CFF2' format.Werner Lemberg2023-04-281-0/+6
|
* * src/cid/cidgload.c (cid_load_glyph): Fix compiler warnings.Werner Lemberg2023-04-281-2/+2
|