Commit Graph

1504 Commits

Author SHA1 Message Date
David Turner 5dbdb6c3c4 * src/cff/cffload.c, src/cff/cffload.h, src/cff/cffgload.c,
src/cff/cfftypes.h: formatting + do not load the CFF index
	offsets into memory, since this wastes a *lot* of heap memory
	with large Asian CFF fonts. There is no significant performance
	loss
2007-01-05 13:14:08 +00:00
David Turner 3a2131a30b formatting 2007-01-05 10:51:56 +00:00
Werner Lemberg 4ea0a7f0b6 formatting, minor doc fixes, copyright years 2007-01-05 09:03:31 +00:00
David Turner f1c7e388ef add missing comments 2007-01-04 23:16:37 +00:00
David Turner d10dff2bed formatting 2007-01-04 22:00:51 +00:00
David Turner 38d1002b8a * src/raster/ftraster.c: removing dynamically generated "count_table",
and replace it with a constant array of bytes
2007-01-04 18:50:12 +00:00
David Turner 8a2c7f8fb8 * src/raster/ftraster.c, src/smooth/ftgrays.c: small optimization, the
rasterizers now	uses the render pool to store their state during scanline
	convertion. this saves about 6 KB of heap space for each FT_Library instance
2007-01-04 18:33:12 +00:00
David Turner 91bd5ddf17 * src/smooth/ftgrays.c: small optimization, the rasterizer now
uses the render pool to store its state during its operation,
        this saves about 4 KB of heap for each FT_Library instance
2007-01-04 18:00:14 +00:00
David Turner 8a6c44e673 Getting rid of the FT_OPTIMIZE_MEMORY macro, since the optimization
is no longer experimental
2007-01-04 17:03:11 +00:00
David Turner a8cf42bb7a * src/pshinter/pshalgo.c: remove a stupid typo that results in no
hinting and a memory leak with some large Asian CFF fonts

        * src/base/ftobjs.c (FT_Done_Library): remove a subtle memory leak
        which happens when FT_Done_Library is called with opened CFF_Faces in
        it. We need to close all faces before destroying the modules, or else
        some bad things (memory leaks) may happen.
2007-01-04 16:46:46 +00:00
Werner Lemberg 6b87e6f0ff * src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt0_pairs_validate):
Remove compiler warning.

Formatting.
2007-01-02 19:20:08 +00:00
David Turner 9207e00198 adding documentation comment 2007-01-02 16:58:13 +00:00
Yamato, Masatake (大和正武) d5d3e41dac (gxv_kern_subtable_fmt0_pairs_validate): New function. Checks uniqueness of the gid pairs.
(gxv_kern_subtable_fmt0_validate): Move some code to `gxv_kern_subtable_fmt0_pairs_validate'.
2006-12-30 20:17:30 +00:00
David Turner 115b442b23 * src/autofit/aflatin.c, src/truetype/ttgload.c: removing compiler
warnings

	* builds/win32/visualc/freetype.vcproj: adding _CRT_SECURE_NO_DEPRECATE
	to avoid deprecation warnings with Visual C++ 8
2006-12-22 11:37:05 +00:00
Werner Lemberg 4755bf7a82 * src/base/ftlcdfil.c (FT_Library_SetLcdFilter)
[FT_FORCE_LIGHT_LCD_FILTER]: Fix typo.
2006-12-16 08:58:44 +00:00
Werner Lemberg 0fd08bdc6a formatting 2006-12-16 02:57:46 +00:00
Suzuki, Toshiya (鈴木俊哉) 1d5b6a6054 * Notes for simplification of src/base/ftmac.c 2006-12-15 15:44:56 +00:00
Suzuki, Toshiya (鈴木俊哉) 7a7d403d7a * Improve resource fork handler for POSIX 2006-12-15 14:47:42 +00:00
Werner Lemberg ec5b4508cc * builds/toplevel.mk (version): Protect against `distclean' target. 2006-12-10 07:51:38 +00:00
Werner Lemberg b26b314a93 * builds/*/*def.mk, builds/*/detect.mk (CAT): Define to either `cat'
or `type'.

