Commit Graph

3185 Commits

Author SHA1 Message Date
Oran Agra 636c294bef Position Independent Code (PIC) support and infrastructure in base.
* include/freetype/config/ftoption.h add FT_CONFIG_OPTION_PIC
* include/freetype/internal/ftobjs.h Add pic_container member to
FT_LibraryRec.
Add macros to declare and init instances of FT_CMap_ClassRec.
Add macros to init instances of FT_Outline_Funcs and FT_Raster_Funcs.
Add macros to declare, allocate and initialize modules
(FT_Module_Class).
Add macros to declare, allocate and initialize renderers
(FT_Renderer_Class).
Add macro to init instances of FT_Glyph_Class.
Add macros to declare, allocate and initialize drivers
(FT_Driver_ClassRec).
* include/freetype/internal/ftpic.h new file to declare the
FT_PIC_Container struct and the functions to allocate and detroy it.
* include/freetype/internal/ftserv.h add macros to allocate and
destory arrays of FT_ServiceDescRec.
* include/freetype/internal/internal.h define macro to include
ftpic.h.

New Files:
* src/base/ftpic.c implement functions to allocate and destory the
global pic_container.
* src/base/basepic.h declare struct to hold PIC globals for base and
macros to access them.
* src/base/basepic.c implement functions to allocate, destroy and
initialize PIC globals for base.

* src/base/ftinit.c when FT_CONFIG_OPTION_PIC is defined implement
functions that allocate and destroy ft_default_modules according to
FT_CONFIG_MODULES_H in the pic_container instead of the global scope
and use macro from basepic.h to access it.
* src/base/ftobjs.c add calls to the functions that allocate and
destroy the global pic_container when the library is created and
destroyed.

* src/base/jamfile add new files to FT2_MULTI build:
ftpic.c and basepic.c.
* src/base/ftbase.c add new files to build:
ftpic.c and basepic.c.

