summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* * src/base/ftbitmap.c (FT_Bitmap_Copy): Clarify the flow control.bitmap_convertAlexei Podtelezhnikov2022-09-211-10/+8
| | | | * include/freetype/ftbitmap.h (FT_Bitmap_Copy): Ditto.
* [base] Accept negative bitmap alignment for bottom-up flow.Alexei Podtelezhnikov2022-09-201-8/+8
| | | | | | * src/base/ftbitmap.c (FT_Bitmap_Convert): Use negative alignment to produce negative pitch. * include/freetype/ftbitmap.c (FT_Bitmap_Convert): Document it.
* [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
|
* Fix clang14 compiler warnings.Werner Lemberg2022-07-291-2/+2
| | | | | | | | | * include/freetype/internal/ftstream.h (FT_GET_SHORT_LE, FT_GET_USHORT_LE): Fix type. * src/sfnt/ttcolr.c (get_deltas_for_var_index_base): Always return boolean value. (tt_face_get_colorline_stops): Fix type of `var_index_base`.
* [sfnt] Support variable 'COLR' v1 color lines.Dominik Röttsches2022-07-081-3/+10
| | | | | | | | | | | | * include/freetype/ftcolor.h (FT_ColorStopIterator): Add field `read_variable` to indicate whether a variation index base should be read. * src/sfnt/ttcolr.c: (FT_PaintFormat_Internal): New enumerations `FT_COLR_PAINTFORMAT_INTERNAL_VAR_LINEAR_GRADIENT` `FT_COLR_PAINTFORMAT_INTERNAL_VAR_RADIAL_GRADIENT`, and `FT_COLR_PAINTFORMAT_INTERNAL_VAR_SWEEP_GRADIENT`. (read_color_line): New parameter `read_variable`; update callers. (read_paint): Handle new enumerations.
* doc: Clarify description of `FT_Stream_IoFunc`.Stephen Holdaway2022-07-061-3/+9
| | | | | | | | | | The existing documentation comments on `FT_Stream_IoFunc` hinted at the dual seek/read behavior required for custom stream implementations to work, but it didn't explicitly explain it. Without looking at the internals of FreeType, it was easy for someone to assume their implementation should handle both seek and read operations all the time. If this is done, you get a variety of errors, but mostly just `Unknown_File_Format` (error code 0x02).
* include/freetype/ftmm.h: Improve documentation.Werner Lemberg2022-07-021-4/+13
|
* [truetype] Perform variation store delta computation with 64-bit precision.Dominik Röttsches2022-06-292-2/+2
| | | | | | | | | | | | * include/freetype/internal/ftmmtypes.h (FT_ItemVarDelta): Make type explicitly 32-bit. * include/freetype/internal/services/svmm.h (FT_Var_Get_Item_Delta_Func): Change return type to `FT_ItemVarDelta` * truetype/ttgxvar.h (tt_var_get_item_delta): Change return type to `FT_ItemVarDelta`. * truetype/ttgxvar.c (tt_var_get_item_delta): Store scalars and deltas to intermediate array, perform computation using new method `FT_MulAddFix`.
* New function `FT_MulAddFix` to compute the sum of fixed-point products.Dominik Röttsches2022-06-291-0/+34
| | | | | | | | This function, based on the code of `FT_MulFix`, uses 64-bit precision internally for intermediate computations. * include/freetype/internal/ftcalc.h, base/ftcalc.c (FT_MulAddFix): Implement it.
* [sfnt] Upgrade stop_offset to FT_Fixed from FT_F2Dot14Dominik Röttsches2022-06-221-2/+3
|
* s/fixed point/fixed-point/Werner Lemberg2022-06-212-2/+2
|
* Proposal: Feature control for variable COLRv1Dominik Röttsches2022-06-211-3/+45
| | | | | | | | * include/freetype/ftdriver.h (variable-color-v1 property): Add documentation for variable-colr-v1 property. * src/truetype/ttdriver.c (tt_property_set): Ingest variable-control property when called, set to enable_variable_colrv1 driver flag. * src/truetype/ttobjs.h (TT_DriverRec): Add enable_variable_colrv1 flag.
* [stream] Fix reading s32 when long is s64Ben Wagner2022-06-181-53/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `FT_READ_LONG`, `FT_GET_LONG`, and related macros did not return negative values when `long` is more than 32 bits. `FT_Stream_ReadULong` would read four bytes into the LSB of an `FT_ULong` and return that. Since this can never set the MSb of the `FT_ULong` when `FT_ULong` is more than 32 bits the cast to `FT_Long` never resulted in a negative value. Fix this by modifying `FT_Stream_Read*` to return a type of the same size as the bytes it is reading and changing the `FT_READ_*` and `FT_GET_*` macros to cast to the same type returned by `FT_Stream_Read*` but with the correctly signed type (instead of casting to what is assumed to be the type of `var` which will happen automatically anyway). There exist a few cases like with the `OFF3` variants where there isn't generally a type with the correct size. `FT_PEEK_OFF3` works around this loading the bytes into the three most significant bits and then doing a signed shift down. `FT_NEXT_OFF3` also already worked correctly by casting this signed value to another signed type. `FT_Stream_GetUOffset` works correctly but one must be careful not to attempt to cast the returned value to a signed type. Fortunately there is only `FT_GET_UOFF3` and no `FT_GET_OFF3`. All of these cases are handled correctly when reading values through `FT_Stream_ReadFields` since it generically computes the signed value through an `FT_Int32`. This change is essentially doing the same for these macros. * include/freetype/internal/ftstream.h (FT_NEXT_*, FT_GET_*, FT_READ*): Update macros and return types to use fixed size types for fixed size values. * src/base/ftstream.c (FT_StreamGet*, FT_StreamRead*): Dito. Issue: #1161
* [svg] Set linear advances when loading SVG glyphsBen Wagner2022-06-061-2/+2
| | | | | | | | * include/freetype/freetype.h (FT_GlyphSlotRec_): update doc * src/cff/cffgload.c (cff_slot_load): do it * src/truetype/ttgload.c (TT_Load_Glyph): do it Fixes: #1156
* [truetype] Support reading 32bit/16bit VarStore deltasDominik Röttsches2022-05-231-6/+8
| | | | | | | | * include/freetype/internal/ftmmtypes.h (FT_ItemVarDelta): Define type to be used for delta arrays, upgrade to FT_long. * src/truetype/ttgxvar.c: Adhere to long_words bit and read either Short/Byte pairs or Long/Short pairs, as defined by spec. For better readability, define macro for repetitive read code.
* [truetype, snft] Add service methods for `DeltaSetIdxMap` and `VarStore`.Dominik Röttsches2022-05-192-40/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* * Version 2.12.1 released.VER-2-12-1Werner Lemberg2022-05-011-1/+1
| | | | | | | | | | | | | | | | | | | ========================== Tag sources with `VER-2-12-1'. * docs/VERSION.TXT: Add entry for version 2.12.1. * docs/CHANGES, docs/release: 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.0/2.12.1/, s/2120/2121/. * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. * builds/unix/configure.raw (version_info): Set to 24:3:18. * CMakeLists.txt (VERSION_PATCH): Set to 1.
* [sfnt] Correct FT_ColorStopIterator documentation.Ben Wagner2022-04-041-3/+3
| | | | | | | * include/freetype/ftcolor.h (FT_ColorStopIterator): the user should not set `p` to NULL before calling `FT_Get_Colorline_Stops`. `p` and `num_color_stops` are set by `FT_Get_Paint`. `p` and `current_color_stop` are updated by `FT_Get_Colorline_Stops`.
* * Version 2.12.0 released.VER-2-12-0Werner Lemberg2022-03-311-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | ========================== Tag sources with `VER-2-12-0'. * docs/VERSION.TXT: Add entry for version 2.12.0. * docs/CHANGES, docs/release: 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.11.1/2.12.0/, s/2111/2120/. * include/freetype/freetype.h (FREETYPE_MINOR): Set to 12. (FREETYPE_PATCH): Set to 0. * builds/unix/configure.raw (version_info): Set to 24:2:18. * CMakeLists.txt (VERSION_MINOR): Set to 12. (VERSION_PATCH): Set to 0. * builds/toplevel.mk (do-dist): Generate `ChangeLog` entries for all commits since version 2.11.0 (when we stopped creating this file manually).
* Add `FT_FACE_FLAG_SBIX_OVERLAY` and `FT_HAS_SBIX_OVERLAY`.Werner Lemberg2022-03-251-0/+92
| | | | | | | | * include/freetype/freetype.h (FT_FACE_FLAG_SBIX_OVERLAY, FT_HAS_SBIX_OVERLAY): New macro. * src/sfnt/ttsbit.c (tt_face_load_sbit): Handle `FT_FACE_FLAG_SBIX_OVERLAY`. Remove obsolete tracing message.
* Add `FT_PARAM_TAG_IGNORE_SBIX`.Werner Lemberg2022-03-251-0/+15
| | | | | | | | | | | | | This is another bit to handle 'sbix' tables as described in the OpenType specification. * include/freetype/ftparams.h (FT_PARAM_TAG_IGNORE_SBIX): New macro. * src/sfnt/sfobjc.c (is_apple_sbix): Rename to... (has_sbix): ... this. Check for more sbit tables. Handle `FT_PARAM_TAG_IGNORE_SBIX` to eventually control `has_sbix`. Only call sbit table loader if an sbit table is present.
* Add `FT_FACE_FLAG_SBIX` and `FT_HAS_SBIX`.Werner Lemberg2022-03-251-0/+25
| | | | | | | | | Fonts with 'sbix' tables need special handling by the application. * include/freetype/freetype.h (FT_FACE_FLAG_SBIX, FT_HAS_SBIX): New macros. * src/sfnt/sfobjs.c (sfnt_load_face): Set `FT_FACE_FLAG_SBIX` if 'sbix' table is present.
* * include/freetype/freetype.h (FT_LOAD_SBITS_ONLY): Tag macro as public.Werner Lemberg2022-03-251-1/+11
|
* [doc] FT_OUTLINE_OVERLAP was introduced in 2.10.3.Ben Wagner2022-03-191-5/+5
| | | | * include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): Document when added.
* * include/freetype/freetype.h: Improve SDF documentation.Anuj Verma2022-03-051-0/+38
|
* ftmm.h: Minor documentation improvement.Werner Lemberg2022-02-161-0/+3
|
* t1tables.h: Documentation improvements.Werner Lemberg2022-02-121-8/+28
|
* t1tables.h: Whitespace.Werner Lemberg2022-02-121-73/+73
|
* Various minor doc fixes.Werner Lemberg2022-02-061-4/+4
|
* freetype.h: Minor documentation improvement.Werner Lemberg2022-01-311-5/+6
|
* Document `FT_Outline_Decompose` degenerate segments.Ben Wagner2022-01-271-5/+7
| | | | | | | | | | | | | | `FT_Outline_Decompose` does not filter out and can return degenerate segments in an outline. This can be surprising when attemping to stroke such an outline. Clarify the existing documentation on this matter to cover all forms of degeneracy (without specifying exactly how they will be reported), why they might arise, and better explain in what cases they may be an issue. * include/freetype/ftoutlin.h (FT_Outline_Decompose): update documentation. Fixes #952.
* Aarg, typo.Werner Lemberg2022-01-251-1/+1
|
* freetype.h: More updates to `FT_LOAD_COLOR` description.Werner Lemberg2022-01-251-4/+5
|
* Update documentation for `FT_LOAD_COLOR`.Werner Lemberg2022-01-251-10/+18
|
* * src/svg/ftsvg.c (ft_svg_property_set): Disallow NULL pointers.Werner Lemberg2022-01-231-0/+2
|
* More documentation on handling OT-SVG.Werner Lemberg2022-01-233-33/+101
|
* Add 'svg' module for OT-SVG rendering.Moazin Khatti2022-01-205-0/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | * CMakeLists.txt (BASE_SRCS): Add svg module file. * meson.build (ft2_public_headers): Add `otsvg.h`. * modules.cfg (RASTER_MODULES): Add `svg` module. * builds/meson/parse_modules_cfg.py: Add svg module. * include/freetype/config/ftmodule.h: Add `ft_svg_renderer_class`. * include/freetype/fterrdef.h: Add `Invalid_SVG_Document` and `Missing_SVG_Hooks` error codes. * include/freetype/internal/fttrace.h: Add tracing for `otsvg`. * include/freetype/internal/svginterface.h: New file. It adds an interface to enable the presetting hook from the `base` module. * include/freetype/otsvg.h (SVG_Lib_Init_Func, SVG_Lib_Free_Func, SVG_Lib_Render_Func, SVG_Lib_Preset_Slot_Func): New hooks for SVG rendering. (SVG_RendererHooks): New structure to access them. * src/base/ftobjs.c: Include `svginterface.h`. (ft_glyphslot_preset_bitmap): Add code for presetting the slot for SVG glyphs. (ft_add_renderer): Updated. * src/svg/*: New files.
* Add `FT_Glyph` support for OT-SVG glyphs.Moazin Khatti2022-01-201-2/+88
| | | | | | | | | | | * include/freetype/ftglyph.h (FT_SvgGlyphRec, FT_SvgGlyph): New structure. * src/base/ftglyph.c: Include `otsvg.h`. (ft_svg_glyph_init, ft_svg_glyph_done, ft_svg_glyph_copy, ft_svg_glyph_transform, ft_svg_glyph_prepare): New function. (ft_svg_glyph_class): New class. (FT_New_Glyph, FT_Glyph_To_Bitmap): Updated to handle OT-SVG glyphs. * src/base/ftglyph.h: Updated.
* Add code to load OT-SVG glyph documents.Moazin Khatti2022-01-2010-15/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/freetype/config/ftheader.h (FT_OTSVG_H): New macro. * include/freetype/freetype.h (FT_FACE_FLAG_SVG, FT_HAS_SVG): New macros. (FT_LOAD_SVG_ONLY): New internal macro. * include/freetype/ftimage.h (FT_Glyph_Format): New enumeration value `FT_GLYPH_FORMAT_SVG`. * include/freetype/internal/ftobjs.h (FT_GLYPH_OWN_GZIP_SVG): New macro. * include/freetype/internal/fttrace.h: Add `ttsvg` for `ttsvg.c`. * include/freetype/internal/sfnt.h(load_svg, free_svg, load_svg_doc): New functions. * include/freetype/internal/tttypes.h (TT_FaceRec): Add `svg` for the SVG table. * include/freetype/otsvg.h (FT_SVG_DocumentRec): New structure to hold the SVG document and other necessary information of an OT-SVG glyph in a glyph slot. * include/freetype/tttags.h (TTAG_SVG): New macro. * src/base/ftobjs.c: Include `otsvg.h`. (ft_glyphslot_init): Allocate `FT_SVG_DocumentRec` in `slot->other` if the SVG table exists. (ft_glyphslot_clear): Free it upon clean-up if it is a GZIP compressed glyph. (ft_glyphslot_done): Free the document data if it is a GZIP compressed glyph. (FT_Load_Glyph): Don't auto-hint SVG documents. * src/cache/ftcbasic.c (ftc_basic_family_load_glyph): Add support for FT_GLYPH_FORMAT_SVG. * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `ttsvg.c`. * src/sfnt/sfdriver.c: Include `ttsvg.h`. (sfnt_interface): Add `tt_face_load_svg`, `tt_face_free_svg` and `tt_face_load_svg_doc`. * src/sfnt/sfnt.c: Include `ttsvg.c`. * src/sfnt/sfobjs.c (sfnt_load_face, sfnt_done_face): Add code to load and free data of the the SVG table. * src/sfnt/ttsvg.c: New file, implementing `tt_face_load_svg`, `tt_face_free_svg` and `tt_face_load_svg_doc`. * src/sfnt/ttsvg.h: Declarations of the SVG functions in `ttsvg.c`.
* Add flag `FT_CONFIG_OPTION_SVG`.Moazin Khatti2022-01-201-1/+15
| | | | | | | | | This flag is going to be used to conditionally compile support for OT-SVG glyphs. FreeType will do the parsing and rely on external hooks for rendering of OT-SVG glyphs. * devel/ftoption.h, include/freetype/config/ftoption.h (FT_CONFIG_OPTION_SVG): New flag.
* * include/freetype/freetype.h: Clarify `FT_Size` life cycle.Alexei Podtelezhnikov2022-01-201-6/+7
|
* [base] Undefined scale means no scale.Alexei Podtelezhnikov2022-01-191-11/+13
| | | | | | | | | | | | | | It might be surprising that FreeType does not have default ppem and the size has to be set explicitly or face undefined behavior with undefined variables and errors. This offers an alternative to missing or zero scale by simply setting FT_LOAD_NO_SCALE. Defined behavior is bettr than undefined one. This is alternative to !132 and discussed in https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43708 * src/base/ftobjs.c (FT_Load_Glyph): Deal with zero scale. * include/freetype/freetype.h: Document it.
* Add Watcom C/C++ calling.Ozkan Sezer2022-01-151-0/+2
| | | | | | | | | In the unlikely case the source is built with OpenWatcom's -ec? switches to enforce a calling convention, the qsort() compare function must still be set to __watcall. * include/freetype/internal/compiler-macros.h (FT_COMPARE_DEF): Updated.
* Add Watcom C/C++ support.Ozkan Sezer2022-01-142-2/+16
| | | | | | * include/freetype/config/integer-types.h: Make sure `long long` is used then available. * include/freetype/internal/ftcalc.h (FT_MSB): Add Watcom C/C++ pragma.
* * include/freetype/internal/compiler-macros.h [FT_COMPARE_DEF]: Tighten.Alexei Podtelezhnikov2022-01-141-2/+2
| | | | This works around Watcom C library using __watcall.
* Update all copyright notices.Werner Lemberg2022-01-1194-94/+94
|
* * builds/unix/configure.raw: Restore `SYSTEM_ZLIB` variable.Werner Lemberg2022-01-021-0/+4
| | | | This was accidentally removed with commit 93ebcbd0 almost eight years ago.
* [truetype] Binary search through the `hdmx` records.Alexei Podtelezhnikov2021-12-111-3/+3
| | | | | | | | | | | | | The `hdmx` table is supposed to be sorted by ppem size, which enables binary search. We also drop the check for the sufficient length of the record because it is now enforced when the table is loaded. * include/freetype/internal/tttypes.h (TT_FaceRec): Store the `hdmx` record pointers sorted by ppem instead of ppem's themselves. * src/truetype/ttpload.c (tt_face_load_hdmx): Prudently sort records. (tt_face_get_device_metrics): Implement binary search to retrieve advances.
* [truetype] Initialize the loader with `hdmx` data.Alexei Podtelezhnikov2021-12-111-0/+3
| | | | | | | | | The `hdmx` matching can be done before the glyph is loaded. * include/freetype/internal/tttypes.h (TT_LoaderRec): Add a field. * src/truetype/ttgload.c (compute_glyph_metrics): Relocate the `hdmx` code from here... (tt_loader_init): ... to here, before the glyph is loaded.