* builds/freetype.mk (version): Extracted from freetype.h, using
GNU make's built-in string functions.
(refdoc): Use $(version) instead of static version number.
2006-12-09 20:01:43 +00:00
Werner Lemberg 4e1d6c0c51 * builds/toplevel.mk (dist): Extract version number from freetype.h. 2006-12-09 08:20:37 +00:00
Werner Lemberg 15c29503fb * src/tools/apinames (State): Remove final comma in structure -- xlc
v5 under AIX 4.3 doesn't like this.
2006-12-09 07:29:54 +00:00
Werner Lemberg 256a351264 Fix ChangeLog. 2006-12-08 06:49:33 +00:00
David Turner dbf3b43aea * src/autofit/afloader.c (af_loader_load_g): small adjustment
to the spacing of auto-fitter glyphs. This only impacts rare
        cases (e.g. Arial Bold at rather small character sizes)
2006-12-07 21:18:09 +00:00
Werner Lemberg 1117131c03 * src/sfnt/rules.mk (SFNT_DRV_SRC): Add ttsbit0.c. 2006-12-03 09:43:40 +00:00
Werner Lemberg 960ba59ad9 * src/sfnt/sfobjs.c (tt_face_get_name): All Unicode strings are
encoded in UTF-16BE.  Patch from Rajeev Pahuja <rpahuja@esri.com>.
(tt_name_entry_ascii_from_ucs4): Removed.


* include/freetype/ftxf86.h: Fix and extend comment so that it
appears in the documentation.

* include/freetype/ftchapters.h: Add `font_format' section.


* src/tools/docmaker/tohtml.py (HtmlFormatter::index_exit): Add link
to TOC in index page.


Formatting.
2006-12-01 08:20:47 +00:00
David Turner 3a18c5e29e * src/smooth/ftgrays.c (gray_raster_render): return 0 when we're
trying to rendering into a zero-width/height bitmap, instead of an
    error code.
2006-11-28 08:38:31 +00:00
David Turner 80658e5075 * src/truetype/ttobjs.c (tt_face_init): Fix typo in previous patch
* src/smooth/ftgrays.c: remove hard-coded error values, use FreeType
    ones instead

    * src/autofit/afhints.c (af_glyph_hints_dump_segments): remove unused
    variable
2006-11-28 08:09:20 +00:00
Werner Lemberg 8636c29ae8 * src/truetype/ttobjs.c (tt_face_init): Protect against NULL pointer. 2006-11-26 22:28:13 +00:00
David Turner 1bd6c47260 * src/autofit/afhints.c: add stubs to link the "ftgrid" test program
when debugging is disabled in the auto-hinter
2006-11-25 01:30:40 +00:00
David Turner 81e725f513 * src/autofit/afhints.c, src/autofit/afhints.h, src/autofit/aflatin.c,
src/autofit/aftypes.h: Misc. auto-hinter improvements
2006-11-23 14:49:48 +00:00
Werner Lemberg 91959bf24c Fix Savannah bug #15553.
* src/truetype/ttgload.c (tt_loader_init): Re-execute the CVT
program after a change from mono to grayscaling (and vice versa).
Use correct constant for comparison to get `exec->grayscale'.
2006-11-22 10:36:55 +00:00
Werner Lemberg 913a365090 Because FT_Load_Glyph expects CID values for CID-keyed fonts, the
test for a valid glyph index must be deferred to the font drivers.
This patch fixes Savannah bug #18301.

