Commit Graph

6426 Commits

Author SHA1 Message Date
Parth Wazurkar 9da5d09e26 [gf] Create gf services.
* src/gf/gfdrivr.c: Define gf services descriptor
table and `gf_driver_requestor' function.
2018-07-30 23:47:51 +05:30
Parth Wazurkar d9d157e556 [gf] Fixes. 2018-07-30 23:47:51 +05:30
Parth Wazurkar 69124b5979 [gf] Robustify.
* src/gf/gflib.c (gf_load_font): Add check
for GF_ID and GF_PRE commands to improve
test for `gf' files.
2018-07-30 23:47:51 +05:30
Parth Wazurkar d9cdc15d80 [gf] Minor Fixes. 2018-07-30 23:47:51 +05:30
Parth Wazurkar b619592a8f [gf] Add support for parsing `xxx' and `yyy' commands.
* Now gf driver supports all the `gf' font files.
* Currently `xxx'and `yyy' commands if found after the
postamble are skipped over.
* Mechanism for extracting information from these commands
is to be added.
2018-07-30 23:47:51 +05:30
Parth Wazurkar 256c625c6e [gf] Modify Glyph slot metric values. 2018-07-30 23:47:51 +05:30
Parth Wazurkar 10775a138e [gf] Fix memory leak errors.
* src/gf/gfdrivr.c: Improve GF_Face_Done and
GF_Face_Init functions to fix memory leak errors.
2018-07-30 23:47:51 +05:30
Parth Wazurkar 2c3b6390a5 [gf] Fix gf_free_font function errors.
* src/gf/gflib.c (gf_free_font): Fix errors in gf_free_font
function.

* src/gf/gfdrir.c (GF_Glyph_Load): Improve slot metric
values.
2018-07-30 23:47:51 +05:30
Parth Wazurkar f7f18d792e [gf] Minor Fixes. 2018-07-30 23:47:51 +05:30
Parth Wazurkar 98b83f08aa [gf] Improve error handling and minor fixes.
* src/gf/gflib.c : Use `Unknown_File_Format' instead
of `Invalid_File_Format'.
2018-07-30 23:47:51 +05:30
Parth Wazurkar 9efa36c8b0 [gf] Use Unicode charmap and modify slot metric values.
* src/gf/gfdrivr.c(GF_Face_Init): Use Unicode charmap and
modify FT_Bitmap_Size values.

* src/gf/gfdrivr.c(GF_Glyph_Load): Modify FT_GlyphSlot and
FT_Bitmap values.
2018-07-30 23:47:51 +05:30
Parth Wazurkar d0c08730c7 [gf] Add tracing and error handling.
* src/gf/gfdrivr.c, src/gf/gflib.c: Add FT_TRACEX and
FT_ERROR messages for debugging.

