summaryrefslogtreecommitdiff
path: root/src/type1
Commit message (Collapse)AuthorAgeFilesLines
* [cff,cid,type1] Shorten de-referencing.Alexei Podtelezhnikov2023-03-031-2/+1
| | | | | * src/cff/cffobjs.c (cff_clot_init): Use immediate library reference. * src/cid/cidobjs.c (cid_slot_init): Ditto. * src/type1/t1objs.c (T1_GlyphSlot_Init): Ditto.
* * src/*: Replace leading underscores with trailing ones in dummy variables.Werner Lemberg2023-02-261-1/+1
| | | | This is to avoid clang warnings.
* * src/type1/t1load.c (T1_Get_MM_Var): Optimize array zeroing.Alexei Podtelezhnikov2023-02-251-5/+4
|
* [type1/MM] Round design coordinates.Alexei Podtelezhnikov2023-02-101-5/+6
| | | | | | | | | | 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.
* For debugging, avoid implicit conversion from integer to double.Werner Lemberg2023-02-081-1/+1
| | | | | | | | | | Otherwise we get zillions of clang 15 warnings. * src/autofit/afcjk.c, src/autofit/afhints.c, src/autofit/aflatin.c, src/base/ftobjs.c, src/base/ftoutln.c, src/cff/cffparse.c, src/raster/ftraster.c, src/sfnt/pngshim.c, src/truetype/ttgload.c, src/truetype/ttgxvar.c, src/truetype/ttobjs.c, src/type1/t1gload.c: Use `double` cast in debugging and tracing macros.
* [truetype, type1] Additional variation tags.Alexei Podtelezhnikov2023-02-081-0/+4
| | | | | | | | | Sync with https://learn.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg#registered-axis-tags * src/truetype/ttgxvar.h (TTAG_ital): New tag. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Use it. * src/type1/t1load.c (T1_Get_MM_Var): Handle 'slnt' and 'ital'.
* * src/type1/t1afm.c (T1_Read_Metrics): Reaffirm ascender and descender.Alexei Podtelezhnikov2023-02-041-1/+2
|
* * src/type1/t1afm.c (T1_Read_Metrics): Validate ascender and descender.Alexei Podtelezhnikov2023-02-041-3/+7
| | | | | The ascender and descender are optional in the AFM specifications. They could be omitted or even set to zero, e.g., in the current release of URW++ base 35 fonts.
* Update all copyright notices.Werner Lemberg2023-01-1717-17/+17
|
* * src/type1/t1afm.c (T1_Read_PFM): Set charmaps directly.Alexei Podtelezhnikov2022-10-031-8/+2
| | | | | | As with the previous commit, we can avoid the validation checks of `FT_Set_Charmap` and set it directly when choosing from the available list.
* [base, type1] Better handling of out-of-memory situations.Chris Liddell2022-08-211-1/+3
| | | | | | | | | | | This follows similar code in `cff_slot_done`. * src/base/ftobjs.c (ft_glyphslot_done), src/type1/t1objs.c (T1_GlyphSlot_Done): Check `internal` pointer. The Type1 problems was reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50057.
* [type1] Directly search for eexec in private dictBen Wagner2022-06-161-46/+9
| | | | | | | | | | | | | | | | | | | | | This code originally just searched for `eexec`. This was later modified to check that the `eexec` found is valid (not in a string or comment). This was done by searching for `eexec` as before and then, for each `eexec` found, searching from the beginning using the correct parsing to see if the `eexec` was still found. If the private dictionary is large and contains many copies of `eexec` which are not valid, the initial part of the private dictionary is scanned once for each, potentially leading to n^2 parsing time. Instead of finding an initial `eexec` and then re-parsing to discover if it is valid, drop the initial search for `eexec` and just parse to find a valid `eexec`. This is strictly faster since the validation must happen anyway and avoids restarting from the beginning each time an `eexec` is found in the data. * src/type1/t1parse.c (T1_Get_Private_Dict): avoid n^2 parsing Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1328883
* [truetype, snft] Add service methods for `DeltaSetIdxMap` and `VarStore`.Dominik Röttsches2022-05-191-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will be needed for 'COLR' v1 variation support. * src/truetype/ttgxvar.h (GX_ItemVarData, GX_AxisCoords, GX_VarRegion, GX_VarItemStore, GX_DeltaSetIdxMap): Move structures to... * include/freetype/internal/ftmmtypes.h: ... this new file. * include/freetype/internal/service/svmm.h (MultiMasters): Include `ftmmtypes.h`. (FT_Var_Load_Delta_Set_Idx_Map_Func, FT_Var_Load_Item_Var_Store_Func, FT_Var_Get_Item_Delta_Func, FT_Var_Done_Item_Var_Store_Func, FT_Var_Done_Delta_Set_Idx_Map_Func): New function typedefs. (MultiMasters): Add them. (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated. * src/cff/cffdrivr.c (cff_load_item_variation_store, cff_load_delta_set_index_mapping, cff_get_item_delta, cff_done_item_variation_store, cff_done_delta_set_index_map): New wrapper methods calling into mm service. (cff_service_multi_masters): Updated. * src/truetype/ttgxvar.c (ft_var_load_item_variation_store, ft_var_load_delta_set_index_mapping, ft_var_get_item_delta, ft_var_done_item_variation_store, ft_var_done_delta_set_index_map): Renamed to ... (tt_var_load_item_variation_store, tt_var_load_delta_set_index_mapping, tt_var_get_item_delta, tt_var_done_item_variation_store, tt_var_done_delta_set_index_map): ... this for consistency. Mark them as non-static. * src/truetype/ttgxvar.h: Add corresponding prototypes. * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated. * src/type1/t1driver.c (t1_service_multi_masters): Updated.
* Whitespace.Werner Lemberg2022-04-012-7/+7
|
* [psaux, type1, type42] Avoid annecessary zeroing.Alexei Podtelezhnikov2022-01-201-2/+2
| | | | | | * src/psaux/psobjs.c (ps_table_new): Use FT_QNEW_ARRAY. * src/type1/t1load.c (parse_encoding): Ditto. * src/type42/t42parse.c (t42_parse_encoding): Ditto.
* [bdf,type1] Avoid unnecessary hash zeroing.Alexei Podtelezhnikov2022-01-151-1/+1
| | | | | * src/bdf/bdflib.c (_bdf_parse_start): Use `FT_QALLOC`. * src/type1/t1load.c (parse_subrs): Use `FT_QNEW`.
* Update all copyright notices.Werner Lemberg2022-01-1117-17/+17
|
* Fix clang warnings.Werner Lemberg2021-11-142-11/+11
| | | | | | | | | | | * src/gxvalid/gxvcmmn.h (GXV_SET_ERR_IF_PARANOID): Use 'do' block. * src/gxvalid/gxvmod.c (GXV_TABLE_LOAD, GXV_TABLE_VALIDATE): Ditto. * src/smooth/ftgrays.c (gray_convert_glyph): Add cast. * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Remove cast. * src/type1/t1load.c (read_binay_data): Use `FT_ULong` for `size` parameter. (parse_subrs, parse_charstrings, parse_dict): Ditto; also add some casts.
* Formatting.Werner Lemberg2021-10-261-8/+8
|
* [mm] Tolerate missing Blend dictionary entriesBen Wagner2021-10-251-3/+3
| | | | | | | | | | | | | | | In a Multiple Master font, the Blend dictionary must contain valid Private, FontInfo, and FontBBox. The current code will error if any of these are present and invalid, but will not error and will provide uninitialized data if the Blend dictionary exists but does not contain one of these entries. This change reverts to the older behavior of treating any missing entries as containing all zero data and not returning an error. In the future it may be best to keep track of when these are actually initialized and error if they are not. * src/type1/t1load.c (t1_allocate_blend): Zero initiailize.
* [mm] Delay setting blend weight and design position.Ben Wagner2021-10-211-32/+50
| | | | | | | | | | | | | | | | | | | | Previously the `blend->weight_vector`, `blend->default_weight_vector`, and `blend->design_pos` were set early to allocated but uninitialized memory under the assumption that the memory would eventually be initialized. However, it is possible that some of the required keywords may not actually be present, leaving the memory uninitialized. This is different from a present but invalid table, which would produce an error. Reported as https://bugs.chromium.org/p/chromium/issues/detail?id=1261762 * src/type1/t1load.c (t1_allocate_blend): Remove early allocation and initialization. (parse_blend_design_positions, parse_weight_vector): Parse into local and assign to blend if valid. (T1_Open_Face): Check that if a blend exists that it has the weight vector and design positions.
* [type1] Revert to signed size for binary data.Alexei Podtelezhnikov2021-10-111-11/+11
| | | | | | | | Recently introduced and reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39838 * src/type1/t1load.c (read_binary_data): Reject negative size. (parse_subrs, parse_charstrings): Use customary signed size.
* [psaux] Signedness revisions.Alexei Podtelezhnikov2021-10-101-3/+3
| | | | | | | | | Unsigned indexes are easier to check. * src/psaux/cffdecode.c (cff_decoder_parse_charstrings): Updated. * src/psaux/psintrp.c (cf2_interpT2CharString): Ditto. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto. * src/type1/t1load.c (read_binary_data): Ditto.
* Minor type adjustments.Alexei Podtelezhnikov2021-09-141-5/+5
| | | | | | * src/cff/cffobjs.c (cff_face_init): Reduce casting. * src/truetype/ttobjs.c (tt_size_ready_bytecode): Ditto. * src/type1/t1load.c (T1_Set_MM_Design): Ditto.
* [base] Fix ppem size overflow.Werner Lemberg2021-08-181-2/+7
| | | | | | | | | | | | | | Fixes #1086. * src/base/ftobjs.c (FT_Request_Metrics): Add return value. Check whether ppem values fit into unsigned short values. (FT_Request_Size): Updated. * include/freetype/internal/ftobjs.h: Updated. * src/cff/cffobjs.c (cff_size_request), src/cid/cidobjs.c (cid_size_request), src/truetype/ttdriver.c (tt_size_request), src/type1/t1objs.c (T1_Size_Request): Updated.
* [type1] Avoid MM memory zeroing.Alexei Podtelezhnikov2021-05-072-8/+7
| | | | | | * src/type1/t1load.c (t1_allocate_blend, parse_blend_design_map): Tweak allocation macros. * src/type1/t1objs.c (T1_Face_Done): Minor.
* [cff,type1,type42] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.Alexei Podtelezhnikov2021-04-232-7/+7
| | | | | | | | | | * src/cff/cffload.c (cff_index_get_pointers, cff_index_get_name): Do not zero out the buffer. * src/cff/cffdrivr.c (cff_ps_get_font_info): Ditto. * src/type1/t1load.c (parse_subrs, parse_charstrings, parse_blend_axis_types): Ditto. * src/type1/t1parse.c (T1_New_Parser, T1_Get_Private_Dict): Ditto. * src/type42/t42parse.c (t42_parser_init): Ditto.
* Decorate qsort callbacks with cdecl.Alexei Podtelezhnikov2021-02-121-1/+1
| | | | | | | | | | | * include/freetype/internal/compiler-macros.h (FT_COMPARE_DEF): Add new macro. * src/base/ftrfork.c, src/bdf/bdflib.c, src/gxvalid/gxvcommn.c, src/psaux/afmparse.c, src/psnames/psmodule.c, src/type1/t1afm.c, src/sfnt/sfwoff.c, src/sfnt/sfwoff2.c: Update qsort callbacks. Fixes #1026 when compiling FreeType with an unusual calling convention while the C library qsort still expects cdecl.
* * src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`.Werner Lemberg2021-02-041-4/+4
| | | | | | | | This ensures good logging output, with all lines having a proper prefix (if requested). This is a continuation of a similar patch from 2020-12-02, which missed some locations.
* Update all copyright notices.Werner Lemberg2021-01-1717-17/+17
|
* [cff,cid,type1] Demote old engine for lack of CFF2.Alexei Podtelezhnikov2020-11-201-4/+0
| | | | | | * src/cff/cffobjs.c (cff_iriver_init): Always default to Adobe engine. * src/cid/cidobjs.c (cid_driver_init): Ditto. * src/type1/t1objs.c (T1_Driver_Init): Ditto.
* Fix `-Wformat' compiler warnings.Priyesh Kumar2020-07-283-6/+6
| | | | | | * src/*: Fix format specifiers. * builds/unix/ftsystem.c (FT_Stream_Open): Ditto.
* Remove redundant inclusion of `ft2build.h'.Werner Lemberg2020-06-1311-11/+0
| | | | | | | * */*: Remove `#include <ft2build.h>' where possible. * include/freetype/freetype.h: Remove cpp error about missing inclusion of `ft2build.h'.
* Make macros for header file names optional.David Turner2020-06-0812-50/+50
| | | | | | | | | | | | | | | | | We no longer have to take care of the 8.3 file name limit; this allows us (a) to introduce longer, meaningful file names, and (b) to avoid macro names in `#include' lines altogether since some compilers (most notably Visual C++) doesn't support this properly. */*: Replace #include FOO_H with #include <freetype/foo.h> or something similar. Also update the documentation.
* Remove Jamfile files from the tree.David Turner2020-05-181-35/+0
| | | | | | | | These have not been used in a very, very long time, so better remove them. A corresponding patch will be submitted to the `freetype2-demos' repository. * src/Jamfile, src/*/Jamfile, Jamrules: Delete.
* Update all copyright notices.Werner Lemberg2020-01-1918-18/+18
|
* [type1] Fix `FT_Get_Var_Axis_Flags' (#56804).Werner Lemberg2019-08-261-9/+33
| | | | | * src/type1/t1load.c (T1_Get_MM_Var): Allocate space for axis flags. Also remove redundant assignment.
* [type1,type42] Use `const' for string literals.Alexei Podtelezhnikov2019-06-101-19/+12
| | | | | | | | | | | * include/freetype/internal/psaux.h (PS_Table_FuncsRec): Updated. * include/freetype/internal/t1types.h (T1_EncodingRec): Updated. * src/psaux/psobjs.[ch] (ps_table_add): Updated. * src/type1/t1load.c (T1_Open_Face, parse_encoding): Updated. * src/type42/t42objs.c (T42_Open_Face): Updated. * src/type42/t42parse.c (t42_parse_encoding): Updated. * src/cff/cffobjs.c (cff_face_init): Minor.
* Make `glyph_name' parameter to `FT_Get_Name_Index' a `const'.Antony Lee2019-04-061-2/+2
| | | | | | | | | | | * include/freetype/freetype.h (FT_Get_Name_Index), include/freetype/internal/ftobjs.h (FT_Face_GetGlyphNameIndexFunc), include/freetype/internal/services/svgldict.h (FT_GlyphDict_NameIndexFunc), src/base/ftobjs.c (FT_Get_Name_Index), src/cff/cffdrivr.c (cff_get_name_index), src/sfnt/sfdriver.c (sfnt_get_name_index), src/type1/t1driver.c (t1_get_name_index), src/type42/t42drivr.c (t42_get_name_index): Add `const' to second argument.
* Update all copyright notices.Werner Lemberg2019-02-2318-18/+18
|
* Update copyright years.Werner Lemberg2019-01-2218-18/+18
|
* [type1,cff] Add FT_{Set,Get}_MM_WeightVector API calls.Chris Liddell2018-11-273-11/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For multiple master fonts, common usage (in Postscript) is to modify the WeightVector of an existing font instance, this addition supports that use. * include/freetype/ftmm.h, src/base/ftmm.c (FT_Set_MM_WeightVector, FT_Get_MM_WeightVector): New API functions. * include/freetype/internalservices/svmm.h (FT_Set_MM_WeightVector_Func, FT_Get_MM_WeightVector_Func): New function types. (MultiMasters): Add `set_mm_weightvector' and `get_mm_weightvector' members. (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated. * src/cffcffdrivr.c (cff_set_mm_weightvector, cff_get_mm_weightvector): New functions. (cff_service_multi_masters): Register them. * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated. This driver doesn't use the new interface. * src/type1/t1load.c (T1_Set_MM_WeightVector, T1_Get_MM_WeightVector): New functions. * src/type1/t1driver.c (t1_service_multi_masters): Register them. * src/type1/t1load.h: Updated.
* * src/type1/t1load.c (t1_set_mm_blend): Optimized.Alexei Podtelezhnikov2018-10-311-9/+16
|
* Avoid endless loop while tracing (#54858).Werner Lemberg2018-10-201-7/+13
| | | | | * src/type1/t1load.c (parse_buildchar): Guard tracing stuff with FT_DEBUG_LEVEL_TRACE.
* A missing Unicode cmap is not a fatal error.Werner Lemberg2018-10-071-1/+2
| | | | | | | | This is a follow-up to the previous commit. * src/cff/cffobjs.c (cff_face_init), src/sfnt/sfobjs.c (sfnt_load_face), src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Implement it.
* Whitespace.Werner Lemberg2018-10-071-1/+1
|
* Fix handing of `FT_Bool'.Werner Lemberg2018-09-252-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Before this commit we had code like (FT_Bool)( globals->glyph_styles[gindex] & 0x8000) Since `FT_Bool' is defined to be an `unsigned char', the code evaluated to something like (unsigned char)( 0x8532 & 0x8000) which in turn expanded to (unsigned char)( 0x8000) and finally yielded 0x00 – i.e., false – not as expected. Problem reported and analyzed by Tony Smith <tony.smith@macro4.com>. * include/freetype/fttypes.h (FT_BOOL): Add a comparison against zero so that we always have a Boolean expression. */*: Replace castings to `FT_Bool' with calls to `FT_BOOL' where possible.
* Don't use `trace_' prefix for FT_COMPONENT arguments.Werner Lemberg2018-08-156-6/+6
| | | | | | | | * include/freetype/internal/ftdebug.h (FT_TRACE_COMP, FT_TRACE_COMP_): New auxiliary macros to add `trace_' prefix. (FT_TRACE): Use `FT_TRACE_COMP'. */* (FT_COMPONENT): Updated.
* Fix clang warnings.Werner Lemberg2018-08-041-1/+1
| | | | | | | | | | | | * src/base/ftoutln.c (FT_Outline_EmboldenXY): Fix type of `orientation'. * src/gxvalid/gxvcommn.c (gx_lookup_value_read): Fix signature. * src/pcf/pcfread.c (pcf_get_encodings): Fix type of some variables. Add cast. * src/type1/t1load.c (parse_weight_vector): Fix cast.
* * src/cid/cidtoken.h: Handle `XUID' keyword.Werner Lemberg2018-07-311-1/+1
|