* src/base/ftobjs.c (FT_Load_Glyph): Don't check `glyph_index'.
* src/bdf/bdfdrivr.c (BDF_Glyph_Load), src/cff/cffgload.c
(cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph),
src/pcf/pcfdrivr.c (PCF_Glyph_Load), src/pfr/pfrobjs.c
(pfr_slot_load), src/truetype/ttdriver.c (Load_Glyph),
src/type1/t1gload.c (T1_Load_Glyph), src/winfonts/winfnt.c
(FNT_Load_Glyph): Check validity of `glyph_index'.
2006-11-19 09:19:17 +00:00
Werner Lemberg 0d0d78dadc formatting 2006-11-14 10:37:10 +00:00
David Turner a95e5c62de updating documentation 2006-11-13 13:24:30 +00:00
David Turner 29c191cd53 * src/base/ftlcdfil.c: added support for FT_FORCE_LIGHT_LCD_FILTER
and FT_FORCE_LEGACY_LCD_FILTER at compile time. Define these macros
      when building the library to change the default LCD filter to be
      used. This is only useful for experimentation
2006-11-13 13:03:48 +00:00
David Turner 7bab6ae3e9 * src/truetype/ttinterp.c: undefined the FIX_BYTECODE macro,
since the interpreter "enhancements" are still too buggy for
      general use
2006-11-13 11:25:06 +00:00
David Turner 8765c71b41 * include/freetype/ftlcdfil.h, include/internal/ftobjs.h,
src/base/ftlcdfilt.c, src/smooth/ftsmooth.c: API change for
       the LCD filter, the FT_LcdFilter value is a enum describing
       which filter to apply, new values FT_LCD_FILTER_LIGHT and
       FT_LCD_FILTER_LEGACY (the latter implements the LibXft original
       algorithm which produces incredible color fringes for everything
       except very-well hinted text)

       * src/autofit/aflatin.c: various tiny improvements that drastically
       improve the handling of serif fonts and of LCD/LCD_V hinting modes.
2006-11-10 16:49:42 +00:00
Werner Lemberg 49c77a87c3 Fix ChangeLog. 2006-11-09 21:51:57 +00:00
David Turner 4e9cc3c4ee * src/pshinter/pshalgo.c (psh_glyph_compute_inflections): fixed
a stupid typo which created a variable-used-before-initialized bug
2006-11-09 16:31:52 +00:00
Werner Lemberg 5e43089b4f * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Handle vertical layout
also.
2006-11-07 09:35:03 +00:00
Werner Lemberg 111b5aefca * src/base/ftcalc.c: Don't use `long long' but `FT_Int64'.
Formatting
2006-11-03 09:40:12 +00:00
David Turner 91b44e65c2 - improve autofitter's handling of serif fonts (results are much better)
- make GCC 4 happy when compiling our zlib sources
2006-11-02 23:28:09 +00:00
David Turner 4060474815 - fixed a bug in af_compute_direction which generated ugly glyphs
- added more debug/log messages to help improve the auto-fitter
2006-11-02 16:37:35 +00:00
Werner Lemberg e88c5261c3 * src/cff/cffload.c (cff_encoding_load): Remove unused variable.
* src/base/ftobjs.c (FT_Select_Charmap): Disallow FT_ENCODING_NONE
as argument.
2006-10-24 05:46:26 +00:00
Werner Lemberg 715e96ecf4 formatting, improving ChangeLog entries 2006-10-24 05:28:45 +00:00
David Turner a186139cad improve FT_Outline_Get_Orientation for broken asian fonts 2006-10-23 16:00:59 +00:00
David Turner 29873a0ccd * src/sfnt/ttmtx.c, src/cff/cffload.c: speeding up the CFF font
loader, with some large CFF fonts, FT_Open_Face is now 350% faster !
2006-10-23 10:23:17 +00:00
David Turner e140f14232 * src/pshinter/pshalgo.c: major speed improvements to the Postscript
hinter, more than 100% speed increase on my machine
2006-10-23 08:56:57 +00:00
Werner Lemberg b9e6d69a96 formatting 2006-10-15 08:58:40 +00:00
Suzuki, Toshiya (鈴木俊哉) 0708826049 * src/base/ftmac.c (FT_New_Face_From_FOND): Initialize the variable error 2006-10-15 07:15:28 +00:00
Suzuki, Toshiya (鈴木俊哉) bfe872dad1 * preliminary autoconf-based cross-building support 2006-10-14 13:08:05 +00:00
Werner Lemberg 82a07e9378 * docs/INSTALL.UNX, docs/UPGRADE.UNX: Renamed to...
* docs/INSTALL.UNIX, docs/UPGRADE.UNIX: This.  Update all documents
which reference those files.
2006-10-12 06:20:44 +00:00
Suzuki, Toshiya (鈴木俊哉) 9d49961fcc * embed explicit Carbon dependency into freetype2.pc and freetype-config, if configured to use Carbon 2006-10-12 01:35:54 +00:00
Werner Lemberg 28e17d9707 * devel/ftoption.h (FT_CONFIG_OPTION_SUBPIXEL_RENDERING): Define for
development.
2006-10-11 17:27:47 +00:00
Jens Claudius 336d229f02 2006-10-03 Jens Claudius <jens.claudius@yahoo.com>
* include/freetype/config/ftstdlib.h: Cast away volatileness from
   argument to ft_setjmp.

 * include/freetype/internal/ftvalid.h: Add comment that
   ft_validator_run must not be used.
