summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* * include/freetype/freetype.h (FT_RENDER_MODE_SDF): Improve documentation.1100-sdf-precision-improvementAnuj Verma2021-10-161-0/+5
| | | | | * include/freetype/freetype.h (FT_RENDER_MODE_SDF): Added one more point to the limitations of sdf.
* [sdf] Fixed corner checks and improved performance.Anuj Verma2021-10-161-24/+41
| | | | | | | | | | | * src/sdf/ftsdf.c (sdf_generate_bounding_box): Always check for corner if two distance (for different curves) are very close. * src/sdf/ftsdf.c (sdf_conic_to): Added check to figure out if the conic can be treated as a line (which happens if the control point coincide with any end-point). Also, replace tabs `\t` with spaces.
* [sdf] Impliment deviation based splitting for bezier curves.Anuj Verma2021-10-152-6/+39
| | | | | | | | | * src/sdf/ftsdf.c (split_sdf_cubic, split_sdf_shape): Added checks to figure out the deviation of bezier curves and stop splitting if the curve is flat enough. * src/sdf/ftsdfcommon.h (ONE_PIXEL): Added macro for unit pixel size in 26.6 fixed point representation.
* * include/freetype/freetype.h (FT_RENDER_MODE_SDF): Improve documentation.Anuj Verma2021-10-091-0/+34
| | | | | | | * include/freetype/freetype.h (FT_RENDER_MODE_SDF): Added more documentation for the render mode regarding the stability and point where artifacts are expected to occur. Also added more information for both `sdf`, `bsdf` and when they are used.
* * src/cid/cidload.c (cid_face_open): Streamline SubrCount check.Alexei Podtelezhnikov2021-10-071-5/+4
|
* * src/cid/cidgload.c (cid_load_glyph): Fortify incremental loading.Alexei Podtelezhnikov2021-10-071-8/+5
|
* Signedness revisions.Alexei Podtelezhnikov2021-10-0710-38/+48
| | | | | | | | | | | | | | | | | | | | | This eliminates explicit casting by switching to unsigned fields. The revisions mostly impact the handling of CID fonts. * include/freetype/fttypes.h (FT_Data): Change to unsigned `length`. * include/freetype/t1tables.h (CID_FaceDictRec): Ditto for `sd_bytes`. (CID_FaceInfoRec): Ditto for `gd_bytes` and `gd_bytes`. * include/freetype/internal/tttypes.h (TT_LoaderRec): Ditto for `byte_len`. * src/cid/cidgload.c (cid_load_glyph): Updated. * src/cid/cidload.h (cid_get_offset): Update argument. * src/cid/cidload.c (cid_get_offset, cid_read_subrs, cid_face_open): Updated. * src/cff/cffgload.c (cff_get_glyph_data, cff_free_glyph_data): Updated. * src/psaux/psft.c (cf2_getT1SeacComponent): Updated. * src/truetype/ttgload.c (TT_Process_Composite_Glyph, load_truetype_glyph): Updated.
* meson.build (gen_docs): Use `current_source_dir` instead of `source_root`.Jan Alexander Steffens (heftig)2021-10-071-1/+1
| | | | | | These two are not equal when FreeType is used as a subproject, such as in `freetype-demos`. In that case, `source_root` points at the root project, causing the docs build to fail.
* * src/smooth/ftgrays.c (FT_DIV_MOD): Limit the ARM workaround.Alexei Podtelezhnikov2021-10-051-1/+1
|
* [builds/unix, builds/vms] Standardize `mmap` failure.Alexei Podtelezhnikov2021-10-052-3/+2
| | | | | | | * builds/unix/ftsystem.c (FT_Stream_Open): Check for MAP_FAILED. * builds/vms/ftsystem.c (FT_Stream_Open): Ditto. This should cover https://savannah.nongnu.org/patch/?5909 as well.
* autogen.sh: Only copy submodules if building from a git branch.Hugh McMaster2021-10-051-10/+12
| | | | | | | | | | | | `autogen.sh` fails if building from a standard source tarball. Firstly, git expects to be called in a git repository, then `copy_submodule_files` blindly attempts to copy files. Debian, Ubuntu, Linux Mint, and other derivatives all run `autogen.sh` before compiling to regenerate build files. This patch ensures that various git commands are only called and 'dlg' files are only copied if `autogen.sh` is called from a git repository.
* * include/freetype/internal/ftgloadr.h: Add missing header.Alexei Podtelezhnikov2021-10-041-0/+1
| | | | Noticed by Jouk Jansen.
* [pshinter] Additional clean-ups.Alexei Podtelezhnikov2021-10-042-11/+3
| | | | | * src/pshinter/pshalgo.h (psh_hint_table_find_strong_points): Streamline code. * src/pshinter/pshalgo.h (PSH_Glyph): Remove unused fields.
* [pshinter] More convenient direction definition.Alexei Podtelezhnikov2021-10-032-32/+25
| | | | | | | | | | | It is easier to check directions using flags than integer values. * src/pshinter/pshalgo.h (PSH_Dir): Redefine directions. (PSH_PointRec): Use them as an enum type. * src/pshinter/pshalgo.c (psh_compute_dir): Modify return type. (psh_glyph_init, psh_hint_table_find_strong_points, psh_glyph_find_blue_points): Update users.
* [pshinter] Remove unnecessary check.Alexei Podtelezhnikov2021-10-031-29/+26
| | | | | * src/pshinter/pshalgo.c (psh_hint_table_find_strong_points): Do not check if direction is defined before checking how.
* CI: Hardcode meson version to fix build failure on windowsAnuthaDev2021-10-021-1/+2
|
* Additional `FT_MSB` macro definitions.Alexei Podtelezhnikov2021-10-011-3/+14
| | | | | * include/freetype/internal/ftcalc.h [__DECC,_CRAYC]: Use builtins and intrinsics.
* * src/autofit/afhints.c (af_glyph_hints_reload): Decrease casting.Alexei Podtelezhnikov2021-09-301-9/+9
|
* * src/tools/apinames.c: Facilitate OpenVMS linker options.Alexei Podtelezhnikov2021-09-291-1/+17
|
* * src/winfonts/winfnt.c (FNT_Face_Init): Correct reallocation.Alexei Podtelezhnikov2021-09-281-3/+4
|
* [builds/unix] Do not use autoconf SIZEOF.Alexei Podtelezhnikov2021-09-242-82/+0
| | | | | | | | | | | * builds/unix/ftconfig.h.in [FT_USE_AUTOCONF_SIZEOF_TYPES]: Removed. * builds/unix/configure.raw: Remove AC_CHECK_SIZEOF and update. After this commit, autoconf builds will fully rely on <limits.h> rather than falling back on it if AC_CHECK_SIZEOF failed for some reason. There is a risk that misconfigured cross-compilation might have wrong headers. Note that Meson and CMake builds always relied on <limits.h> for sizes and availability of integer types.
* Propagate sign when reading OFF3.Alexei Podtelezhnikov2021-09-241-8/+6
| | | | | | | | | | | Signed 24-bit values are extremely rare. FreeType only reads them in PFR fonts with bitmap strikes conditionally. They have not been seen in the known fonts. That is why this bug could never be discovered. `FT_FRAME_OFF3` propagates sign correctly. * include/freetype/internal/ftstream.h (FT_PEEK_OFF3, FT_PEEK_OFF3_LE): Propagate sign into 32-bit value. (FT_GET_OFF3, FT_READ_OFF3): Needed fixing but removed as unused.
* [bdf] Simplify comment collection or lack thereof.Alexei Podtelezhnikov2021-09-241-27/+12
| | | | | | | | | | BDF comments are neither actually collected nor retrieved. There is no need to be fancy with delimiters. * src/bdf/bdflib.c (_add_bdf_comment): Delimit comments with zeros... (bdf_load_font): ...and do not null-terminate comments additionally. (_bdf_parse_glyphs): Check if comments are kept, which they are not. (_bdf_parse_start): Minor clean up.
* Use NULL for pointers only.Alexei Podtelezhnikov2021-09-235-29/+29
| | | | | | | * src/bdf/bdflib.c (*): Code changes. * include/freetype/freetype.h: Comments only. * src/cff/cffload.c, src/cff/cffobjs.c: Ditto. * src/winfonts/winfnt.c: Ditto.
* Minor documentation fixes and improvements.Werner Lemberg2021-09-231-4/+8
|
* Reference `fopen` in the docs.Alexei Podtelezhnikov2021-09-221-0/+4
|
* [bdf, pcf] Minor optimization.Alexei Podtelezhnikov2021-09-223-3/+3
| | | | | | | * src/pcf/pcfread.c (pcf_load_font): Do not call `FT_MulDiv` for a small job. * src/bdf/bdfdrivr.c (BDF_Face_Init): Ditto. * src/bdf/bdflib.c (_bdf_parse_glyphs): Fix a comment.
* [base] Initialize stream memory earlier.Alexei Podtelezhnikov2021-09-223-11/+11
| | | | | | | | | | | | With Windows memory management tracking heap, it is important to use it during the stream opening fallback. In Unix, the argument is unused, but it is better to set it correctly. * src/base/ftobjs.c (FT_Stream_New): Set memory before calling `FT_Stream_Open`. * builds/windows/ftsystem.c, builds/unix/ftsystem.c (FT_Stream_Open, ft_close_stream_by_free): Call `ft_alloc` and `ft_free` with proper memory argumment.
* [builds/windows] Revert back to `CreateFileA` only.Alexei Podtelezhnikov2021-09-211-25/+60
| | | | | | | | | | | Calling `CreateFileW` without making sure that the patname is really `wchar_t` is a bad idea and can lead to unpredictable overreads. For Windows CE, we impelemnt the missing API. Fixes #1098 and !76 again. * builds/windows/ftsystem.c (FT_Stream_Open): Call `CreateFileA`. [_WIN32_WCE] (CreateFileA, FileSizeEx): Implement missing interfaces.
* * src/bdf/bdflib.c (_bdf_parse_{start,glyphs}): Use appropriate scanner.Alexei Podtelezhnikov2021-09-211-3/+3
|
* Minor.Alexei Podtelezhnikov2021-09-204-4/+4
|
* * src/cff/cffdrivr.c (cff_ps_get_font_{info,extra}): Use FT_QNEW.Alexei Podtelezhnikov2021-09-201-9/+9
|
* [cache] Minor clean-ups.Alexei Podtelezhnikov2021-09-182-4/+3
| | | | | | * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Remove parantheses. * src/cache/ftccache.c (FTC_Cache_Lookup): Ditto. (FTC_Cache_RemoveFaceID): Remove unnecessary variable.
* [builds/windows] Try both wide and narrow `CreateFile`Alexei Podtelezhnikov2021-09-171-3/+15
| | | | | | | | | | | | Windows handles wchar_t* UTF-16 and char* ANSI (presently UTF-8) filenames using alternative -A and -W API. We'll try them both when opening a file. This means that you should not worry about about conversions. Fixes #1098 and !76. * builds/windows/ftsystem.c (FT_Stream_Open): Call alternative `CreateFile` in the case of failure.
* [cff] Explicitly set StandardEncoding or ExpertEncoding offsets.Edwin Steiner2021-09-161-1/+2
| | | | | | Fixes #1097. * src/cff/cffload.c (cff_encoding_load): Set special offset values.
* [cache] Miscellaneous clean-ups.Alexei Podtelezhnikov2021-09-163-12/+10
| | | | | | | | * src/cache/ftccache.c (ftc_get_top_node_for_hash, FTC_Cache_Clear): Remove barely used variables. (ftc_cache_add): Adjust casting. * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Remove casting. * src/cache/ftcsbits.c (ftc_snode_load): Remove casting.
* * src/cff/cffload.c (cff_fd_select_get): Remove casting.Alexei Podtelezhnikov2021-09-161-2/+1
|
* * src/pcf/pcfread.c (pcf_read_TOC): Remove casting.Alexei Podtelezhnikov2021-09-161-1/+1
|
* Minor type adjustments.Alexei Podtelezhnikov2021-09-143-12/+12
| | | | | | * 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.
* Replace boolean allocation macros with MEM ones.Alexei Podtelezhnikov2021-09-148-13/+13
| | | | | | | | | | | * src/base/ftbitmap.c (FT_Bitmap_Copy): Use MEM-macro. * src/base/ftobjs.c (ft_glyphslot_alloc_bitmap): Ditto. * src/bzip2/ftbzip2.c (ft_bzip2_alloc): Ditto. * src/cache/ftccache.c (ftc_cache_init): Ditto * src/gzip/ftgzip.c (ft_gzip_alloc): Ditto. * src/psnames/psmodule.c (ps_unicodes_init): Ditto. * src/sfnt/sfobjs.c (sfnt_load_face): Ditto. * src/sfnt/ttload.c (tt_face_load_name): Ditto.
* [cache] Revert to some zeroing.Alexei Podtelezhnikov2021-09-141-4/+4
| | | | | * src/cache/ftccache.c (ftc_cache_init, ftc_cache_resize): Zero `buckets` again to fix some crashes.
* * src/pshinter/pshrec.c (ps_mask_table_merge_all): Tweak loops.Alexei Podtelezhnikov2021-09-141-3/+2
| | | | | | Fixes fallout from 731d0b685685 reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38685
* [cff, pshinter] Clean up unsigned counters.Alexei Podtelezhnikov2021-09-133-18/+15
| | | | | | | | | Loops with unsigned decrement can be reliably stopped when the counter wraps around after reaching zero. * src/cff/cffload.c (cff_charset_compute_cids): Use unsigned counter. * src/pshinter/pshalgo.c (psh_hint_table_activate_mask): Ditto. * src/pshinter/pshrec.c (ps_mask_table_merge): Ditto.
* [bdf, psnames, sfnt] Avoid some memory zeroing.Alexei Podtelezhnikov2021-09-133-3/+2
| | | | | | * src/bdf/bdfdrivr.c (BDF_Face_Init): Use Q-macro. * src/sfnt/sfobjs.c (sfnt_load_face): Ditto. * src/psnames/psmodule.c (src/psnames/psmodule.c): Remove zero.
* * src/base/ftobjs.c (FT_CMap_New): Revert to zeroing.Alexei Podtelezhnikov2021-09-131-1/+1
| | | | | | Fixes fallout from c1fa7aa2bc96, reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38641
* [truetype] Clean up `exec` initialization.Alexei Podtelezhnikov2021-09-131-65/+7
| | | | | * src/truetype/ttinterp.c (Init_Context): Absorbed into... (TT_New_Context): ... this function.
* [truetype] Avoid some memory zeroing.Alexei Podtelezhnikov2021-09-123-3/+3
| | | | | | * src/truetype/ttgload.c (load_truetype_glyph): Use Q-macro. * src/truetype/ttinterp.c (Update_Max): Ditto. * src/truetype/ttpload.c (src/truetype/ttpload.c): Ditto.
* [base] Avoid some memory zeroing.Alexei Podtelezhnikov2021-09-121-13/+13
| | | | | * src/base/ftobjs.c (FT_New_Size, FT_CMap_New, FT_CMap_Done, ft_open_face_internal, ft_open_face_internal): Use Q-macros.
* [cache, psaux] Remove zeros.Alexei Podtelezhnikov2021-09-122-4/+3
| | | | | * src/cache/ftcmru.c (FTC_MruList_New): Remove initialization. * src/psaux/psstack.c (cf2_stack_init): Ditto.
* [cache] Avoid some memory zeroing.Alexei Podtelezhnikov2021-09-123-5/+5
| | | | | | * src/cache/ftcmru.c (FTC_MruList_New): Use Q-macro. * src/cache/ftcmanag.c (FTC_Manager_RegisterCache): Ditto. * src/cache/ftccache.c (ftc_cache_init, ftc_cache_resize): Ditto.