summaryrefslogtreecommitdiff
path: root/src/pcf
Commit message (Collapse)AuthorAgeFilesLines
* [pcf] Delay encoding allocation and avoid its zeroing.Alexei Podtelezhnikov2022-01-261-15/+10
| | | | * src/pcf/pcfread.c (pcf_get_encodings): Refactor and use FT_QNEW_ARRAY.
* [pcf] Zero out the allocated properties.Alexei Podtelezhnikov2021-10-181-1/+2
| | | | | | | | Fallout reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40033 * src/pcf/pcfread.c (pcf_get_properties): Use FT_NEW_ARRAY and zero out `properties` in case of failure.
* [bdf, pcf] Minor optimization.Alexei Podtelezhnikov2021-09-221-1/+1
| | | | | | | * 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.
* * src/pcf/pcfread.c (pcf_read_TOC): Remove casting.Alexei Podtelezhnikov2021-09-161-1/+1
|
* [bdf,pcf] Avoid memory zeroing (contd.).Alexei Podtelezhnikov2021-05-021-2/+2
| | | | | | * src/bdf/bdflib.c (bdf_create_property, _bdf_add_comment, _bdf_add_property, bdf_load_font): Tweak allocation macros. * src/pcf/pcfread.c (pcf_get_properties, pcf_get_metrics): Ditto.
* [bdf,pcf] Avoid some memory zeroing.Alexei Podtelezhnikov2021-04-251-11/+8
| | | | | | | | | * src/pcf/pcfread.c (pcf_read_TOC, pcf_get_properties, pcf_load_font): Tweak memory macros. * src/bdf/bdfdrivr.c (BDF_Face_Init): Ditto. * src/bdf/bdflib.c (_bdf_readstreami, bdf_create_property, _bdf_parse_glyphs, _bdf_parse_start): Ditto. (_bdf_add_property): Do not handle zero size.
* [pcf,bdf,winfonts] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.Alexei Podtelezhnikov2021-04-231-1/+1
| | | | | | * src/pcf/pcfread.c (pcf_interpret_style): Do not zero out the buffer. * src/bdf/bdfdrivr.c (bdf_interpret_style): Ditto. * src/winfonts/winfnt.c (FNT_Face_Init, FNT_Load_Glyph): Ditto.
* * src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`.Werner Lemberg2021-02-041-9/+9
| | | | | | | | 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.
* * src/*: Don't use more than one '\n' in `FT_TRACE` and `FT_ERROR`.Werner Lemberg2020-12-051-20/+19
| | | | | This ensures good logging output, with all lines having a proper prefix (if requested).
* Downgrade property tracing.Alexei Podtelezhnikov2020-11-201-3/+3
|
* Fix `-Wformat' compiler warnings.Priyesh Kumar2020-07-281-10/+10
| | | | | | * src/*: Fix format specifiers. * builds/unix/ftsystem.c (FT_Stream_Open): Ditto.
* Fix `-Wformat' compiler warnings.Werner Lemberg2020-07-251-2/+3
| | | | | | | | | | | | | | | | | | | | Problem reported by Priyesh kumar <priyeshkkumar@gmail.com> * src/base/ftoutln.c (FT_Outline_Decompose): Fix number of arguments to tracing macro. * src/bdf/bdfdrivr.c (bdf_cmap_char_next, bdf_get_bdf_property): Ditto. * src/cache/ftcbasic.c (ftc_basic_family_get_count): Ditto. Reformulate message. * src/pcf/pcfdrivr.c (pcf_get_bdf_property): Ditto. * src/sfnt/sfwoff2.c (woff2_open_font): Ditto. Trace table offset, too. * src/truetype/ttgxvar.c (ft_var_apply_tuple): Ditto.
* Fix clang warnings.Werner Lemberg2020-07-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/freetype/internal/autohint.h (FT_DECLARE_AUTOHINTER_INTERFACE): New macro. * src/autofit/afmodule.h: Use it to declare `af_autofitter_interface'. * include/freetype/internal/ftobjs.h (FT_DECLARE_GLYPH): New macro. * src/base/ftbase.h: Use it to declare `ft_bitmap_glyph_class' and `ft_outline_glyph_class'. * src/base/ftglyph.c: Include `ftbase.h'. * src/cff/cffparse.c (cff_parser_run): Fix type of `t2_size'. * src/pcf/pcfdrivr.c (pcf_cmap_char_next): Fix type of `result'. * src/psaux/psauxmod.c (psaux_module_class): Use `FT_DEFINE_MODULE'. * src/psaux/psauxmod.h: Declare `afm_parser_funcs', `t1_cmap_classes', `cff_decoder_funcs', and `psaux_module_class'. * src/pshinter/pshmod.c: Include `pshmod.h'. * src/sfnt/sfwoff2.c (ROUND4, WRITE_SHORT): Fix implicit sign conversion. (compute_ULong_sum): Fix return type. Fix implicit sign conversion. (store_points): Fix type of `last_flag', `repeat_count', and `flag'. Use casts to avoid warnings. (reconstruct_glyf): Fix implicit sign conversion. Use cast to avoid warning. (get_x_mins): Fix implicit sign conversion. * src/sfnt/ttcmap.c: Undef `TTCMAPCITEM'. * src/sfnt/ttcmap.h: Define `TTCMAPCITEM' and include `ttcmapc.h' to declare cmap classes. * src/smooth/ftsmooth.c (ft_smooth_overlap_spans): Use cast. * src/truetype/ttinterp.c (Ins_MIAP): Fix typo.
* [build] Fix multi and C++ builds.David Turner2020-07-061-1/+1
| | | | | | | | | | | | | | | | | | The following builds were failing due to previous changes: make multi make multi CC="c++" * include/freetype/config/ftconfig.h: Remove `FT_END_HEADER'. * include/freetype/config/ftheader.h (FT_BEGIN_HEADER, FT_END_HEADER): Protect against redefinition. * src/cache/ftccache.h, src/cache/ftcmru.h, src/pcf/pcfutil.h, src/psaux/pserror.h, src/psaux/psft.h, src/psaux/psstack.h, src/sfnt/woff2tags.h: Include `compiler-macros.h'. * src/sfnt/woff2tags.c: Include `woff2tags.h'.
* Remove redundant inclusion of `ft2build.h'.Werner Lemberg2020-06-137-7/+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-085-21/+21
| | | | | | | | | | | | | | | | | 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-32/+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-191-1/+1
|
* [bdf,pcf] Use `const' for string literals.Alexei Podtelezhnikov2019-06-101-10/+9
| | | | | | | | * src/bdf/bdf.h (bdf_property_t): Updated `name'. * src/bdf/bdflib.c (_bdf_list_split,bdf_create_property, _bdf_add_property,_bdf_ato*): Updated. * src/bdf/bdfdrivr.c (bdf_interpret_style): Updated. * src/pcf/pcfread.c (pcf_intrpret_style): Ditto.
* [pcf] Fix handling of undefined glyph (#56067).Werner Lemberg2019-04-193-83/+93
| | | | | | | | | | | | | | | | | | This commit fixes the changes from 2018-07-21, which broke charmap iteration. We now add the default character as a new glyph with index 0, thus increasing the number of glyphs by one (as before). * src/pcf/pcfread.c (pcf_get_metrics): Adjust to new artificial glyph with index 0. Limit number of elements to 65534. (pcf_get_bitmaps): Ditto. Unify two loops into one; this avoids allocation of an intermediate array. (pcf_get_encodings): Don't flip indices but copy glyph metrics of default character to index 0. Also handle invalid default character. * docs/CHANGES: Updated.
* Update all copyright notices.Werner Lemberg2019-02-231-1/+1
|
* Update copyright years.Werner Lemberg2019-01-221-1/+1
|
* [pcf] Replace charmap implementation.Alexei Podtelezhnikov2018-09-203-119/+73
| | | | | | | | | | | PCF comes with charmap lookup table, aka PCF encodings. Using it directly makes FT_Get_Char_Index and FT_Get_Next_Char 4-5 times faster than the original BDF-like binary searches. * src/pcf/pcf.h (PCF_EncodingRec): Removed. (PCF_FaceRec): Remove `nencodings' and `encodings'. * src/pcf/pcfdrivr.c (pcf_cmap_char_{index,next}): Replaced. * src/pcf/pcfread.c (pcf_get_encodings): Store data differently.
* [pcf] Prepare to replace charmap implementation.Alexei Podtelezhnikov2018-09-192-58/+94
| | | | | | | * src/pcf/pcf.h (PCF_Face): Updated to include... (PCF_EncRec): ... this new structure to store charmap geometry. * src/pcf/pcfread.c (pcf_get_encodings): Store charmap geometry.
* Remove unused fields.Alexei Podtelezhnikov2018-09-181-3/+0
| | | | | | * src/pcf.h (PCF_FaceRec): Remove `charmap' and `charmap_handle'. * src/bdfdrvr.h (BDF_FaceRec): Ditto. * src/winfonts/winfnt.h (FNT_FaceRec): Ditto.
* Don't use `trace_' prefix for FT_COMPONENT arguments.Werner Lemberg2018-08-152-3/+3
| | | | | | | | * 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.
* [pcf] Revert massive unsigning.Alexei Podtelezhnikov2018-08-083-54/+90
|
* [pcf] Massive unsigning (part 2).Alexei Podtelezhnikov2018-08-082-53/+29
| | | | | | | | | | Treat all size related properties as unsigned values. * src/pcf/pcf.h (PCF_ParsePropertyRec): Use unsigned `name' and `value'. * src/pcf/pcfread.c (pcf_get_propeerties, pcf_load_font): Updated parsing code and handling of AVERAGE_WIDTH, POINT_SIZE, PIXEL_SIZE, RESOLUTION_X and RESOLUTION_Y.
* [pcf] Massive unsigning (part 1).Alexei Podtelezhnikov2018-08-083-37/+25
| | | | | | | | | | | | Unofficial specifications hesitate to use unsigned 32-bit integers. Negative values caused a lot of trouble in the past and it is safer and easier to treat some properties as unsigned. * src/pcf/pcf.h (PCF_AccelRec): Use unsigned values for `fontAscent', `fontDescent', and `maxOverlap'. * src/pcf/pcfread.c (pcf_load_font, pcf_get_accel): Updated. * src/pcf/pcfdrivr.c (PCF_Glyph_Load, PCF_Size_Select, PCF_Size_Request): Updated.
* * src/pcf/pcfread.c (pcf_get_bitmaps): Unsign `offsets' and `bitmapSizes'.Alexei Podtelezhnikov2018-08-071-15/+14
|
* [pcf] Use unsigned types.Alexei Podtelezhnikov2018-08-063-29/+26
| | | | | | * src/pcf/pcf.h (PCF_Encoding): Use unsigned `enc'. * src/pcf/pcfdrivr.c (pcf_cmap_char_{index,next}): Ditto. * src/pcf/pcfread.c (pcf_get_encodings): Use unsigned types.
* Fix clang warnings.Werner Lemberg2018-08-041-4/+4
| | | | | | | | | | | | * 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/pcf/pcfread.c (pcf_get_encodings): Another thinko.Werner Lemberg2018-07-291-1/+2
| | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9608
* * src/pcf/pcfread.c (pcf_get_encodings): Thinko.Werner Lemberg2018-07-241-0/+3
| | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9561
* * src/pcf/pcfread.c (pcf_get_encodings): Check index of defaultChar.Werner Lemberg2018-07-221-0/+8
| | | | | | Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9527
* * src/pcf/pcfread.c (pcf_load_font): Fix number of glyphs.Werner Lemberg2018-07-221-8/+1
| | | | | | | | This is an oversight of the module change 2018-07-21. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9524
* [pcf] Fix handling of the undefined glyph.Werner Lemberg2018-07-213-12/+73
| | | | | | | | | | | | | | | | | | | This change makes the driver use the `defaultChar' property of PCF files. * src/pcf/pcf.h (PCF_FaceRec): Change type of `defaultChar' to unsigned. * src/pcf/pcfread.c (pcf_get_encodings): Read `defaultChar' as unsigned. Validate `defaultChar'. If `defaultChar' doesn't point to glyph index zero, swap glyphs with index zero and index `defaultChar' and adjust the encodings accordingly. * src/pcf/pcfdrivr.c (pcf_cmap_char_index, pcf_cmap_char_next, PCF_Glyph_Load): Undo change from 2002-06-16 which always enforced the first character in the font to be the default character.
* * src/pcf/pcfread.c (pcf_get_encodings): Trace `defaultChar'.Werner Lemberg2018-07-171-2/+4
|
* [bdf, pcf] Removed deprecated FT_FACE_FLAG_FAST_GLYPHS flag.Parth Wazurkar2018-06-061-2/+1
| | | | | | * src/bdf/bdfdrivr.c (BDF_Face_Init): Removed deprecated FT_FACE_FLAG_FAST_GLYPHS flag. * src/pcf/pcfread.c (pcf_load_font): Removed deprecated FT_FACE_FLAG_FAST_GLYPHS flag.
* [GSoC] src/*.*: Convert block comments to `light' style.Werner Lemberg2018-06-034-66/+66
| | | | | | | | | | | 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.
* [pcf]Documentation Typo.Parth Wazurkar2018-05-111-1/+1
|
* Remove FT_CONFIG_OPTION_PIC and related code.Werner Lemberg2018-05-021-4/+1
| | | | | | | | | | | | | | | | | */* [FT_CONFIG_OPTION_PIC]: Remove all code guarded by this preprocessor symbol. */*: Replace `XXX_GET' macros (which could be either a function in PIC mode or an array in non-PIC mode) with `xxx' arrays. * include/freetype/internal/ftpic.h, src/autofit/afpic.c, src/autofit/afpic.h, src/base/basepic.c, src/base/basepic.h, src/base/ftpic.c, src/cff/cffpic.c, src/cff/cffpic.h, src/pshinter/pshpic.c, src/pshinter/pshpic.h, src/psnames/pspic.c, src/psnames/pspic.h, src/raster/rastpic.c, src/raster/rastpic.h, src/sfnt/sfntpic.c, src/sfnt/sfntpic.h, src/smooth/ftspic.c, src/smooth/ftspic.h, src/truetype/ttpic.c, src/truetype/ttpic.h: Removed.
* Update copyright year.Werner Lemberg2018-01-021-1/+1
|
* New `ftdriver.h' file, covering all driver modules.Werner Lemberg2017-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | This reduces redundancy and increases synergy; it also reduces the number of header files. * include/freetype/config/ftheader.h (FT_DRIVER_H): New macro. (FT_AUTOHINTER_H, FT_CFF_DRIVER_H, FT_TRUETYPE_DRIVER_H, FT_PCF_DRIVER_H, FT_TYPE1_DRIVER_H): Make them aliases to FT_DRIVER_H. * include/freetype/ftautoh.h, include/freetype/ftcffdrv.h, include/freetype/ftpcfdrv.h, include/freetype/ftt1drv.h, include/freetype/ftttdrv.h: Replaced with... * include/freetype/ftdriver.h: ...this new file. (FT_CFF_HINTING_ADOBE, FT_T1_HINTING_ADOBE): Renamed to... (FT_HINTING_ADOBE): ... this new macro. (FT_CFF_HINTING_FREETYPE, FT_T1_HINTING_FREETYPE): Renamed to... (FT_HINTING_FREETYPE): ... this new macro. * src/*/*: Updated accordingly.
* Improve tracing messages by using singular and plural forms.Werner Lemberg2017-12-051-2/+4
| | | | * src/*/*.c: Implement it.
* Branding fixes.Alexei Podtelezhnikov2017-09-071-2/+2
|
* * src/winfonts/winfnt.c (FNT_Face_Init): Don't set active encoding.Werner Lemberg2017-06-141-6/+0
| | | | FreeType only sets a default active encoding for Unicode.
* [pcf] 32bit integer overflow run-time errors (#46149).Werner Lemberg2017-05-291-9/+69
| | | | | | | | * src/pcf/pcfread.c (pcf_get_accel): Add sanity checks for `fontAscent' and `fontDescent'. (pcf_load_font): Add sanity checks for global height. Add sanity checks for AVERAGE_WIDTH, POINT_SIZE, PIXEL_SIZE, RESOLUTION_X, and RESOLUTION_Y properties.
* [bdf, pcf] Support ISO646.1991-IRV character encoding (aka ASCII).Werner Lemberg2017-05-241-1/+5
| | | | | | | | | Problem reported by Marek Kašík <mkasik@redhat.com>, cf. https://bugzilla.redhat.com/show_bug.cgi?id=1451795 * src/bdf/bdfdrivr.c (BDF_Face_Init), src/pcf/pcfdrivr.c (PCF_Face_Init): Implement it.
* [pcf] Fix compiler warnings.Werner Lemberg2017-03-271-0/+6
| | | | | | | Reported by Alexander Hedges <ahedges@student.ethz.ch>. * src/pcf/pcfdrivr.c (pcf_property_set, pcf_property_get): Tag `property_name' with `FT_UNUSED' where necessary.