* src/base/ftglyph.c when FT_CONFIG_OPTION_PIC is defined
ft_bitmap_glyph_class and ft_outline_glyph_class will be allocated
in the pic_container instead of the global scope and use macros from
basepic.h to access them.
* src/base/ftbbox.c allocate bbox_interface stract on the stack
instead of the global scope when FT_CONFIG_OPTION_PIC is defined.
* src/base/ftstroke.c access ft_outline_glyph_class allocated in
ftglyph.c via macros from basepic.h
2009-04-05 17:59:26 +03:00
Oran Agra 2589e5fd94 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.
2009-04-05 17:34:40 +03:00
Oran Agra 3da7e68f75 Minor change in ftstroke.c.
* src/base/ftstroke.c (FT_StrokerRec): Replace `memory' member with
`library' needed for PIC version.
Update all callers.
2009-04-05 17:30:14 +03:00
Oran Agra d8f4b57fbe Typo. 2009-04-05 17:28:48 +03:00
Werner Lemberg cbab53c260 Improve documentation. 2009-04-04 09:26:18 +02:00
Werner Lemberg 314f35ad2e ftnames.c -> ftsnames.c
* src/base/ftnames.c: Rename to...
* src/base/ftsnames.c: This.
* src/base/Jamfile, src/base/rules.mk, src/base/ftbase.c: Updated.
2009-04-04 09:20:14 +02:00
Werner Lemberg d9ba68d6b8 Whitespace. 2009-04-04 09:11:58 +02:00
Werner Lemberg b47b97db84 Fix comment.
OpenType 1.6 now mentions that data in the `loca' table must be ordered.
2009-04-04 07:51:45 +02:00
Werner Lemberg ca98f8cc2b Add support for cmap type 13.
* devel/ftoption.h, include/freetype/config/ftoption.h
(TT_CONFIG_CMAP_FORMAT_13): New macro.

* src/sfnt/ttcmap.c (TT_CMap13Rec, tt_cmap13_init,
tt_cmap13_validate, tt_cmap13_char_index, tt_cmap13_char_next,
tt_cmap13_get_info, tt_cmap13_char_map_def_binary,
tt_cmap14_class_rec): New functions and structures for cmap 13
support.
(tt_cmap_classes): Register tt_cmap13_class_rec.

* docs/CHANGES: Mention cmap 13 support.
2009-04-04 07:42:38 +02:00
Werner Lemberg 8566d4a096 Synchronize ftoption.h versions (minor changes only). 2009-04-04 07:31:33 +02:00
Werner Lemberg fbdf127904 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.
2009-04-01 08:03:37 +02:00
Werner Lemberg 0315bb20ce Typo. 2009-03-31 18:11:55 +02:00
Werner Lemberg 0ddc2fe2ae Slightly improve documentation of FT_Encoding. 2009-03-31 18:06:19 +02:00
Werner Lemberg 3ba8301b21 Callbacks for b/w rasterizer are not implemented currently. 2009-03-30 12:58:41 +02:00
Werner Lemberg b3e6df69e6 Really fix Ghostscript Coverity issue #3904. 2009-03-21 10:45:18 +01:00
Werner Lemberg 4d1a34ce0b Another redundant header inclusion.
* src/truetype/ttgxvar.c: Fix Ghostscript Coverity issue #4041.
2009-03-21 10:42:56 +01:00
Werner Lemberg 86e041b5a8 Remove redundant header inclusions.
This covers many Ghostscript Coverity issues.

* src/*: Do it.
2009-03-21 08:51:44 +01:00
Werner Lemberg 16bd51c819 Fix Ghostscript Coverity issue #3904.
* src/truetype/ttgxvar.c (ft_var_readpackedpoints): Protect against
zero value of `runcnt'.
2009-03-21 07:48:34 +01:00
Werner Lemberg 7171ff5782 Fix `make multi' run.
* src/smooth/ftsmooth.h: Include FT_INTERNAL_DEBUG_H.
2009-03-20 21:08:29 +01:00
Werner Lemberg f4a82bee1e Whitespace. 2009-03-20 16:10:26 +01:00
Werner Lemberg 9dbfac22bc Fix Savannah bug #25923.
* src/cache/ftccmap.c (FTC_CMAP_HASH): Fix typo.
2009-03-20 09:13:59 +01:00
Werner Lemberg 79972af4f0 Protect against too large glyphs.
Problem reported by Tavis Ormandy <taviso@google.com>.

* src/smooth/ftsmooth.c (ft_smooth_render_generic): Don't allow
`width' or `pitch' to be larger than 0xFFFF.
2009-03-20 08:21:37 +01:00
Werner Lemberg a18788b14d Fix validation for various cmap table formats.
* src/sfnt/ttcmap.c (tt_cmap8_validate, tt_cmap10_validate,
tt_cmap12_validate): Check `length' correctly.
(tt_cmap_14_validate): Check `length' and `numMappings' correctly.
2009-03-20 08:03:58 +01:00
Werner Lemberg a49db4f866 Copyright. 2009-03-20 07:30:43 +01:00
Werner Lemberg 0a05ba257b Protect against malformed compressed data.
Problem reported by Tavis Ormandy <taviso@google.com>.

* src/lsw/ftzopen.c (ft_lzwstate_io): Test whether `state->prefix' is
zero.
2009-03-20 07:19:45 +01:00
Werner Lemberg 0545ec1ca3 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.
2009-03-20 06:49:10 +01:00
Vincent Richomme 8b819254b9 Update WinCE Visual C project files.
* builds/wince/vc2005-ce/freetype.vcproj,
builds/wince/vc2008-ce/freetype.vcproj: Add missing base extension
files.
2009-03-19 08:30:49 +01:00
Werner Lemberg a9ba23c856 Remove unused Win32 code.
* builds/wince/ftdebug.c: Remove code guarded with `!_WIN32_WCE'.
Since Win32 is handled separately this is no longer needed.
2009-03-19 08:27:59 +01:00
Vincent Richomme 91b127f70e Make `gzip' module compile on WinCE.
* src/gzip/zconf.h [_WIN32_WCE]: Define NO_ERRNO_H.
2009-03-19 08:17:50 +01:00
Werner Lemberg 80c253f9e8 Remove unused WinCE code.
* builds/win32/ftdebug.c: Remove code guarded with `_WIN32_WCE'.
Since WinCE is handled separately this is no longer needed.
2009-03-19 08:05:06 +01:00
Werner Lemberg 7bb1005de8 docmaker: Don't ignore single-line code blocks.
* src/tools/docmaker/content.py (DocBlock::_init__): Fix change from
2009-01-31.
2009-03-16 20:42:38 +01:00
Werner Lemberg 5a80a94b18 Whitespace. 2009-03-15 20:58:38 +01:00
Steve Langasek 2cd5dce831 Use __asm__ for declaring assembly instead of asm.
* builds/unix/ftconfig.in (FT_MulFix_arm): Use __asm__ instead of
asm on arm, fixing a build failure on armel with -pedantic.
2009-03-15 13:11:25 +01:00
Werner Lemberg e4661646de Fix valgrind warning.
* src/sfnt/ttsbit0.c (tt_sbit_decoder_load_bit_aligned): Don't read
past the end of the frame.
2009-03-14 23:32:24 +01:00
Werner Lemberg f4f5ba2d87 * Version 2.3.9 released.
=========================