* src/gf/module.mk: Fixes to make output of first `make'
call prettier.
2018-07-30 23:47:51 +05:30
Parth Wazurkar f2c92f1173 [gf] Add gf components to FT trace definitions.
* include/freetype/internal/fttrace.h: Add gf driver
components, gfdriver and gflib to FT trace definitions.
2018-07-30 23:47:51 +05:30
Parth Wazurkar 34d588002c [gf] Resolve compiler flag errors.
* src/gf/gflib.c: Remove all the unused variables,
add error checking for all the stream functions which
were raising compiler flag warnings.

* src/gf/gfdrivr.c: Remove unused variables.
2018-07-30 23:47:51 +05:30
Parth Wazurkar 2439cfb7e9 [gf] Minor fixes. 2018-07-30 23:47:51 +05:30
Parth Wazurkar f7f6a981c4 [gf] FT stream support for gf driver.
* src/gf/gflib.c : Convert all the file functions to
FT stream functions.
2018-07-30 23:47:51 +05:30
Parth Wazurkar c80039d715 [gf] Define FT driver variables with gftype values.
* src/gf/gfdrivr.c : Define the FT driver variables
in all the functions with gftype values from the font file.
2018-07-30 23:47:51 +05:30
Parth Wazurkar 522853e565 [gf] Removed VFlib specific code and refactored to FT. 2018-07-30 23:47:50 +05:30
Parth Wazurkar ea69f5127c [gf] Convert block comments to `light' style in gf files. 2018-07-30 23:47:50 +05:30
Parth Wazurkar a11d8d05d5 [gf] * src/gf/gfdrivr.c: Added GF_Face_Init, GF_Face_Done and GF_Glyph_Load functions. 2018-07-30 23:47:50 +05:30
Parth Wazurkar 8ce66d72c8 [gf] Added GF_Size_Request and GF_Size_Select functions. 2018-07-30 23:47:50 +05:30
Parth Wazurkar 2cbff6f458 [gf] Minor changes to Makefiles to accomodate GF Driver.
* modules.cfg: Added gf font driver module.
* src/gf/module.mk: Minor changes.
2018-07-30 23:47:50 +05:30
Parth Wazurkar 9e030fff8f [gf] * src/gf/gf.c: Added source files for single build 2018-07-30 23:47:50 +05:30
Parth Wazurkar 161035d66b [gf] Removed indentation errors. 2018-07-30 23:47:50 +05:30
Parth Wazurkar fdcaaa84fa [gf] Added Makefiles.
-Initialised module.mk and rules.mk.
2018-07-30 23:47:50 +05:30
Parth Wazurkar 10c4f0bd4e [gf] Initialised internal utility functions specific to GF format.
* src/gf/gf.h Added some required definitions.
* src/gf/gflib.c Added gf_font_load, gf_read_glyph, gf_font_done functions.
2018-07-30 23:47:50 +05:30
Parth Wazurkar 9a53ba425e [gf] *src/gf/gfdrivr.h Defined GF_FaceRec and other format specific structures.
- Defined GF_FaceRec.
- Defined GF_BitmapRec and GF_Glyph structures to properly distinguish format specific values.
2018-07-30 23:47:50 +05:30
Parth Wazurkar 3e006d31fd [gf] *src/gf/gfdrivr.c defined gf_cmap_class functions
- Defined structure GF_CMapRec for gf font format.
- Implemented gf_cmap_init, gf_cmap_done, gf_cmap_char_index, gf_cmap_char_next.
2018-07-30 23:47:50 +05:30
Parth Wazurkar b1aef3269f [gf] Added gf.c 2018-07-30 23:47:50 +05:30
Parth Wazurkar edfccbd6e3 [gf] Initialised gf driver files
gf driver files are initialised. Macros required for gf font files are determined in gf.h file.
2018-07-30 23:47:50 +05:30
Parth Wazurkar 13338ef516 *src added gf driver repository
This repository contains the driver for gf font format.
2018-07-30 23:47:50 +05:30
Werner Lemberg 578bcf103a [cff] Fix typo.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9409

* src/cff/cffdrivr.c (cff_get_cid_from_glyph_index): Fix boundary
check.
2018-07-30 11:28:04 +02:00
Werner Lemberg 00968d8fd6 * src/pcf/pcfread.c (pcf_get_encodings): Another thinko.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9608
2018-07-29 10:22:59 +02:00
Alexei Podtelezhnikov 0f8aebfd51 * builds/unix/configure.raw: Minor. 2018-07-28 23:21:28 -04:00
Alexei Podtelezhnikov 2c3e895c74 [smooth] Fix Harmony memory management.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9501

* src/smooth/ftgrays.c (ft_smooth_render_generic): Restore buffer
after each rendering in case of failure.
2018-07-28 22:00:59 -04:00
Werner Lemberg 6e44d78cc1 [type1] Avoid segfaults with `FT_Get_PS_Font_Value'.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9610

* src/type1/t1driver.c (t1_ps_get_font_value): Protect against NULL.
2018-07-28 22:23:16 +02:00
Werner Lemberg c9edca8ee9 [truetype] Make `TT_Set_MM_Blend' idempotent (#54388).
* src/truetype/ttgxvar.c (tt_set_mm_blend): Correctly set
`face->doblend' if the current call to the function yields the same
blend coordinates as the previous call.
2018-07-27 10:44:01 +02:00
Werner Lemberg d277bfc985 [psaux, type1]: More tracing improvements.
* src/psaux/psintrp.c (cf2_interpT2CharString): Trace skipped
outline commands.

* src/psaux/t1decode.c (t1_decoder_parse_charstring): Fix
missing case.
(t1_decoder_parse_metrics): Make tracing output more compact.

* src/type1/t1gload.c (T1_Compute_Max_Advance): Be less verbose.
(T1_Get_Advances): Add tracing.
2018-07-27 09:15:43 +02:00
Werner Lemberg 6e6acdcb0e Document FT_Module_Class's `module_interface' field. 2018-07-26 07:22:43 +02:00
Werner Lemberg 8ed5346877 [psaux, type1] Trace PostScript dictionaries and other things.
The tracing of /Encoding, /Subrs, and /Charstrings is rudimentary
right now.

