summaryrefslogtreecommitdiff
path: root/src/cache/ftccmap.c
Commit message (Collapse)AuthorAgeFilesLines
* Update all copyright notices.Werner Lemberg2023-01-171-1/+1
|
* * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Avoid `FT_Set_Charmap`. Alexei Podtelezhnikov2022-10-031-8/+6
| | | | | Set charmap aggressively without all validations of `FT_Set_Charmap` because we take it from the available array and only temporarily. Even CMap Format 14 will gracefully return 0.
* [cache] Remove some casts, clean up tracing.Alexei Podtelezhnikov2022-08-011-1/+1
| | | | | | | | | * src/cache/ftcbasic.c (FTC_ImageCache_Lookup, FTC_SBitCache_Lookup): Clean up tracing types. * src/cache/ftccache.c (ftc_node_destroy): Ditto. * src/cache/ftcmanag.c (FTC_Manager_Check): Ditto. (FTC_Manager_Check, FTC_Node_Unref): Remove a cast. * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Ditto.
* Fix clang++ warnings.Werner Lemberg2022-03-311-1/+1
| | | | | | | | | | | | | * src/base/ftglyph.c (ft_svg_glyph_prepare), src/base/ftobj.c (ft_glyphslot_init), src/cache/ftccmap.c (ftc_cmap_node_new), src/cache/ftcimage.c (FTC_INode_New), src/lzw/ftlzw.c (FT_Stream_OpenLZW), src/psaux/psobjs.c (ps_parser_load_field), src/pshinter/pshglob.c (psh_globals_new), src/sfnt/ttsvg.c (tt_face_load_svg_doc): Initialize variables used for allocation. * src/sdf/ftsdf.c (split_sdf_conic, split_sdf_cubic): Change type of `max_splits` to FT_UInt. (sdf_generate_bounding_box): Add cast.
* [cache] Avoid unnecessary zeroing.Alexei Podtelezhnikov2022-01-141-2/+2
| | | | | | * src/cache/ftccmap.c (ftc_cmap_node_new): Use `FT_QNEW`. * src/cache/ftcimage.c (FTC_INode_New): Ditto. * src/cache/ftcsbits.c (FTC_SNode_New): Ditto.
* Update all copyright notices.Werner Lemberg2022-01-111-1/+1
|
* [cache] Miscellaneous clean-ups.Alexei Podtelezhnikov2021-09-161-4/+3
| | | | | | | | * 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.
* Update all copyright notices.Werner Lemberg2021-01-171-1/+1
|
* Remove redundant inclusion of `ft2build.h'.Werner Lemberg2020-06-131-1/+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-081-5/+5
| | | | | | | | | | | | | | | | | 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.
* Update all copyright notices.Werner Lemberg2020-01-191-1/+1
|
* Update all copyright notices.Werner Lemberg2019-02-231-1/+1
|
* Update copyright years.Werner Lemberg2019-01-221-1/+1
|
* Don't use `trace_' prefix for FT_COMPONENT arguments.Werner Lemberg2018-08-151-1/+1
| | | | | | | | * 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.
* [GSoC] src/*.*: Convert block comments to `light' style.Werner Lemberg2018-06-031-28/+28
| | | | | | | | | | | This monster commit was created by applying Nikhil's scripts `docconverter.py' and `markify.py' to all C header and source files, followed up by minor manual clean-up. No change in functionality, of course. I used commit f7419907bc6044b9b7057f9789866426c804ba82 from https://github.com/nikramakrishnan/freetype-docs.git.
* Update copyright year.Werner Lemberg2018-01-021-1/+1
|
* Update copyright year.Werner Lemberg2017-01-041-1/+1
|
* s/0/NULL/ for function pointers; comments, formatting.Werner Lemberg2016-09-171-7/+7
|
* [cache] Allow value 0 for face ID.Werner Lemberg2016-05-071-3/+0
| | | | | | | | | | We never dereference `face_id', and some implementations might use a running number instead of a pointer. Additionally, disallowing value zero was undocumented. * src/cache/ftccmap.c (FTC_CMapCache_Lookup), src/cache/ftcmanag.c (FTC_Manager_LookupFace, FTC_Manager_RemoveFaceID): Remove test for `face_id'.
* Update copyright year.Werner Lemberg2016-01-131-1/+1
|
* Don't use macro names that start with `_[A-Z]' [3/3].Werner Lemberg2016-01-121-1/+1
| | | | | | | | | Such macro names are reserved for both C and C++. * src/cache/ftccache.h: s/_FTC_FACE_ID_HASH/FTC_FACE_ID_HASH/. Update all callers. (FTC_CACHE_LOOKUP_CMP): Replace `_XXX' with `XXX_'. * src/cache/ftcmru.c (FTC_MRULIST_LOOKUP_CMP): Ditto.
* Various compiler warning fixes for `make multi'.Werner Lemberg2015-03-011-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/autofit/afcjk.c (af_cjk_hints_compute_blue_edges), src/autofit/aflatin.c (af_latin_hint_compute_blue_edges, af_latin_hint_edges), src/autofit/aflatin2.c (af_latin2_hints_compute_blue_edges, af_latin2_hint_edges): Declare as `static'. * src/cache/ftccmap.c (FTC_CMAP_QUERY_HASH, FTC_CMAP_NODE_HASH): Removed. Unused. * src/cache/ftcimage.c: Include FT_INTERNAL_OBJECTS_H. * src/cache/ftcmanag.c (FTC_LRU_GET_MANAGER): Removed. Unused. * src/cff/cf2intrp.c: Include `cf2intrp.h'. * src/cff/cffdrivr.c (PAIR_TAG): Removed. Unused. * src/gzip/ftgzip.c (NO_DUMMY_DECL): Removed. Unused. * src/psaux/afmparse.c (afm_parser_read_int): Declare as `static'. * src/pshinter/pshalgo.c (STRONGER, PSH_ZONE_MIN, PSH_ZONE_MAX): Removed. Unused. * src/raster/ftraster.c (Render_Glyph): Declare as `static'. * src/sfnt/ttpost.c (load_format_20): Fix signedness warning. * src/truetype/ttdriver.c (PAIR_TAG): Removed. Unused. * src/truetype/ttsubpix.c (is_member_of_family_class, is_member_of_style_class): Declare as `static'. * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Declare as `static'. * src/type1/t1load.c (mm_axis_unmap, mm_weights_unmap): Declare as `static'. (T1_FIELD_COUNT): Removed. Unused. * src/type1/t1parse.h (T1_Done_Table): Removed. Unused. * src/type42/t42parse.c (T1_Done_Table): Removed. Unused.
* [cache] Signedness fixes.Werner Lemberg2015-02-251-1/+1
| | | | | * src/cache/ftcbasic.c, src/cache/ftccmap.c, src/cache/ftcimage.c, src/cache/ftcmanag.c, src/cache/ftcsbits.c: Apply.
* [cache] Replace `FT_PtrDist' with `FT_Offset'.Werner Lemberg2015-02-231-1/+1
| | | | | | | | | | | | * src/cache/ftccache.h (FTC_NodeRec): `FT_Offset' (a.k.a. `size_t') is a better choice for `hash' to hold a pointer than `FT_PtrDist' (a.k.a. `ptrdiff_t'), especially since the latter is signed, causing zillions of signedness warnings. [Note that `hash' was of type `FT_UInt32' before the change to `FT_PtrDist.] Update all users. * src/cache/ftcbasic.c, src/cache/ftccache.c, src/cache/ftccmap.c, src/cache/ftcglyph.c, src/cache/ftcglyph.h: Updated.
* Run `src/tools/update-copyright'.Werner Lemberg2015-01-171-1/+1
|
* * src/*: Add checks for parameters of API functions where missing.Werner Lemberg2014-11-261-0/+3
| | | | | | | | | | | | | | | | | | | | `API functions' are functions tagged with `FT_EXPORT_DEF'. Besides trivial fixes, the following changes are included, too. * src/base/ftbdf.c (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property): Set error code if no service is available. * src/base/ftinit.c (FT_Done_FreeType): Change return value for invalid `library' parameter to `Invalid_Library_Handle'. * src/base/ftobjs.c (FT_New_Size): Change return value for invalid `asize' parameter to `Invalid_Argument'. * src/base/ftoutln.c (FT_Outline_Copy): Change return value for invalid `source' and `target' parameters to `Invalid_Outline'. (FT_Outline_Done_Internal): Change return value for invalid `outline' parameter to `Invalid_Outline'.
* Remove all code related to FT_MAX_CHARMAP_CACHEABLE.Werner Lemberg2014-11-241-6/+0
| | | | | | | This is no longer used. * src/base/ftobjs.c, src/cache/ftccmap.c, src/cff/cffobjs.c, src/sfnt/ttcmap.c: Do it.
* Fix clang warnings.Sean McBride2014-03-181-2/+2
| | | | | | | | | | | | | | | | | | | * src/autofit/aflatin.c (af_latin_metrics_init_blues): Initialize some variables. * src/base/ftcalc.c (FT_MulFix): Only use code if `FT_MULFIX_INLINED' is not defined. * src/bdf/bdfdrivr.c (bdf_cmap_class), src/cache/ftcbasic.c (ftc_basic_image_family_class, ftc_basic_image_cache_class, ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class), src/cache/ftccmap.c (ftc_cmap_cache_class), src/cache/ftcmanag.c (ftc_size_list_class, ftc_face_list_class), src/pcf/pcfdrivr.c (pcf_cmap_class), src/pfr/pfrdrivr.c (pfr_metrics_service_rec): Make function static. * src/type1/t1driver.c (t1_ps_get_font_value): Remove redundant code.
* */* [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove macro and guarded code.Werner Lemberg2013-05-101-104/+4
|
* Various compiler warning fixes.Werner Lemberg2012-12-171-3/+2
| | | | | | | | | | | | | * include/freetype/internal/ftserv.h (FT_SERVICE_UNAVAILABLE): Use `logical not' operator instead of negation. The idea is that `~' returns exactly the data type enforced by the cast to a pointer (be it 32bit or 64bit or whatever), while a negative integer has not this flexibility. * src/cache/ftccmap.c (FTC_CMAP_UNKNOWN): Ditto. * src/truetype/ttgxvar.c (ALL_POINTS, TT_Get_MM_Var): Ditto. * src/type/t1load.c (T1_Get_MM_Var): Ditto. (parse_blend_axis_types): Use cast. * src/bdf/bdflib.c (_bdf_readstream): Use cast.
* Remove trailing spaces.suzuki toshiya2012-01-171-1/+1
|
* Cleanup/formatting.Werner Lemberg2011-01-131-1/+2
|
* [cache] Notice if a cache query induced the node list change.suzuki toshiya2011-01-091-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some node comparators (comparing the cache node content and the properties specified by the query) can flush the cache node to prevent the cache inflation. The change may invalidate the pointers to the node obtained before the node comparison, so the change should be noticed to the caller. The problem caused by the cache node changing is reported by Harsha, see Savannah bug #31923. * src/cache/ftccache.h (FTC_Node_CompareFunc): Add new argument `FT_Bool* list_changed' to indicate the change of the cached nodes to the caller. (FTC_CACHE_LOOKUP_CMP): Watch the change of the cached nodes by `_list_changed'. (FTC_CACHE_TRYLOOP_END): Take new macro argument `_list_changed' and update it when FTC_Manager_FlushN() flushes any nodes. * src/cache/ftccback.h (ftc_snode_compare): Updated to fit with new FTC_Node_CompareFunc type. (ftc_gnode_compare): Ditto. * src/cache/ftcbasic.c: Include FT_INTERNAL_OBJECTS_H to use TRUE/FALSE macros. (ftc_basic_gnode_compare_faceid): New argument `FT_Bool* list_changed' to indicate the change of the cache nodes, anyway, it is always FALSE. * src/cache/ftccmap.c: Include FT_INTERNAL_OBJECTS_H to use TRUE/FALSE macros. (ftc_cmap_node_compare): New argument `FT_Bool* list_changed' to indicate the change of the cache nodes, anyway, it is always FALSE. (ftc_cmap_node_remove_faceid): Ditto. * src/cache/ftccache.c (FTC_Cache_NewNode): Pass a NULL pointer to FTC_CACHE_TRYLOOP_END(), because the result is not needed. (FTC_Cache_Lookup): Watch the change of the cache nodes by `list_changed'. (FTC_Cache_RemoveFaceID): Ditto. * src/cache/ftcglyph.c: Include FT_INTERNAL_OBJECTS_H to use TRUE/FALSE macros. (ftc_gnode_compare): New argument `FT_Bool* list_changed' to indicate the change of the cache nodes, anyway, it is always FALSE. (FTC_GNode_Compare): New argument `FT_Bool* list_changed' to be passed to ftc_gnode_compare(). * src/cache/ftcglyph.h (FTC_GNode_Compare): Ditto. * src/cache/ftcsbits.c (ftc_snode_compare): New argument `FT_Bool* list_changed' to indicate the change of the cache nodes, anyway. It is updated by FTC_CACHE_TRYLOOP(). (FTC_SNode_Compare): New argument `FT_Bool* list_changed' to be passed to ftc_snode_compare(). * src/cache/ftcsbits.h (FTC_SNode_Compare): Ditto.
* [cache] Change the hash types to FT_PtrDist.suzuki toshiya2010-10-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On LLP64 platforms (e.g. Win64), FT_ULong (32-bit) variables are inappropriate to calculate hash values from the memory address (64-bit). The hash variables are extended from FT_ULong to FT_PtrDist and new hashing macro functions are introduced. The hash values on 16-bit memory platforms are changed, but ILP32 and LP64 are not changed. The hash value in the cache subsystem is not reverted to the memory address, so using signed type FT_PtrDist is safe. * src/cache/ftccache.h (_FTC_FACE_ID_HASH): New hash function to replace FTC_FACE_ID_HASH() for portability. * src/cache/ftcmanag.h (FTC_SCALER_HASH): Replace FTC_FACE_ID_HASH() by _FTC_FACE_ID_HASH(). * src/cache/ftccmap.c (FTC_CMAP_HASH): Ditto. * src/cache/ftccache.h (FTC_NodeRec): The type of the member `hash' is changed from FT_UInt32 to FT_PtrDist. * src/cache/ftccache.h (FTC_Cache_Lookup): The type of the argument `hash' is changed from FT_UInt32 to FT_PtrDist. (FTC_Cache_NewNode): Ditto. * src/cache/ftccache.c (ftc_cache_add): Ditto. (FTC_Cache_Lookup): Ditto. (FTC_Cache_NewNode): Ditto. * src/cache/ftcglyph.h (FTC_GCache_Lookup): Ditto. * src/cache/ftcglyph.c (FTC_GCache_Lookup): Ditto. * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): The type of the internal variable `hash' is changed to FT_PtrDist from FT_UInt32. (FTC_ImageCache_LookupScaler): Ditto. (FTC_SBitCache_Lookup): Ditto. (FTC_SBitCache_LookupScaler): Ditto. * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Ditto. * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Ditto. Also the type of the internal variable `_idx' is changed to FT_PtrDist from FT_UInt32 for better pointer calculation.
* Remove C++ warnings.Werner Lemberg2010-07-121-2/+3
| | | | */*: Initialize pointers where necessary to make g++ happy.
* Restrict the number of the charmaps in a rogue-compatible mode.suzuki toshiya2010-07-051-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for Savannah bug #30059. * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Replace `16' the minimum character code passed by a legacy rogue client by... * include/freetype/config/ftoption.h (FT_MAX_CHARMAP_CACHEABLE): This. It is undefined when FT_CONFIG_OPTION_OLD_INTERNALS is undefined (thus the rogue client compatibility is not required). * src/cff/cffobjs.c (cff_face_init): Abort the automatic selection or synthesis of Unicode cmap subtable when the charmap index exceeds FT_MAX_CHARMAP_CACHEABLE. * src/sfnt/ttcmap.c (tt_face_build_cmaps): Issue error message when the charmap index exceeds FT_MAX_CHARMAP_CACHEABLE. * src/base/ftobjs.c (find_unicode_charmap): When Unicode charmap is found after FT_MAX_CHARMAP_CACHEABLE, ignore it and search earlier one. (find_variant_selector_charmap): When UVS charmap is found after FT_MAX_CHARMAP_CACHEABLE, ignore it and search earlier one. (FT_Select_Charmap): When a charmap matching with requested encoding but after FT_MAX_CHARMAP_CACHEABLE, ignore and search earlier one. (FT_Set_Charmap): When a charmap matching with requested charmap but after FT_MAX_CHARMAP_CACHEABLE, ignore and search earlier one. (FT_Get_Charmap_Index): When a requested charmap is found after FT_MAX_CHARMAP_CACHEABLE, return the inverted charmap index.
* [cache] Fold too long lines.suzuki toshiya2009-09-291-5/+12
|
* [cache] Fix Savannah bug #27441, cleanup Redhat bugzilla #513582.suzuki toshiya2009-09-271-7/+7
|
* cache: Fix some data types mismatching with their sources.suzuki toshiya2009-08-011-1/+1
|
* For warning messages, replace FT_ERROR with FT_TRACE0.Werner Lemberg2009-06-261-1/+1
| | | | | | | FT_ERROR is now used only if a function produces a non-zero `error' value. Formatting, improving and harmonizing debug strings.
* Remove redundant header inclusions.Werner Lemberg2009-03-211-1/+0
| | | | | | This covers many Ghostscript Coverity issues. * src/*: Do it.
* Whitespace.Werner Lemberg2009-03-201-3/+3
|
* Fix Savannah bug #25923.Werner Lemberg2009-03-201-2/+2
| | | | * src/cache/ftccmap.c (FTC_CMAP_HASH): Fix typo.
* * autogen.sh, builds/unix/configure.raw,Werner Lemberg2008-09-121-8/+8
| | | | | | | | | | | | | | include/freetype/config/ftconfig.h, builds/unix/ftconfig.in: Minor beautifying. * include/freetype/ftadvanc.h, include/freetype/ftgasp.h, include/freetype/ftlcdfil.h: Protect against FreeType 1. Some other minor fixes. * devel/ftoption.h: Synchronize with include/freetype/config/ftoption.h. Formatting, documentation improvements.
* * include/freetype/ftcache.h, src/cache/ftccmap.c:David Turner2008-09-021-3/+15
| | | | | | modify FTC_CMapCache_Lookup to accept a negative cmap index to mean "use default cached FT_Face's charmap". This fixes Savannah issue #22625
* * src/base/ftobjs.c (FT_Request_Metrics), src/cache/ftccmap.cWerner Lemberg2007-06-011-2/+1
| | | | (FTC_CMapCache_Lookup): Remove unused code.
* * src/truetype/ttgload.c (TT_Load_Composite_Glyph)Werner Lemberg2006-05-171-3/+3
| | | | | | | [FT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Make it compilable again. Formatting, documentation fixes.
* * src/ftccmap.c (FTC_CMapCache_Lookup): changed the thresholdDavid Turner2006-05-171-2/+6
| | | | | | used to detect rogue clients from 4 to 16. This is to prevent some segmentation faults with fonts like KozMinProVI-Regular.otf which comes from the Japanese Adobe Reader Asian Font pack.
* * include/freetype/cache/ftccache.h,David Turner2006-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | include/freetype/cache/ftccmap.h, include/freetype/cache/ftcglyph.h include/freetype/cache/ftcimage.h include/freetype/cache/ftcmanag.h include/freetype/cache/ftcmru.h include/freetype/cache/ftcsbits.h: removing these header files from the public include directory. * include/freetype/config/ftheader.h: changing the definition of FT_CACHE_INTERNAL_XXX_H macros to redirect to FT_CACHE_H instead * src/cache/ftcbasic.c, src/cache/ftccache.c, src/cache/ftccache.h, src/cache/ftccback.h, src/cache/ftccmap.c, src/cache/ftcglyph.c, src/cache/ftcglyph.h, src/cache/ftcimage.c, src/cache/ftcimage.h, src/cache/ftcmanag.c, src/cache/ftcmanag.h, src/cache/ftcmru.c, src/cache/ftcmru.h, src/cache/ftcsbits.c, src/cache/ftcsbits.h: modifications to prevent using the FT_CACHE_INTERNAL_XXX_H macros, and grab the headers in 'src/cache' instead (see below).
* * include/freetype/cache/ftccache.hWerner Lemberg2006-02-271-2/+0
| | | | | [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove declaration of ftc_node_done.