Tag sources with `VER-2-3-9'.
2009-03-12 09:56:04 +00:00
Werner Lemberg a284ab6254 * builds/unix/freetype2.in: Move @FT2_EXTRA_LIBS@ to `Libs.private'. 2009-03-12 08:11:12 +00:00
Werner Lemberg b66efefdcd 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).
2009-03-12 08:07:49 +00:00
Werner Lemberg 0711d389d6 Typo. 2009-03-11 21:39:10 +00:00
Werner Lemberg 07e818170f 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.
2009-03-11 21:29:54 +00:00
Werner Lemberg 9318df0cad Fix Savannah bug #25597.
* src/cff/cffparse.c (cff_parse_real): Don't allow fraction_length
to become larger than 9.
2009-03-11 10:20:51 +00:00
Werner Lemberg 1e54a65fa8 Minor update. 2009-03-11 07:10:26 +00:00
Werner Lemberg 911f431966 Fix Savannah bug #25814.
* builds/unix/freetype2.in: As suggested in the bug report, move
@LIBZ@ to `Libs.private'.
2009-03-11 07:07:37 +00:00
Werner Lemberg 801e7bae3a Fix Savannah bug #25781.
We now simply check for a valid `offset', no longer handling `delta
= 1' specially.

* src/sfnt/ttcmap.c (tt_cmap4_validate): Don't check `delta' for
last segment.
(tt_cmap4_set_range, tt_cmap4_char_map_linear,
tt_cmap4_char_map_binary): Check offset.
2009-03-11 06:47:49 +00:00
Werner Lemberg 34ca21edc6 * src/base/Jamfile: Fix handling of ftadvanc.c.
Reported by Oran Agra <oran@monfort.co.il>.
2009-03-11 05:35:01 +00:00
Werner Lemberg 31f5bbba44 Restructure Win32 and Wince compiler support.
* src/builds/win32: Remove files for WinCE.
Move VC 2005 support to a separate directory.
Add directory for VC 2008 support.

* src/builds/wince: New directory hierarchy for WinCE compilers
(VC 2005 and VC 2008).
2009-03-10 11:54:51 +00:00
Werner Lemberg 21dab9112b More preparations for 2.3.9 release.
* docs/CHANGES: Updated.

* Jamfile, README: s/2.3.8/2.3.9/, s/238/239/.
2009-03-09 18:06:28 +00:00
Werner Lemberg 8312ab7563 * src/sfnt/rules.mk (SFNT_DRV_H): Add ttsbit0.c. 2009-03-09 13:18:47 +00:00
Werner Lemberg ee3cc2e4fc Fix handling of EBDT formats 8 and 9 (part 2).
This patch fixes the following problems in ttsbit0.c:

. Bitmaps for compound glyphs were never allocated.

. `SBitDecoder' refused to load metrics if some other metrics have
  already been loaded.  This condition certainly makes no sense for
  recursive calls, so I've just disabled it.  Another possibility
  would be resetting `decoder->metrics_loaded' to false before
  loading each composite component.  However, we must restore the
  original metrics after finishing the recursion; otherwise we can
  get a misaligned glyph.

. `tt_sbit_decoder_load_bit_aligned' incorrectly handled `x_pos',
  causing some glyph components to be shifted too far to the right
  (especially noticeable for small sizes).

Note that support for grayscale bitmaps (not necessarily compound) is
completely broken in ttsbit0.c.

* src/sfnt/tt_sbit_decoder_load_metrics: Always load metrics.
(tt_sbit_decoder_load_bit_aligned): Handle `x_pos' correctly in case
of `h == height'.
(tt_sbit_decoder_load_compound): Reset metrics after loading
components.
Allocate bitmap.
2009-03-09 13:13:44 +00:00
Werner Lemberg 1a5edf7a4f * builds/unix/configure.raw (version_info): Set to 9:20:3. 2009-03-09 08:36:18 +00:00
Werner Lemberg 42f5c714c0 Formatting. 2009-03-03 23:34:49 +00:00