* src/psaux/psobjs.c (ps_parser_load_field,
ps_parser_load_field_table): Add tracing calls.

* src/psaux/t1decode.c (t1_decoder_parse_charstrings): Make tracing
output more compact.

* src/type1/t1gload.c (T1_Compute_Max_Advance, T1_Get_Advances): Add
tracing messages.

* src/type1/t1load.c (parse_blend_axis_types,
parse_blend_design_positions, parse_blend_design_map,
parse_weight_vector, t1_load_keyword, t1_parse_font_matrix,
parse_encoding, parse_subrs, parse_charstrings, T1_Open_Face): Add
tracing calls.

* src/type1/t1objs.c (T1_Face_Init): Add tracing call.

* src/sfnt/sfobjs.c (sfnt_init_face): Make tracing message more
verbose.
2018-07-25 22:07:22 +02:00
Werner Lemberg 580c94d8f7 Fix minor ASAN run-time warnings.
* src/base/ftutil.c (ft_mem_alloc, ft_mem_realloc): Only call
`FT_MEM_ZERO' if we actually have a buffer.
(ft_mem_dup): Only call `ft_memcpy' if we actually have a buffer.
2018-07-25 07:03:07 +02:00
Alexei Podtelezhnikov 4b97ab98a8 [build] Fortify dllexport/dllimport attributes (#53969,#54330).
We no longer use predefined _DLL, which can be defined for static
builds too with /MD. We use DLL_EXPORT and DLL_IMPORT instead,
following libtool convention.

* CMakeLists.txt [WIN32], builds/windows/vc2010/freetype.vcxproj:
Define DLL_EXPORT manually.

* include/freetype/config/ftconfig.h, builds/unix/ftconfig.in,
builds/vms/ftconfig.h, builds/windows/vc2010/index.html,
src/base/ftver.rc: /_DLL/d, s/FT2_DLLIMPORT/DLL_IMPORT/.
2018-07-24 23:01:34 -04:00
Werner Lemberg d8ea52dee5 [type1] Check relationship between number of axes and designs.
For Multiple Masters fonts We don't support intermediate designs;
this implies that

  number_of_designs == 2 ^^ number_of_axes

Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9557

* src/type1/t1load.c (T1_Open_Face): Ensure above constraint.
(T1_Get_MM_Var): Remove now redundant test.
2018-07-24 23:03:06 +02:00
Hin-Tak Leung 71e29fe1c9 [truetype] Match ttdebug's naming of instruction mnemonics.
* src/truetype/ttinterp.c: The form used in ttdebug,
"MDRP[G,B,W,?]", etc., is slightly more readable than
"MDRP[00,01,02,03]".
2018-07-24 10:04:23 +02:00
Werner Lemberg ff1c28f6c0 * src/pcf/pcfread.c (pcf_get_encodings): Thinko.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9561
2018-07-24 09:59:23 +02:00
Werner Lemberg b98133a4e9 * src/pcf/pcfread.c (pcf_get_encodings): Check index of defaultChar.
Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9527
2018-07-22 13:06:20 +02:00
Werner Lemberg 9be385c94d * src/pcf/pcfread.c (pcf_load_font): Fix number of glyphs.
This is an oversight of the module change 2018-07-21.

Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9524
2018-07-22 12:49:25 +02:00
Werner Lemberg a5acdce100 [cid] Sanitize `BlueShift' and `BlueFuzz'.
This code is taken from the type1 module.

Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9510

* src/cid/cidload.c (parse_fd_array): Set some private dict default
values.
(cid_face_open): Do the sanitizing.
Fix some tracing messages.
2018-07-22 12:11:52 +02:00
Werner Lemberg 5434faadf4 Fix links.
Reported by Ankit and Nikhil.
2018-07-22 07:34:53 +02:00
Werner Lemberg 9395558533 Minor comment improvement. 2018-07-21 23:46:19 +02:00