2006-10-03 08:53:37 +00:00
Werner Lemberg 046bf8b0cc formatting 2006-10-03 08:43:42 +00:00
Werner Lemberg 2863cfa7c9 * src/base/ftbase.c: Undo change from 2006-09-30.
* src/base/rules.mk (BASE_SRC): Remove `ftlcdfil.c'.
2006-10-01 17:04:00 +00:00
David Turner df430e1a20 * include/freetype/internal/ftobjs.h, src/base/ftobjs.c,
src/truetype/ttobjs.c: fixes related to the unpatented hinter
2006-10-01 00:09:35 +00:00
Werner Lemberg 1e4402e3dc * src/base/rules.mk (BASE_SRC): Remove `ftapi.c' (which is no longer
in use).

* src/base/ftbase.c: Include `ftlcdfil.c'.
2006-09-29 22:10:36 +00:00
Werner Lemberg 2c002e13a7 formatting, improving documentation 2006-09-29 21:31:53 +00:00
Werner Lemberg 9b15ea341c * src/sfnt/ttcmap.c (tt_cmap4_char_map_binary): Fix algorithm for
overlapping segments.  Bug reported by Stefan Koch.
2006-09-29 18:22:11 +00:00
David Turner ad83071620 * include/freetype/internal/ftobjs.h, src/truetype/ttobjs.c,
src/base/ftobjs.c: fixed a bug in the automatic unpatented
        hinting support which prevented normal bytecode hinting to
        work properly

        * src/autofit/aftypes.h: undefining AF_DEBUG to get rid of
        traces
2006-09-27 16:20:59 +00:00
David Turner 87e4b339a3 * modules.cfg: adding ftlcdfil.c to the list of default base
extensions
2006-09-27 08:45:49 +00:00
David Turner 26bb2e27d1 * src/base/Jamfile, src/base/rules.mk, vms_make.com: adding
'ftlcdfil.c' to the list of compiled source files
2006-09-27 07:58:43 +00:00
David Turner 8a317cf7ab * include/freetype/freetype.h: bumping FT_FREETYPE_PATCH to 2
for an upcoming 2.2.2 release

        * include/freetype/ftlcdfil.h, src/freetype/ftlcdfil.c:
        added a new API to support color filtering of subpixel glyph
        bitmaps. In default build, the function FT_Library_SetLcdFilter
        returns FT_Err_Unimplemented_Feature; you need to #define
        FT_CONFIG_OPTION_SUBPIXEL_RENDERING in ftoption.h to compile
        the real implementation

        * src/smooth/ftsmooth.c: adding support for sub-pixel color
        filtering; simplifying a few function calls

        * include/freetype/config/ftheader.h: adding FT_LCD_FILTER_H
        macro that points to <freetype/ftlcdfil.h>
2006-09-27 07:52:48 +00:00
Werner Lemberg e20df4a167 * src/pfr/pfrobjs.c (pfr_face_get_kerning): Skip adjustment bytes
correctly.  Reported as Savannah bug #17843.
2006-09-27 06:29:21 +00:00
Werner Lemberg 110246c641 formatting 2006-09-26 21:55:44 +00:00
David Turner e3d6e94853 CHANGES BETWEEN 2.2.1 and 2.2.2
I. IMPORTANT BUG FIXES

    - Various integer overflows have been fixed.

    - PFB fonts with MacOS resource fork weren't  handled correctly on
      non-MacOS platforms.

    - The PCF font loarder has been seriously hardened against malformed
      font files.

  II. IMPORTANT CHANGES

    - the unpatented hinter is now part of the default build of the
      library, and we added code to automatically support "tricky"
      fonts that need it.

      what this means is that FreeType should "just work" with certain
      Asian fonts, like MingLiu, which cannot properly load without a
      bytecode interpreter, but fortunately do not use any of the
      patented bytecode opcodes.

      Note that the API didn't change, so you can still force
      unpatented hinting with a special parameter to FT_Open_Face
      as well.

      if you're an embedded systems developer, you might want to
      *disable* the feature to save code space by undefining
      TT_CONFIG_OPTION_UNPATENTED_HINTING in ftoption.h.

    - LCD-optimized rendering is now disabled in all default builds
      of the library, mainly due to patent reasons. For more information
      see:

      http://lists.gnu.org/archive/html/freetype/2006-09/msg00064.html

      a new configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING has
      been introduced in ftoption.h; manually define it in this file
      if you want to re-enable the feature.

      the change only affects the implementation, not the FreeType API.
      This means that clients don't need to be modified, because the
      library still generates LCD decimated bitmaps, but with the added
      constraint that R=G=B on each triplet.

   - Some computation bugs in the TrueType bytecode interpreter were found,
     which allow us to get rid of very subtle and rare differences we had
     with the Windows renderer.

  III. MISCELLANEOUS

    - TrueType glyph loading is now about 25% faster.

    - the anti-aliased rasterizer has been optimized and is now 15% to 25%
      percent faster than the previous one, depending on content

    - the Type 1 loader has been improved; as an example, it now skips
      over top-level dictionaries properly

======================================================================
2006-09-26 16:58:21 +00:00
David Turner 6f8c622996 * src/autofit/aftypes.h, src/autofit/afhints.h,
src/autofit/afmodule.c: adding support for disabling
        horizontal and vertical hinting for the purpose of debugging
        the auto-fitter
2006-09-26 15:42:44 +00:00
Werner Lemberg 745ff2c29f * src/base/ftmac.c (FT_New_Face_From_FOND): Fall back to SFNT if
LWFN fails and both are available.
2006-09-19 05:48:02 +00:00
Werner Lemberg f9644559a8 formatting 2006-09-12 13:48:10 +00:00
David Turner f3050059dd * src/sfnt/sfobjs.c (tt_face_get_name): support some function
which report their English names through an Apple Roman
        (platform,encoding) pair, with language_id != English

        if the font uses another name entry with language_id == English,
        it will be selected correctly though.

        * src/truetype/ttobjs.c: add unpatent-hinting selection for
        "mingli.ttf"
2006-09-11 12:00:32 +00:00
Werner Lemberg 36d2eab054 * src/truetype/ttpload.c (tt_face_load_hdmx): Handle `record_size'
values which have the upper two bytes set to 0xFF instead of 0xFF
(as it happens in at least two CJKV fonts, `HAN NOM A.ttf' and
`HAN NOM B.ttf').

* src/smooth/ftgrays.c [GRAYS_USE_GAMMA]: Really remove all code.

Formatting.
2006-09-05 19:24:34 +00:00
David Turner c7bc9b7907 * src/smooth/ftgrays.c: minor source cleanups and optimization 2006-09-05 12:17:38 +00:00
David Turner 772e55d38e * src/smooth/ftgrays.c (gray_sweep): Avoid buffer overwrites
when to the end of a bitmap scanline. The fun never ends ;-)
2006-09-05 09:45:15 +00:00
Werner Lemberg d1fc7d427b Fix ChangeLog. 2006-09-05 07:55:42 +00:00
David Turner aa557a908a fix for the latest rasterizer optimization 2006-09-04 16:42:44 +00:00
Werner Lemberg 2d8629b393 * devel/ftoption.h: Synchronize with
include/freetype/config/ftoption.h.

