src/cff


Log

Author Commit Date CI Message
John Tytgat 18fffa45 2011-02-19T07:11:17 [cff] Fix subset prefix removal. * src/cff/cffobjs.c (remove_subset_prefix): Update length after subset prefix removal.
Werner Lemberg 75df7060 2011-02-01T07:36:27 [cff] Ignore unknown operators in charstrings. Patch suggested by Miles.Lau <sunliang_liu@foxitsoftware.com>. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Emit tracing message for unknown operators and continue instead of exiting with a syntax error.
Werner Lemberg f3ce2370 2011-01-03T07:11:54 */rules.mk: Handle `*pic.c' files.
Werner Lemberg 91843dfc 2010-12-31T19:30:53 * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 64. Problem reported by Tom Bishop <wenlin@wenlin.com>.
Werner Lemberg 396b11b8 2010-12-09T23:16:18 [cff] Allow `hlineto' and `vlineto' without arguments. We simply ignore such instructions. This is invalid, but it doesn't harm; and indeed, there exist such subsetted fonts in PDFs. Reported by Albert Astals Cid <aacid@kde.org>. * src/cff/cffgload.c (cff_decoder_parse_charstrings) [cff_op_hlineto]: Ignore instruction if there aren't any arguments on the stack.
Werner Lemberg d38ba0c9 2010-09-19T20:51:19 Minor fixes. * src/cff/cffload.c (cff_charset_compute_cids): `charset->sids[i]' is `FT_UShort'. (cff_index_access_element): Don't use additions in comparison. * src/sfnt/ttpost.c (load_format_20): Make `post_limit' of type `FT_Long'. Don't use additions in comparison. Improve tracing messages. (load_format_25, load_post_names): Make `post_limit' of type `FT_Long'.
suzuki toshiya 73aa20ca 2010-09-20T01:30:38 [cff] Truncate the element length at the end of the stream. See Savannah bug #30975. * src/cff/cffload.c (cff_index_access_element): `off2', the offset to the next element is truncated at the end of the stream to prevent invalid I/O. As `off1', the offset to the requested element has been checked by FT_STREAM_SEEK(), `off2' should be checked similarly.
suzuki toshiya d2d843a0 2010-09-20T01:28:17 [cff] Ignore CID > 0xFFFFU. See Savannah bug #30975. * src/cff/cffload.c (cff_charset_compute_cids): Ignore CID if greater than 0xFFFFU. CFF font spec does not mention about maximum CID in the font, but PostScript and PDF spec define that maximum CID is 0xFFFFU.
suzuki toshiya a0f43f20 2010-09-20T01:26:56 [cff] Make trace message in cff_charset_load() verbose. See Savannah bug #30975. * src/cff/cffload.c (cff_charset_load): Report the original `nleft' and truncated `nleft'.
suzuki toshiya b3e1954d 2010-09-20T01:22:34 [cff] Correct `max_cid' from CID array length to max CID. See Savannah bug #30975. * src/cff/cffload.c (cff_charset_compute_cids): Don't increment max_cid after detecting max CID. The array CFF_Charset->cids is allocated by max_cid + 1. (cff_charset_cid_to_gindex): Permit CID is less than or equal to CFF_Charset->max_cid. * src/cff/cffobjs.c (cff_face_init): FT_Face->num_glyphs is calculated as CFF_Charset->max_cid + 1.
Werner Lemberg 5220ef58 2010-09-13T07:32:22 Fix minor issues reported by <muktha.narayan@wipro.com>. * src/autofit/aflatin.c (af_latin_compute_stem_width): Remove redundant conditional check. * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Ditto. * src/cff/cffload.c (cff_encoding_load): Remove conditional check which always evaluates to `true'. * src/pshinter/pshalgo.c (ps_glyph_interpolate_strong_points): Ditto. * src/truetype/ttinterp.c (Ins_IUP): Ditto. * src/cid/cidgload.c (cid_slot_load_glyph): Don't check for NULL if value is already dereferenced. * src/winfonts/winfnt.c (FNT_Load_Glyph): Fix check of `face'.
Werner Lemberg 0e95b3d1 2010-08-29T10:46:26 [cff] Allow SIDs >= 65000. * src/cff/cffload.c (cff_charset_load): Fix change from 2009-03-20: The threshold for SIDs is not applicable here. I misinterpreted the `SID values 65000 and above are available for implementation use' sentence in the CFF specification. Problem reported by Ivan Ninčić <inincic@pdftron.com>.
Werner Lemberg 223cb1b5 2010-08-06T06:55:09 [cff] Add comment to clarify current implementation of `pop' operator.
suzuki toshiya d9b3e394 2010-08-05T17:10:32 [cff] Don't use any values in decoder after parsing error. * src/cff/cffgload.c (cff_slot_load): Skip the evaluations of the values in decoder, if cff_decoder_parse_charstrings() returns any error.
Suzuki, Toshiya (鈴木俊哉) 11d65e8a 2010-08-04T14:43:29 [cff] Improve stack overflow test. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Check stack after execution of operations too.
Werner Lemberg 2de6b8a3 2010-07-17T13:39:50 [cff] Final try to fix `hintmask' and `cntrmask' limit check. Problem reported by Tobias Wolf <towolf@gmail.com>. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_hintmask>: Sigh. I'm apparently too silly to fix this correctly in less than three tries.
suzuki toshiya d594202e 2010-07-11T00:31:17 Fix another case reported in Savannah bug #30373. Permit a face for Type1, Type42 and CFF without charmap, patch by Tor Andersson. * src/type1/t1objs.c (T1_Face_Init): Reset the error if it is FT_Err_No_Unicode_Glyph_Name. * src/type42/t42objs.c (T42_Face_Init): Ditto. * src/cff/cffobjs.c (cff_face_init): Ditto.
suzuki toshiya 840f208d 2010-07-09T12:26:33 Use defined macros to set {platform,encoding}_id. * src/bdf/bdfdrivr.c: Include ttnameid.h and use macros to set charmap.{platfom,encoding}_id. * src/pcf/pcfdrivr.c: Ditto. * src/winfonts/winfnt.c: Ditto. * src/type1/t1objs.c: Ditto. * src/type42/t42objs.c: Ditto. * src/cff/cffobjs.c: Ditto. * src/pfr/pfrobjs.c: Ditto.
suzuki toshiya dfba8cfe 2010-07-09T12:25:36 Apple Unicode is not deprecated now.
suzuki toshiya b8ca6de3 2010-07-09T11:36:00 Fix Savannah bug #30373. Too serious check of errors by `FT_CMap_New' since 2010-07-04 is fixed. Reported by Tor Andersson. * include/freetype/fterrdef.h (PSnames_Err_No_Unicode_Glyph_Name): New error code to indicate the Unicode charmap synthesis failed because no Unicode glyph name is found. * src/psnames/psmodule.c (ps_unicodes_init): Return PSnames_Err_No_Unicode_Glyph_Name when no Unicode glyph name is found in the font. * src/cff/cffcmap.c (cff_cmap_unicode_init): Return CFF_Err_No_Unicode_Glyph_Name when no SID is available. * src/type1/t1objs.c (T1_Face_Init): Proceed if `FT_CMap_New' is failed by the lack of Unicode glyph name. * src/type42/t42objs.c (T42_Face_Init): Ditto. * src/cff/cffobjs.c (cff_face_init): Ditto.
Werner Lemberg c73e1605 2010-07-06T10:44:56 Pacify compiler. * src/cff/cffload.c (cff_index_get_pointers): Initialize `new_bytes'.
Werner Lemberg 2dc76a46 2010-07-05T06:40:02 [cff] Next try to fix `hintmask' and `cntrmask' limit check. Problem reported by malc <av1474@comtv.ru>. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_hintmask>: It is possible that there is just a single byte after the `hintmask' or `cntrmask', e.g., a `return' instruction.
suzuki toshiya 0ae32718 2010-07-04T20:14:18 Restrict the number of the charmaps in a rogue-compatible mode. 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.
suzuki toshiya a874c7ec 2010-07-04T12:08:41 Check error value by `FT_CMap_New'. * src/cff/cffobjs.c (cff_face_init): Check error value by `FT_CMap_New'. * src/pfr/pfrobjs.c (pfr_face_init): Ditto. * src/type1/t1jobjs.c (T1_Face_Init): Ditto. * src/type42/t42jobjs.c (T42_Face_Init): Ditto.
Werner Lemberg ae425e51 2010-06-29T12:31:08 Fix minor tracing issues. * src/cff/cffgload.c, src/truetype/ttgload.c: Adjust tracing levels.
Werner Lemberg 18b552f6 2010-06-27T15:41:02 [cff] Really fix `hintmask' and `cntrmask' limit check. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_hintmask>: Fix thinko and handle tracing also.
Werner Lemberg 4f7851e3 2010-06-27T13:03:54 [cff] Fix memory leak. * src/cff/cffgload.c (cff_operator_seac): Free charstrings even in case of errors.
Werner Lemberg e9f0cdb6 2010-06-27T12:34:19 [cff] Protect against invalid `hintmask' and `cntrmask' operators. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_hintmask>: Ensure that we don't exceed `limit' while parsing the bit masks of the `hintmask' and `cntrmask' operators.
Werner Lemberg e23ba91a 2010-06-25T21:55:14 Fix Savannah bug #30254. * src/cff/cffload.c (cff_index_get_pointers): Do sanity check for first offset also.
Werner Lemberg f765e440 2010-06-24T10:34:29 */*: Use module specific error names where appropriate.
Werner Lemberg 3624110c 2010-06-11T23:00:22 [cff]: Improve debugging output. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_hintmask>: Implement it.
Werner Lemberg 7d3d2cc4 2010-06-09T09:14:09 Fix Savannah bug #30082. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_callothersubr>: Protect against stack underflow.
Werner Lemberg a4124bf0 2010-06-08T09:21:39 Fix Savannah bug #30053. * src/cff/cffparse (cff_parse_real): Handle border case where `fraction_length' has value 10.
Werner Lemberg 370aea80 2010-06-08T08:37:11 Formatting.
Bram Tassyns d7cc8f49 2010-05-21T10:14:58 Fix Savannah bug #27987. * src/cff/cffobjs.c (remove_subset_prefix): New function. (cff_face_init): Use it to adjust `cffface->family_name'.
Hongbo Ni 236fc8e1 2010-05-18T11:00:39 Apply patch #7196. * src/cff/cffgload.c (cff_slot_load): Prevent crash if CFF subfont index is out of range.
suzuki toshiya cef43bde 2010-03-14T23:12:13 Fix `multi build' for Tytgat's CFF driver improvement. * src/base/cffload.h (cff_index_get_name): Added.
Werner Lemberg 763300a9 2010-03-09T17:01:21 Remove unused variable. Reported by Graham. * src/cff/cffparse.c (cff_parse_real): Remove `rest'.
Werner Lemberg 03b3da8b 2010-03-02T13:00:55 Improve CFF string (especially glyphname) lookup performance. We do this by avoiding memory allocation and file I/O. This is Savannah patch #7104. * src/cff/cfftypes.h: Include PS cmaps service and FT_INTERNAL_POSTSCRIPT_HINTS_H. (CFF_SubFontRec): Remove `num_local_subrs'. (CFF_FontRec): Add `num_strings', `strings', and `string_pool' fields. Remove `string_index' and `num_global_subrs' fields. Use real types instead of `void' for `pshinter' and `psnames' fields. * src/cff/cffload.c: Don't include PS cmaps service. (cff_index_get_pointers): Add `pool' parameter which allows to insert an extra NUL character for each String INDEX entry. (cff_index_get_name): Make it a local function. (cff_index_get_string): New function. (cff_subfont_load): Updated. (cff_font_load): Initialize `num_strings', `strings', and `string_pool' fields in the `CFF_FontRec' structure. (cff_index_get_sid_string): Use `cff_index_get_string' instead of `cff_index_get_name'. (cff_font_done): Updated. * src/cff/cffload.h: Don't include PS cmaps service. (cff_index_get_string): Added. (cff_index_get_sid_string): Updated. * src/cff/cffobjs.c: Don't include PS cmaps service and FT_INTERNAL_POSTSCRIPT_HINTS_H. (cff_size_get_globals_funcs, cff_slot_init): Updated. (cff_face_init): Follow `cff_index_get_name', `cff_index_get_string', and `cff_index_get_sid_string' changes. * src/cff/cffcmap.c (cff_sid_free_glyph_name): Removed. (cff_sid_to_glyph_name): Use `cff_index_get_cid_string'. (cff_cmap_unicode_init): Updated. * src/cff/cffdrivr.c: Don't include PS cmap service. (cff_get_glyph_name): Avoid unnecessary lookup for POSTSCRIPT_CMAPS service. (cff_get_glyph_name, cff_ps_get_font_info, cff_get_ros): Follow API `cff_index_get_sid_string' change. (cff_get_name_index): Use `cff_index_get_string' instead of `cff_index_get_name'. * src/cff/cffgload.c: Don't include FT_INTERNAL_POSTSCRIPT_HINTS_H. (cff_decoder_init, cff_decoder_prepare): Updated.
Ken Sharp 63e7aac3 2010-02-10T07:13:27 Really fix Savannah bug #28678 (part 2). Since we consider `sbw' for the horizontal direction only, we still have to synthesize vertical metrics if the user wants to use the vertical writing direction. * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph): Synthesize vertical metrics (only) if FT_LOAD_VERTICAL_LAYOUT is set.
Ken Sharp 980b76ea 2010-02-10T07:02:43 Really fix Savannah bug #28678 (part 1). After long discussion, we now consider the character width vector (wx,wy) returned by the `sbw' Type 1 operator as being part of *one* direction only. For example, if you are using the horizontal writing direction, you get the horizontal and vertical components of the advance width for this direction. Note that OpenType and CFF fonts don't have such a vertical component; instead, the GPOS table can be used to generate two-dimensional advance widths (but this isn't handled by FreeType). * include/freetype/ftincrem.h (FT_Incremental_MetricsRec): Add `advance_v' field to hold the vertical component of the advance value. * src/truetype/ttgload.c (tt_get_metrics), src/cff/cffgload.c (cff_slot_load), src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String), src/cid/cidgload.c (cid_load_glyph): Use it.
suzuki toshiya d9145241 2010-02-05T02:58:24 Prevent NULL pointer dereference passed to FT_Module_Requester.
Ken Sharp f19e46f3 2010-01-27T10:04:50 Fix Savannah bug #28678. * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c (cid_load_glyph): Handle vertical metrics correctly. * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Handle vertical metrics correctly. (T1_Load_Glyph): Don't synthesize vertical metrics.
Werner Lemberg 2ad91580 2010-01-09T08:22:38 Whitespace.
Werner Lemberg 7bdc1d59 2009-12-18T07:13:22 Fix Savannah bug #28320. There exist corrupt, subsetted fonts (embedded in PDF files) which contain a private dict that ends with an unterminated floating point number (no operator following). We now ignore this error (as acrobat does). * src/cff/cffparse.c (cff_parser_run): Don't emit a syntax error for unterminated floating point numbers.
Werner Lemberg 012552f1 2009-11-04T10:06:04 Fix Savannah bug #27921. * src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c (cid_face_init), src/type1/t1afm.c (T1_Read_Metrics), src/type1/t1objs.c (T1_Face_Init): Don't use unsigned constant values for rounding if the argument can be negative.
Bram Tassyns 8821cc5d 2009-11-04T07:21:15 Add basic support for Type1 charstrings in CFF. * src/cff/cffgload.c (CFF_Operator, cff_argument_counts): Handle `seac', `sbw', and `setcurrentpoint' opcodes. (cff_compute_bias): Add parameter to indicate the charstring type. Update all callers. (cff_operator_seac): Add parameter for side bearing. (cff_decoder_parse_charstrings): Updated for more Type1 support.
Werner Lemberg 2d15120c 2009-10-19T21:09:13 Fix handling of `get' and `put' CFF instructions. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_get, cff_op_put>: Appendix B of Adobe Technote #5177 limits the number of elements for the `get' and `put' operators to 32. * src/cff/cffgload.h (CFF_MAX_TRANS_ELEMENTS): Define. (CFF_Decoder): Use it for `buildchar' and remove `len_buildchar'.
Werner Lemberg d90567b1 2009-10-18T10:47:11 Fix handling of `dup' CFF instruction. Problem and solution reported by Ning Dong <flintning@163.com>. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_dup>: Increase `args' by 2, not 1.
suzuki toshiya 0729bc9f 2009-09-10T16:09:55 [Win64] Improve the computation of random seed from stack address.
Bram Tassyns 4694ea2b 2009-09-02T13:06:33 Improve vertical metrics calculation (Savannah bug #27364). The calculation of `vertBearingX' is not defined in the OTF font spec so FreeType does a `best effort' attempt. However, this value is defined in the PDF and PostScript specs, and that algorithm is better than the one FreeType currently uses: FreeType: Use the middle of the bounding box as the X coordinate of the vertical origin. Adobe PDF spec: Use the middle of the horizontal advance vector as the X coordinate of the vertical origin. FreeType's algorithm goes wrong if you have a really small glyph (like the full-width, circle-like dot at the end of the sentence, as used in CJK scripts) with large bearings. With the FreeType algorithm this dot gets centered on the baseline; with the PDF algorithm it gets the correct location (in the top right). Note that this is a serious issue, it's like printing the dot at the end of a Roman sentence at the center of the textline instead of on the baseline like it should. So i believe the PDF spec's algorithm should be used in FreeType as well. The `vertBearingY' value for such small glyphs is also very strange if no `vmtx' information is present, since the height of the bbox is not representable for the height of the glyph visually (the whitespace up to the baseline is part of the glyph). The fix also includes some code for a better estimate of `vertBearingY'. * src/base/ftobjs.c (ft_synthesize_vertical_metrics): `vertBearingX' is now calculated as described by the Adobe PDF Spec. Estimate for `vertBearingY' now works better for small glyphs completely above or below the baseline into account. * src/cff/cffgload.c (cff_slot_load): `vertBearingX' is now calculated as described by the Adobe PDF Spec. Vertical metrics information was always ignored when FT_CONFIG_OPTION_OLD_INTERNALS was not defined. * src/truetype/ttgload.c (compute_glyph_metrics): `vertBearingX' is now calculated as described by the Adobe PDF Spec.
Werner Lemberg d77cd8ce 2009-08-27T00:10:56 Fix rendering of horizontally compressed CFFs. Bug reported by Ivan Nincic <inincic@pdftron.com>. * src/cff/cffgload.c (cff_slot_load): Thinko: Check `xx' element of `font_matrix' also. * docs/CHANGES: Updated.
suzuki toshiya b16a9426 2009-08-01T00:32:25 cff: Type large constants > 0x7FFF as long for 16-bit systems.
suzuki toshiya 3f0f2e46 2009-08-01T00:32:09 XXX_cmap_encoding_char_next() return FT_UInt32 values.
suzuki toshiya c579dc43 2009-08-01T00:32:08 cff: Fix some data types mismatching with their sources.
suzuki toshiya e866cf3f 2009-08-01T00:32:06 Improve bitmap size or pixel variables for 16-bit systems.
suzuki toshiya 072e5523 2009-08-01T00:30:23 cff: Cast the long variables to 32-bit for LP64 systems.
suzuki toshiya 34c203cd 2009-08-01T00:30:16 cff: Fix for unused variable `rest'.
suzuki toshiya a813cf48 2009-08-01T00:30:15 cff: Fix some data types mismatching with their sources.
Bram Tassyns 3d3ba056 2009-07-05T14:54:59 Improve compatibility to Acroread. This fixes Savannah bug #26944. * src/cff/cffload.c (cff_charset_compute_cids): For multiple GID to single CID mappings, make the lowest value win.
Werner Lemberg 24370d67 2009-06-28T02:11:51 Uff, another thinko.
Werner Lemberg e7389a44 2009-06-28T01:25:55 [psaux, cff] Protect against nested `seac' calls. * include/freetype/internal/psaux.h (T1_Decoder), src/cff/cffgload.h (CFF_Decoder): Add `seac' boolean variable. * src/cff/cffgload.c (cff_operator_seac, cff_decoder_parse_charstrings), src/psaux/t1decode.c (t1operator_seac, t1_decoder_parse_charstrings): Use it.
Werner Lemberg 858abbed 2009-06-26T06:15:41 For warning messages, replace FT_ERROR with FT_TRACE0. FT_ERROR is now used only if a function produces a non-zero `error' value. Formatting, improving and harmonizing debug strings.
Werner Lemberg 1f540eff 2009-06-20T13:24:08 Remove unused variables. * include/freetype/internal/psaux.h (T1_BuilderRec), src/cff/cffgload.h (CFF_Builder): Remove `last'. Update all users.
Werner Lemberg 541ab5ad 2009-06-20T07:31:44 [cff] Revert last change. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Do it. Next time, don't confuse Type 2 charstring opcodes with TOP DICT values...
Werner Lemberg f1631f2d 2009-06-19T23:50:37 [cff] Fix handling of reserved byte 0xFF. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Abort if byte 0xFF is encountered.
Oran Agra cb3b6141 2009-04-05T18:12:03 Position Independent Code (PIC) support in cff driver. * include/freetype/internal/services/svcid.h add macros to init instances of FT_Service_CIDRec. * include/freetype/internal/services/svpsinfo.h add macros to init instances of FT_Service_PsInfoRec. * src/cff/cffcmap.h declare cff_cmap_encoding_class_rec and cff_cmap_unicode_class_rec using macros from ftobjs.h, when FT_CONFIG_OPTION_PIC is defined create and destroy functions will be declared. * src/cff/cffcmap.c when FT_CONFIG_OPTION_PIC is defined the following structs: cff_cmap_encoding_class_rec and cff_cmap_unicode_class_rec will have functions to init or create and destroy them instead of being allocated in the global scope. * src/cff/cffdrivr.h declare cff_driver_class using macros from ftdriver.h, when FT_CONFIG_OPTION_PIC is defined create and destroy functions will be declared. * src/cff/cffdrivr.c when FT_CONFIG_OPTION_PIC is defined the following structs: cff_service_glyph_dict, cff_service_ps_info, cff_service_ps_name cff_service_get_cmap_info, cff_service_cid_info, cff_driver_class, and cff_services array will have functions to init or create and destroy them instead of being allocated in the global scope. And macros will be used from cffpic.h in order to access them from the pic_container. Use macros from cffpic.h in order to access the structs allocated in cffcmap.c * src/cff/cffobjs.c Use macros from cffpic.h in order to access the structs allocated in cffcmap.c * src/cff/parser.c when FT_CONFIG_OPTION_PIC is defined implement functions to create and destroy cff_field_handlers array instead of being allocated in the global scope. And macros will be used from cffpic.h in order to access it from the pic_container. New Files: * src/cff/cffpic.h declare struct to hold PIC globals for cff driver and macros to access them. * src/cff/cffpic.c implement functions to allocate, destroy and initialize PIC globals for cff driver. * src/cff/cff.c add new file to build: cffpic.c. * src/cff/jamfile add new files to FT2_MULTI build: cffpic.c.
Oran Agra 2589e5fd 2009-04-05T17:34:40 Preparing changes in cff parser later needed for PIC version. * src/cff/cffload.c, src/cff/cffload.h, src/cff/cffobjs.c, src/cff/cffparse.c, src/cff/cffparse.h: Add library pointer to 'CFF_ParserRec' set by `cff_parser_init'. Route library pointer from 'cff_face_init' to 'cff_subfont_load' for `cff_parser_init'. * src/cff/cffparse.c (CFF_Field_Handler): Move it to... * src/cff/cffparse.h: This file, to be used by other C files.
Werner Lemberg fbdf1279 2009-04-01T08:03:37 Ignore empty contours in CFF glyphs. Problem reported by Albert Astals Cid <aacid@kde.org>. * src/cff/cffgload.c (cff_builder_close_contour): Synchronize with t1_builder_close_contour.
Werner Lemberg 86e041b5 2009-03-21T08:51:44 Remove redundant header inclusions. This covers many Ghostscript Coverity issues. * src/*: Do it.
Werner Lemberg 0545ec1c 2009-03-20T06:49:10 Protect against invalid SID values in CFFs. Problem reported by Tavis Ormandy <taviso@google.com>. * src/cff/cffload.c (cff_charset_load): Reject SID values larger than 64999.
Werner Lemberg b66efefd 2009-03-12T08:07:49 Fix some FreeType Coverity issues as reported for Ghostscript. * src/base/ftobjs.c (FT_New_Face, FT_New_Memory_Face): Initialize `args.stream' (#3874, #3875). (open_face_PS_from_sfnt_stream): Improve error management (#3786). * src/base/ftmm.c (ft_face_get_mm_service): Fix check of `aservice' (#3870). * src/base/ftstroke.c (ft_stroke_border_get_counts): Remove dead code (#3790). * src/base/ftrfork.c (raccess_guess_apple_generic): Check error value of `FT_Stream_Skip' (#3784). * src/type1/t1gload.c (T1_Load_Glyph): Check `size' before accessing it (#3872) * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Check `face' before accessing it (#3871). * src/pcf/pcfread.c (pcf_get_metrics): Handle return value of `pcf_get_metric' (#3789, #3782). (pcf_get_properties): Use FT_STREAM_SKIP (#3783). * src/cache/ftcmanag.c (FTC_Manager_RegisterCache): Fix check of `acache' (#3797) * src/cff/cffdrivr.c (cff_ps_get_font_info): Fix check of `cff' (#3796). * src/cff/cffgload.c (cff_decoder_prepare): Check `size' (#3795). * src/cff/cffload.c (cff_index_get_pointers): Add comment (#3794). * src/bdf/bdflib.c (_bdf_add_property): Check `fp->value.atom' (#3793). (_bdf_parse_start): Add comment (#3792). * src/raster/ftraster.c (Finalize_Profile_Table): Check `ras.fProfile' (#3791). * src/sfnt/ttsbit.c (Load_SBit_Image): Use FT_STREAM_SKIP (#3785). * src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Properly ignore seek error (#3781).
Werner Lemberg 07e81817 2009-03-11T21:29:54 Extend CID service functions to handle CID-keyed CFFs as CID fonts. * include/freetype/ftcid.h (FT_Get_CID_Is_Internally_CID_keyed, FT_Get_CID_From_Glyph_Index): New functions. * include/freetype/internal/services/svcid.h (FT_CID_GetIsInternallyCIDKeyedFunc, FT_CID_GetCIDFromGlyphIndexFunc): New function typedefs. (CID Service): Use them. * src/base/ftcid.c: Include FT_CID_H. (FT_Get_CID_Is_Internally_CID_keyed, FT_Get_CID_From_Glyph_Index): New functions. * src/cff/cffdrivr.c (cff_get_is_cid, cff_get_cid_from_glyph_index): New functions. (cff_service_cid_info): Add them. * src/cff/cffload.c (cff_font_load): Don't free `font->charset.sids' -- it is needed for access as a CID-keyed font. It gets deleted later on. * src/cid/cidriver.c (cid_get_is_cid, cid_get_cid_from_glyph_index): New functions. (cid_service_cid_info): Add them. * docs/CHANGES: Updated.
Werner Lemberg 9318df0c 2009-03-11T10:20:51 Fix Savannah bug #25597. * src/cff/cffparse.c (cff_parse_real): Don't allow fraction_length to become larger than 9.
David Turner 01ca4da2 2009-03-03T13:28:59 Remove ABI-breaking field in public PS_InfoFontRec definition. Instead, we define a new internal PS_FontExtraRec structure to hold the additionnal field, then place it in various internal positions of the corresponding FT_Face derived objects.
Werner Lemberg 14de111f 2009-02-24T21:34:51 Fix Savannah bug #25669. * src/base/ftadvanc.h (FT_Get_Advances): Fix serious typo. * src/base/ftobjs.c (FT_Select_Metrics, FT_Request_Metrics): Fix scaling factor for non-scalable fonts. * src/cff/cffdrivr.c (cff_get_advances): Use correct advance width value to prevent incorrect scaling. * docs/CHANGES: Document it.
Suzuki, Toshiya (鈴木俊哉) 759c07d1 2009-01-09T11:11:53 load_flags of FT_Get_Advance(), FT_Get_Advances() and backends are declared as FT_Int32 to match the flags of FT_Load_Glyph()
Suzuki, Toshiya (鈴木俊哉) a7c00b79 2009-01-09T07:21:16 load_flags of FT_Get_Advance(), FT_Get_Advances() and backends are declared as FT_UInt32 for 16-bit platforms
Werner Lemberg 1ad384d8 2008-12-25T23:52:00 Set `face_index' field in FT_Face for all font formats. * cff/cffobjs.c (cff_face_init), winfonts/winfnt.c (FNT_Face_Init), sfnt/sfobjs.c (sfnt_init_face): Do it. * docs/CHANGES: Document it.
Werner Lemberg ce33a312 2008-12-21T10:29:30 FT_USE_MODULE declares things as: extern const FT_Module_Class (or similar for C++). However, the actual types of the variables being declared are often different, e.g., FT_Driver_ClassRec or FT_Renderer_Class. (Some are, indeed, FT_Module_Class.) This works with most C compilers (since those structs begin with an FT_Module_Class struct), but technically it's undefined behavior. To quote the ISO/IEC 9899:TC2 final committee draft, section 6.2.7 paragraph 2: All declarations that refer to the same object or function shall have compatible type; otherwise, the behavior is undefined. (And they are not compatible types.) Most C compilers don't reject (or even detect!) code which has this issue, but the GCC LTO development branch compiler does. (It outputs the types of the objects while generating .o files, along with a bunch of other information, then compares them when doing the final link-time code generation pass.) Patch from Savannah bug #25133. * src/base/ftinit.c (FT_USE_MODULE): Include variable type. * builds/amiga/include/freetype/config/ftmodule.h, include/freetype/config/ftmodule.h, */module.mk: Updated to declare pass correct types to FT_USE_MODULE.
Werner Lemberg c7597edb 2008-11-27T21:55:20 * src/cff/cffparse.c (cff_parse_real): Handle more than nine significant digits correctly. This fixes Savannah bug #24953.
Werner Lemberg 312043f4 2008-11-12T06:29:41 * src/cff/cffdrivr.c (cff_get_cmap_info): Initialize `format' field. This fixes Savannah bug #24819. Document `format' field of TT_CMapInfo.
Werner Lemberg 822604c8 2008-10-14T07:28:03 * src/cff/cffobjs.c (cff_face_init): Remove compiler warning. Suggested by Bram Tassyns in Savannah patch #6651.
Werner Lemberg b17fb11f 2008-10-02T10:17:32 * src/cff/cffgload.c (cff_slot_load): Map CID 0 to GID 0. This fixes Savannah bug #24430.
Werner Lemberg d03d856d 2008-10-01T22:39:05 * src/truetype/ttobjs.c (tt_face_done), src/cff/cffobjs.c (cff_face_done), src/pfr/pfrobjs.c (pfr_face_done), src/pcf/pcfdrivr.c (PCF_Face_Done), src/cid/cidobjs.c (cid_face_done), src/bdf/bdfdrivr. (BDF_Face_Done), src/sfnt/sfobjs.c (sfnt_face_done): Protect against face == 0. Reported by Graham Asher.
Werner Lemberg 6bc16e92 2008-10-01T21:16:44 s/synthetize/synthesize/
Werner Lemberg b4c810e2 2008-09-22T11:28:46 * src/cff/cffgload.c (CFF_Operator, cff_argument_counts, cff_decoder_parse_charstrings): Handle (invalid) `callothersubr' and `pop' instructions.
Suzuki, Toshiya (鈴木俊哉) 0c0db3eb 2008-09-18T04:36:56 * src/cff/cffobjs.c: replace 0x4F54544FL by TTAG_OTTO
Werner Lemberg 634df6e3 2008-09-16T07:25:31 * src/cff/cffgload.h, src/cff/cffgload.c (cff_decoder_set_width_only): Eliminate function call.
Werner Lemberg b211651a 2008-09-12T16:27:48 * autogen.sh, builds/unix/configure.raw, 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.
David Turner 28534d61 2008-09-01T21:35:21 * include/freetype/ftadvanc.h, src/base/ftadvanc.c, include/freetype/config/ftheader.h, include/freetype/freetype.h, src/base/Jamfile, src/base/rules.mk, src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffgload.h, src/truetype/ttdriver.c, src/truetype/ttgload.h, src/truetype/ttgload.c, src/type1/t1driver.c, src/type1/t1gload.h, src/type1/t1gload.c: Add a new header named FT_ADVANCES_H declaring some new APIs to extract the advances of one or more glyphs without necessarily loading their outlines. Also provide 'fast loaders' for the TrueType, Type1 and CFF font drivers (more to come later) * autogen.sh: add checks for minimum version of the 'autotools' stuff.
Werner Lemberg da32d705 2008-08-06T09:09:41 Add one more example to the documentation of FT_Glyph_To_Bitmap.
Werner Lemberg eba3eeec 2008-08-04T15:54:24 * src/cff/cffparse.c (cff_parse_fixed_scaled): Fix thinko which resulted in incorrect scaling. This fixes Savannah bug #23973.
Werner Lemberg 806f5934 2008-07-30T05:28:37 * src/cff/cffgload.c (cff_decoder_parse_charstrings): No longer assume that the first argument on the stack is the bottom-most element. Two reasons: o According to people from Adobe it is missing in the Type 2 specification that pushing of additional, superfluous arguments on the stack is prohibited. o Acroread in general handles fonts differently, namely by popping the number of arguments needed for a particular operand (as a PS interpreter would do). In case of buggy fonts this causes a different interpretation which of the elements on the stack are superfluous and which not. Since there are CFF subfonts (embedded in PDFs) which rely on Acroread's behaviour, FreeType now does the same.
Werner Lemberg bdcfddcd 2008-07-26T21:22:20 * src/cff/cffgload.c (cff_decoder_prepare, cff_decoder_parse_charstrings): Improve debug output.
Werner Lemberg bd48d35b 2008-07-16T07:05:11 Set FT_FACE_FLAG_CID_KEYED only if pure_cff is set.
Werner Lemberg 3d2f06f3 2008-07-16T06:13:34 Handle CID-keyed fonts wrapped in a SFNT (with cmaps) correctly. * src/cff/cffload.c (cff_font_load): Pass `pure_cff'. Invert sids table only if `pure_cff' is set. * src/cff/cffload.h: Udpated. * src/cff/cffobjs.c (cff_face_init): Updated.
Werner Lemberg 5b631d89 2008-06-19T16:23:43 * src/cff/cffobjs.c (cff_face_init): Compute final `dict->units_per_em' value before assigning it to `cffface->units_per_EM'. Otherwise, CFFs without subfonts are be scaled incorrectly if the font matrix is non-standard. This fixes Savannah bug #23630. * docs/CHANGES: Updated.
Werner Lemberg 6174e17c 2008-06-10T05:58:25 * Version 2.3.6 released. ========================= Tag sources with `VER-2-3-6'. * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump version number to 2.3.6. * README, Jamfile (RefDoc), builds/win32/visualc/index.html, builds/win32/visualc/freetype.dsp, builds/win32/visualc/freetype.vcproj, builds/win32/visualce/index.html, builds/win32/visualce/freetype.dsp, builds/win32/visualce/freetype.vcproj: s/2.3.5/2.3.6/, s/235/236/. * include/freetype/freetype.h (FREETYPE_PATCH): Set to 6. * builds/unix/configure.raw (version_info): Set to 9:17:3. * include/freetype/internal/psaux.h (T1_BuilderRec): Remove `scale_x' and `scale_y'. * src/cff/cffgload.h (CFF_Builder): Remove `scale_x' and `scale_y'. * src/cff/cffparse.c: Include FT_INTERNAL_DEBUG_H. * src/cff/cffobjs.h: Include FT_INTERNAL_POSTSCRIPT_HINTS_H.
Werner Lemberg e6e6eade 2008-05-14T23:05:38 Finish fix of scaling bug of CID-keyed CFF subfonts. * include/freetype/internal/ftcalc.h, src/base/ftcalc.c (FT_Matrix_Multiply_Scaled, FT_Vector_Transform_Scaled): New functions. * src/cff/cffobjs.h (CFF_Internal): New struct. It is used to provide global hinting data for both the top-font and all subfonts (with proper scaling). * src/cff/cffobjs.c (cff_make_private_dict): New function, using code from `cff_size_init'. (cff_size_init, cff_size_done, cff_size_select, cff_size_request): Use CFF_Internal and handle subfonts. (cff_face_init): Handle top-dict and subfont matrices correctly; apply some heuristic in case of unlikely matrix concatenation results. This has been discussed with people from Adobe (thanks goes mainly to David Lemon) who confirm that the CFF specs are fuzzy and not correct. * src/cff/cffgload.h (cff_decoder_prepare): Add `size' argument. * src/cff/cffgload.c (cff_builder_init): Updated. (cff_decoder_prepare): Handle hints globals for subfonts. Update all callers. (cff_slot_load): Handling scaling of subfonts properly. * src/cff/cffparse.c (cff_parse_fixed_dynamic): New function. (cff_parse_font_matrix): Use it. * src/cff/cfftypes.h (CFF_FontDictRec): Make `units_per_em' FT_ULong. * docs/CHANGES: Document it.