* src/smooth/ftgrays.c (gray_record_cell): Remove shadowing
variable declaration.
(gray_convert_glyph): Fix compiler warnings.

Formatting, copyright years.
2006-09-03 06:18:45 +00:00
David Turner bd50295ca4 * src/smooth/ftgrays.c: optmized the performance of the anti-aliased
rasterizer. The speed gains is between 15% and 25%, depending on
    content
2006-09-01 19:05:24 +00:00
David Turner 6d79f214e1 * src/truetype/ttobjs.c: updated the TrueType loader to recognize
a few fonts that require the automatic unpatented loader
2006-09-01 14:09:35 +00:00
Werner Lemberg d898aeddbe * configure: Make it possible to handle configure options which
have strings containing spaces.
2006-08-29 09:50:34 +00:00
Jens Claudius a787f45580 2006-08-27 Jens Claudius <jens.claudius@yahoo.com>
Fix miscellaneous compiler warnings.

	* freetype2/include/freetype/internal/ftobjs.h: close
	comment with `*/' to avoid `/* in comment' compiler warning.

	* freetype2/src/base/ftdbgmem.c (ft_mem_table_get_source): Turn
	cast `(FT_UInt32)(void*)' into `(FT_UInt32)(FT_PtrDist)(void*)'
	since on 64-bit platforms void* is larger than FT_UInt32.

	* freetype2/src/base/ftobjs.c (t_validator_error): cast
	away volatileness of argument to ft_longjmp. Spotted by
	Werner `Putzfrau' Lemberg.

	* freetype2/src/bdf/bdflib.c (bdf_load_font): initialize
	local variable `lineno'.

	* freetype2/src/gxvalid/gxvmod.c (classic_kern_validate):
	mark local variable `error' volatile.
2006-08-27 11:26:18 +00:00
Werner Lemberg c4c35b773d * builds/unix/ftconfig.in: Synchronize with main ftconfig.h.
Reported by Jens.

Formatting.
2006-08-27 08:03:46 +00:00
Jens Claudius 088e44e877 2006-08-22 Jens Claudius <jens.claudius@yahoo.com>
Fix for previous commit, which caused many compiler warnings/errors
	about addresses of volatile objects passed as function arguments
	as non-volatile pointers.


	* freetype2/include/freetype/internal/ftvalid.h: Make
	FT_Validator typedef a pointer to a volatile object.

	* freetype2/src/gxvalid/gxvmod.c (gxv_load_table): Make function
	argument `table' a pointer to a volatile object.

	* freetype2/src/otvalid/otvmod.c (otv_load_table): Make function
	argument `table' a pointer to a volatile object.
2006-08-22 14:24:30 +00:00
Werner Lemberg 1234299620 formatting 2006-08-19 11:18:09 +00:00
Jens Claudius 2652bd5412 2006-08-18 Jens Claudius <jens.claudius@yahoo.com>
* freetype2/src/gxvalid/gxvmod.c (GXV_TABLE_DECL): Mark local
	variable `_sfnt' as volatile since it must keep its value across
	a call to ft_setjmp.
	(gxv_validate): Same for local variables `memory' and `valid'.
	(classic_kern_validate): Same for local variables `memory',
	`ckern', and `valid'.

	* freetype2/src/otvalid/otvmod.c (otv_validate): Same for function
	parameter `face' and local variables `base', `gdef', `gpos', `gsub',
	`jstf', and 'valid'.

	* freetype2/src/sfnt/ttcmap.c (tt_face_build_cmaps): Same for
	local variable `cmap'.
2006-08-18 17:20:37 +00:00
David Turner 33f5f24957 * include/freetype/internal/ftgloadr.h,
include/freetype/internal/tttypes.h, src/base/ftgloadr.c,
    src/base/ftobjs.c, src/truetype/ttgload.c, src/truetype/ttinterp.c,
    src/truetype/ttobjs.c: improvements to native TrueType hinting,
    this is a first try, controlled by the FIX_BYTECODE macro in
    src/truetype/ttinterp.c
2006-08-16 16:50:55 +00:00
David Turner 2b21a932f1 * src/base/ftobjs.c (ft_validator_run): disabling function, it is
buggy by design, so it will always return -1
2006-08-16 09:24:32 +00:00
David Turner 9fbfc6af07 * src/cid/cidgload.c (cid_slot_load_glyph),
src/truetype/ttgload.c (tt_prepare_zone): removing compiler warnings
2006-08-16 09:11:31 +00:00
Suzuki, Toshiya (鈴木俊哉) f1e96066a6 * modules.cfg: compile ftgxval.c by default 2006-08-15 17:02:47 +00:00
Suzuki, Toshiya (鈴木俊哉) e261f426d6 * src/otvalid/otvmod.c, src/gxvalid/gxvmod.c: replace ft_validator_run by ft_setjmp 2006-08-15 17:00:43 +00:00
Jens Claudius 9950adcc11 * freetype2/include/freetype/internal/psaux.h: (enum T1_TokenType_):
add T1_TOKEN_TYPE_KEY. (struct T1_FieldRec_) add `dict'. Add macros
T1_FIELD_DICT_FONTDICT and  T1_FIELD_DICT_PRIVATE. Change T1_NEW_XXX and
T1_FIELD_XXX macros to take the dictionary where the PS keywords is
expected as an additional argument.

* freetype2/src/cid/cidload.c: (T1_FieldRec): Adjust invocations
of T1_FIELD_XXX.

* freetype2/src/cid/cidtoken.h: Adjust invocations of T1_FIELD_XXX.

* freetype2/src/psaux/psobjs.c: Add macro FT_COMPONENT for tracing.
(ps_parser_to_token): Report a PostScript key as T1_TOKEN_TYPE_KEY
instead as T1_TOKEN_TYPE_ANY. (ps_parser_load_field): Make sure a token
that should be a string or name is a string or name indeed. Avoid
memory leak if a keyword has been already encountered and its value
is overwritten.

* freetype2/src/type1/t1load.c: (T1_FieldRec): Adjust invocations of
T1_FIELD_XXX. (parse_dict): Ignore keywords that occur in the wrong
dictionary (e.g., in Private instead of FontDict).

* freetype2/src/type1/t1tokens.h: Adjust invocations of T1_FIELD_XXX.
2006-08-13 12:14:36 +00:00
Werner Lemberg 814839a6d8 Fix ChangeLog. 2006-07-28 11:55:48 +00:00
Werner Lemberg a4d6a1c8d1 Move creation of field `buildchar' of T1_DecoderRec out of
`t1_decoder_init' and let the caller of `t1_decoder_init' take care
of it.

Call the finisher for T1_Decoder in `cid_face_compute_max_advance'
and `T1_Compute_Max_Advance'.

* freetype2/include/freetype/internal/psaux.h (T1_DecoderRec):
Remove field `face', add `len_buildchar'.

* freetype2/include/freetype/internal/t1types.h (T1_FaceRec): Add
field `buildchar'.

* freetype2/src/cid/cidgload.c (cid_face_compute_max_advance): Call
finisher for T1_Decoder.
(cid_slot_load_glyph): Do not ignore failure when initializing the
T1_Decoder.

* freetype2/src/psaux/t1decode.c (t1_decoder_parse_charstrings):
Updated.
(t1_decoder_init): Remove initialization of fields `buildchar' and
`len_buildchar'.
(t1_decoder_done): Remove deallocation of field `buildchar'.

* freetype/src/type1/t1gload.c (T1_Compute_Max_Advance): Initialize
T1_Decoder's `buildchar' and `len_buildchar'; call finisher for
T1_Decoder.
(T1_Load_Glyph): Initialize T1_Decoder's `buildchar' and
`len_buildchar'; make sure to call finisher for T1_Decoder even in
case of error.

* freetype2/src/type1/t1load.c (T1_Open_Face): Allocate new field
`buildchar' of T1_FaceRec.

* freetype2/src/type1/t1objs.c (T1_Face_Done): Free new field
`buildchar' of T1_FaceRec.
2006-07-19 09:54:56 +00:00
Werner Lemberg 1a380e02d1 * freetype2/include/freetype/internal/psaux.h: New macros
IS_PS_NEWLINE, IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT,
IS_PS_XDIGIT, and IS_PS_BASE85 (from freetype2/src/psaux/psconv.h).
(T1_FieldLocation): Add T1_FIELD_LOCATION_LOADER,
T1_FIELD_LOCATION_FACE, and T1_FIELD_LOCATION_BLEND.
(T1_DecoderRec): New fields `buildchar' and `face'.
(IS_PS_TOKEN): New macro.

* freetype2/include/freetype/internal/t1types.h (T1_FaceRec): New
fields `ndv_idx', `cdv_idx', and `len_buildchar'.

* freetype2/include/freetype/t1tables.h (PS_BlendRec): New fields
`default_design_vector' and `num_default_design_vector'.

* freetype2/src/psaux/psconv.h: Move macros IS_PS_NEWLINE,
IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT,
and IS_PS_BASE85 to freetype2/include/freetype/internal/psaux.h.

* freetype2/src/psaux/psobjs.c (ps_parser_to_token_array): Allow
`token' argument to be NULL if we want only to count the number of
tokens.
(ps_tocoordarray): Allow `coords' argument to be NULL if we just
want to skip the array.
(ps_tofixedarray): Allow `values' argument to be NULL if we just
want to skip the array.

* freetype2/src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add
support for (partially commented out) othersubrs 19-25, 27, and 28.
(t1_decoder_init): Initialize new fields `face' and `buildchar'.
(t1_decoder_done): Release new field `buildchar'.

* freetype2/src/type1/t1load.c (parse_buildchar, parse_private): New
functions.
(t1_keywords): Register them.
(t1_allocate_blend): Updated.
(t1_load_keyword): Handle field types T1_FIELD_LOCATION_LOADER,
T1_FIELD_LOCATION_FACE and T1_FIELD_LOCATION_BLEND.
(parse_dict): Remove `keyword_flags' argument.
Use new macro IS_PS_TOKEN.
Changed function so that later PostScript definitions override
earlier ones.
(t1_init_loader): Initialize new field `keywords_encountered'.
(T1_Open_Face): Initialize new fields `ndv_idx', `cdv_idx', and
`len_buildchar'.
Remove `keywords_flags'.

* freetype2/src/type1/t1load.h (T1_LoaderRect): New field
`keywords_encountered'.
(T1_PRIVATE, T1_FONTDIR_AFTER_PRIVATE): New macros.

* freetype2/src/type1/t1tokens.h [!T1_CONFIG_OPTION_NO_MM_SUPPORT]:
New entries for parsing /NDV, /CDV, and /DesignVector.
2006-07-14 18:28:08 +00:00
Werner Lemberg 4af3c4d7ee Add many checks to protect against malformed PCF files.
* src/pcf/pcfdrivr.c (PCF_Face_Done): Protect against NULL pointers.
(PCF_Face_Init): Add calls to PCF_Face_Done in case of errors.

* src/pcf/pcfread.c (pcf_read_TOC): Protect against malformed table
data and check that tables don't overlap (using a simple
bubblesort).
(PCF_METRIC_SIZE, PCF_COMPRESSED_METRIC_SIZE, PCF_PROPERTY_SIZE):
New macros which give the size of data structures in the data
stream.
(pcf_get_properties): Use rough estimates to get array size limits.
Assign `face->nprops' and `face->properties' earlier so that a call
to PCF_Face_Done can do the clean-up in case of error.
Protect against invalid string offsets.
(pcf_get_metrics): Clean up code.
Adjust tracing message levels.
Use rough estimate to get array size limit.
(pcf_get_bitmaps): Clean up code.
Adjust tracing message levels.
Use rough estimates to get offset limits.
(pcf_get_encodings): Adjust tracing message level.
(pcf_get_accel): Clean up code.
2006-07-08 21:31:24 +00:00
Werner Lemberg 8eb05255fb * src/bdf/bdfdrivr.c (BDF_Face_Init): Handle fonts correctly which
don't have a POINT_SIZE property.  This fixes Savannah bug #16914.
2006-06-27 06:20:01 +00:00
Werner Lemberg 24703f8b39 * src/psaux/t1decode.c (T1_Operator, t1_args_count): Add opcode 15.
(t1_decoder_parse_charstrings): Operator with
opcode 15 pops its two arguments.
Handle the case where the pops of an othersubr may be part of a
subroutine.
Handle unknown othersubrs gracefully: count their operands and let
the following pop operators push the operands as the results onto
the Type1 stack.
Improve handling of setcurrentpoint opcode.
2006-06-26 19:12:51 +00:00
Werner Lemberg c011f4cba1 The Type 1 parser now skips over top-level procedures as required
for a `Simplified Parser'.  This makes the parser more robust as it
doesn't poke around in PostScript code.  Additionally, it makes the
FontDirectory hackery in src/type1/t1load.c unnecessary.

* src/psaux/psobjs.c (IS_OCTAL_DIGIT): New macro.
(skip_literal_string): Add FT_Error as return value.
Handle escapes better.
(skip_string): Add FT_Error as return value.
Don't set `parser->error' but return error code directly.
(skip_procedure): New function.
(ps_parser_skip_PS_token): Handle procedures.
Update code.
(ps_parser_to_token): Update code.
(ps_parser_load_field_table): Handle bbox entries also.

* src/type1/t1load.c (parse_dict): Remove FontDirectory hackery.
Add commented-out code for synthetic fonts.
2006-06-26 09:40:00 +00:00