Commit Graph

2100 Commits

Author SHA1 Message Date
suzuki toshiya
c595c06c61 pcf: Handle the string length by size_t variables. 2009-08-01 00:32:12 +09:00
suzuki toshiya
78ba8a610c pcf: Fix some data types mismatching with their sources. 2009-08-01 00:32:11 +09:00
suzuki toshiya
52170ac0ce otvalid: Truncate the glyph index to 16-bit. 2009-08-01 00:32:11 +09:00
suzuki toshiya
f7c6b11691 cache: Insert explict casts for LP64 systems. 2009-08-01 00:32:10 +09:00
suzuki toshiya
ed1d359025 cache: Fix some data types mismatching with their sources. 2009-08-01 00:32:10 +09:00
suzuki toshiya
3f0f2e462b XXX_cmap_encoding_char_next() return FT_UInt32 values. 2009-08-01 00:32:09 +09:00
suzuki toshiya
25dba9cfa8 truetype: Extend TT_Face->num_locations for broken TTFs. 2009-08-01 00:32:09 +09:00
suzuki toshiya
e45e052279 smooth: Fix some data types mismatching with their sources. 2009-08-01 00:32:08 +09:00
suzuki toshiya
c579dc4391 cff: Fix some data types mismatching with their sources. 2009-08-01 00:32:08 +09:00
suzuki toshiya
87054758fb autofit: Fix some data types mismatching with their sources. 2009-08-01 00:32:08 +09:00
suzuki toshiya
b56680240a autofit: Count the size of the memory object by ptrdiff_t. 2009-08-01 00:32:07 +09:00
suzuki toshiya
15dc278c5a autofit: Fix for unused variable `first'. 2009-08-01 00:32:07 +09:00
suzuki toshiya
e866cf3f55 Improve bitmap size or pixel variables for 16-bit systems. 2009-08-01 00:32:06 +09:00
suzuki toshiya
d3ed6d1bba psaux: Prevent invalid arguments to afm_parser_read_vals(). 2009-08-01 00:30:43 +09:00
suzuki toshiya
0d226c31c5 base: Prevent some overflows on LP64 systems. 2009-08-01 00:30:24 +09:00
suzuki toshiya
072e55233e cff: Cast the long variables to 32-bit for LP64 systems. 2009-08-01 00:30:23 +09:00
suzuki toshiya
b61d92898e pcf: Improve PCF_PropertyRec.value names on LP64 platforms. 2009-08-01 00:30:23 +09:00
suzuki toshiya
eae89a7f07 pcf: Fix some data types mismatching with their sources. 2009-08-01 00:30:22 +09:00
suzuki toshiya
be41d3e718 bdf: Improve bdf_property_t.value names for LP64 platforms. 2009-08-01 00:30:22 +09:00
suzuki toshiya
660d651317 bdf: Fix some data types mismatching with their sources. 2009-08-01 00:30:21 +09:00
suzuki toshiya
38e480b4c6 autofit: Improve Unicode range definitions. 2009-08-01 00:30:21 +09:00
suzuki toshiya
93bb15940b smooth: Fix a data type mismatching with its source. 2009-08-01 00:30:21 +09:00
suzuki toshiya
ea5268d2d2 smooth: Fix a data type mismatching with its source. 2009-08-01 00:30:20 +09:00
suzuki toshiya
f4e1c8bdda cache: Disable the legacy compatibility if 16-bit system. 2009-08-01 00:30:20 +09:00
suzuki toshiya
2a5831ec07 cache: Check 32-bit glyph index on 16-bit systems. 2009-08-01 00:30:19 +09:00
suzuki toshiya
b566d42aa0 cache: Fix some data types mismatching with their sources. 2009-08-01 00:30:19 +09:00
suzuki toshiya
ebf8e294fc cache: Fix some data types mismatching with their sources. 2009-08-01 00:30:19 +09:00
suzuki toshiya
9f50873a81 cache: Cast NULL to a required function type explicitly. 2009-08-01 00:30:18 +09:00
suzuki toshiya
41f9d0d6ee fttypes.h: Cast FT_MAKE_TAG output to FT_Tag exlicitly. 2009-08-01 00:30:18 +09:00
suzuki toshiya
82ebaa7b05 psnames: Handle Unicode codepoints by FT_UInt32 variables. 2009-08-01 00:30:17 +09:00
suzuki toshiya
d200982d8b psaux: Use size_t variable to pass the buffer size. 2009-08-01 00:30:17 +09:00
suzuki toshiya
d1ee378566 type1: Use size_t variable to pass the string length. 2009-08-01 00:30:16 +09:00
suzuki toshiya
7fd7c6f2e9 cid: Fix some data types mismatching with their sources. 2009-08-01 00:30:16 +09:00
suzuki toshiya
34c203cdde cff: Fix for unused variable `rest'. 2009-08-01 00:30:16 +09:00
suzuki toshiya
a813cf4801 cff: Fix some data types mismatching with their sources. 2009-08-01 00:30:15 +09:00
suzuki toshiya
2bbcb7edd8 bdf: Fix some data types mismatching with their sources. 2009-08-01 00:30:15 +09:00
suzuki toshiya
763b39496e sfnt: Count the size of the memory object by ptrdiff_t. 2009-08-01 00:30:14 +09:00
suzuki toshiya
f420757c73 lzw: Count the size of the memory object by ptrdiff_t. 2009-08-01 00:30:14 +09:00
suzuki toshiya
88c95bab74 otvalid: Count the table size on memory by ptrdiff_t. 2009-08-01 00:30:13 +09:00
suzuki toshiya
90c7efc8f2 otvalid: Prevent an overflow by GPOS/GSUB 32b-bit offset. 2009-08-01 00:30:13 +09:00
suzuki toshiya
95aeebf438 ftobjs.c: Prevent an overflow in glyph index handling. 2009-08-01 00:30:13 +09:00
suzuki toshiya
2ed9d7fc75 Improve the variable types in raccess_make_file_name(). 2009-08-01 00:30:12 +09:00
suzuki toshiya
61fa1b53c2 ftpatent.c: Fix for unused variable `error'. 2009-08-01 00:30:12 +09:00
suzuki toshiya
f7ecdbc70a type1: Check invalid string longer than PostScript limit. 2009-08-01 00:30:12 +09:00
suzuki toshiya
a8c515d25c gzip: Use FT2 zcalloc() & zfree() in ftgzip.c by default. 2009-08-01 00:30:11 +09:00
suzuki toshiya
5f43bab8bf gzip: Distinguish PureC from TurboC on MSDOS. 2009-08-01 00:30:11 +09:00
suzuki toshiya
3f36047eff gxvalid: Insert PureC pragma to allow unevaluated variables. 2009-08-01 00:30:11 +09:00
suzuki toshiya
62aa9ec647 gxvalid: Pass the union by the pointer instead of the value. 2009-08-01 00:29:29 +09:00
Werner Lemberg
7009a6eb03 Fix Redhat bugzilla #513582 and Savannah bug #26849.
* src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP) <FTC_INLINE>: Fix
aliasing bug.
2009-07-29 11:53:13 +02:00
Werner Lemberg
2cd790d7e2 Document recent library changes.
* docs/CHANGES: Do it.
2009-07-19 11:18:00 +02:00
Werner Lemberg
46e05c443b Fix Savannah bug #23786.
* src/truetype/ttobjs.c (tt_size_init_bytecode): Don't reset x_ppem
and y_ppem.  Otherwise the `*_CVT_Stretched' functions in ttinterp.c
get never called.
An anonymous guy suggested this change on Savannah, and it seems to
be the right solution.
2009-07-17 22:49:34 +02:00
Werner Lemberg
9f27998ebf Merge branch 'master' of wl@git.sv.gnu.org:/srv/git/freetype/freetype2
Conflicts:
	ChangeLog

Merge.
2009-07-15 12:33:01 +02:00
Werner Lemberg
deee58f225 * docs/release: Updated. 2009-07-15 07:58:00 +02:00
Werner Lemberg
0fbdf11a48 README.CVS -> README.git
* README.CVS: Renamed to...
* README.git: This.
Updated.
2009-07-15 07:50:06 +02:00
suzuki toshiya
3009417a7d Borland C++ compiler patch proposed by Mirco Babin. 2009-07-15 12:57:26 +09:00
Werner Lemberg
b2967734a6 Fix Savannah bug #27026.
* builds/win32/vc2005/freetype.sln: Use correct version number.
2009-07-14 16:44:06 +02:00
suzuki toshiya
313d4f4ca6 Add a script to check the undefined and unused trace macros. 2009-07-13 00:01:57 +09:00
suzuki toshiya
3bf7baaac3 Formatting. 2009-07-12 23:54:40 +09:00
Werner Lemberg
a2ef3769bc Merge branch 'master' of wl@git.sv.gnu.org:/srv/git/freetype/freetype2 2009-07-09 18:59:25 +02:00
suzuki toshiya
da59462780 smooth: Check glyph size by width/height, instead of pitch/height. 2009-07-09 17:21:32 +09:00
Werner Lemberg
0d02317fb2 [ftraster] Make it compile again with -D_STANDALONE_.
* src/raster/ftraster.c [_STANDALONE_]: Define
FT_CONFIG_STANDARD_LIBRARY_H.
Include `string.h'.
Don't include `rastpic.h'.
Define FT_DEFINE_RASTER_FUNCS.
2009-07-09 09:21:46 +02:00
suzuki toshiya
8ad243bdcd Shorten URLs referring ft-devel archive. 2009-07-09 16:12:30 +09:00
suzuki toshiya
e05861b9da Register 2 missing trace components, t1afm and ttbdf. 2009-07-09 14:43:57 +09:00
suzuki toshiya
a6990d0612 Register a trace component for ftgloadr.c. 2009-07-09 12:48:23 +09:00
suzuki toshiya
4c531460ed Prevent the overflows by a glyph with too many points or contours. 2009-07-08 14:52:11 +09:00
suzuki toshiya
f4a0f93a14 Fix a typo in ChangeLog, found by mouse@Rodents-Montreal.ORG 2009-07-06 17:16:15 +09:00
Bram Tassyns
3d3ba0563e 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.
2009-07-05 14:54:59 +02:00
suzuki toshiya
ad289d139f ftpatent: Fix a bug by wrong usage of service->table_info(). 2009-06-29 03:09:17 +09:00
Werner Lemberg
24370d67f5 Uff, another thinko. 2009-06-28 02:11:51 +02:00
Werner Lemberg
e7389a4405 [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.
2009-06-28 01:25:55 +02:00
Werner Lemberg
6bb34880e8 Thinko.
* src/psaux/t1decode.c (t1operator_seac)
[FT_CONFIG_OPTION_INCREMENTAL]: Test for existence of incremental
interface.
2009-06-28 00:43:37 +02:00
Werner Lemberg
a7e5a335f2 * devel/ftoption.h [FT_CONFIG_OPTION_INCREMENTAL]: Define. 2009-06-28 00:40:05 +02:00
Werner Lemberg
b8f97f17cd Formatting. 2009-06-28 00:37:53 +02:00
suzuki toshiya
fee19a786d Add tools to preprocess the source files for AtariST PureC. 2009-06-27 17:07:14 +09:00
suzuki toshiya
3609141de4 Fix wrong date in ChangeLog 2009-06-27 15:02:36 +09:00
suzuki toshiya
912f039743 Keep existing modules.cfg in the building tree. 2009-06-27 14:38:32 +09:00
suzuki toshiya
66d308edfd Filter --srcdir= option before invoking builds/unix/configure. 2009-06-27 14:33:06 +09:00
suzuki toshiya
20fb146351 Improve configure.raw for cross-building on exe-suffixed systems. 2009-06-27 14:27:55 +09:00
Werner Lemberg
610cddcac4 [truetype] Remove TT_SubGlyphRec.
* src/truetype/ttobjs.h (TT_SubGlyphRec): Removed, unused.
2009-06-26 07:39:08 +02:00
Werner Lemberg
858abbedc0 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.
2009-06-26 06:15:41 +02:00
Werner Lemberg
777d6d59ed Provide version information better.
* src/base/ftinit.c (FT_Init_FreeType): Don't set version here
but...
* src/base/ftobjs.c (FT_New_Library): Here.
2009-06-25 16:46:39 +02:00
Werner Lemberg
11cb8c36ed Use 16.16 format while parsing Type 1 charstrings.
This fixes Savannah bug #26867.

Previously, only integers have been used which can lead to serious
rounding errors.

However, fractional values are only used internally; after the
charstrings (of either Type 1 or 2) have been processed, the
resulting coordinates get rounded to integers currently -- before
applying scaling.  This should be fixed; at the same time a new load
flag should be introduced, to be used in combination with
FT_LOAD_NO_SCALE, which indicates that font units are returned in
16.16 format.  Similarly, the incremental interface should be
extended to allow fractional values for metrics.

* include/freetype/internal/psaux.h (T1_BuilderRec): Remove `shift'
field.
* include/freetype/internal/pshints.h (T1_Hints_SetStemFunc,
T1_Hints_SetStem3Func): Use FT_Fixed for coordinates.

* src/psaux/psobjs.c: Include FT_INTERNAL_CALC_H.
(t1_build_add_point): Always convert fixed to integer.
* src/psaux/t1decode.c (t1_decoder_parse_charstrings):
Use 16.16 format everywhere (except for large integers followed by a
`div').
[CAN_HANDLE_NON_INTEGRAL_T1_OPERANDS]: Remove #ifdef and activate
code uncoditionally.
Add support for random numbers and update remaining code
accordingly; this should work now.
(t1_operator_seac): Updated.
* src/psaux/pshrec.c: Include FT_INTERNAL_CALC_H.
(ps_hints_t1stem3, t1_hints_stem): Updated.

* src/cid/cidgload.c: Include FT_INTERNAL_CALC_H.
(cid_load_glyph) [FT_CONFIG_OPTION_INCREMENTAL],
(cid_face_compute_max_advance, cid_slot_load_glyph): Updated.

* src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String)
[FT_CONFIG_OPTION_INCREMENTAL], (T1_Get_Advances, T1_Load_Glyph):
Updated.
* src/type1/t1load.c: Include FT_INTERNAL_CALC_H.
* src/type1/t1objs.c (T1_Face_Init): Updated.
2009-06-22 16:56:47 +02:00
Werner Lemberg
df9cd975d3 src/pshinter/pshrec.c: Use PSH_Err_Ok. 2009-06-21 23:25:36 +02:00
Werner Lemberg
f79df78a53 Code beautification.
* src/type1/t1load.c (FT_INT_TO_FIXED): Removed.
Replace everywhere with INT_TO_FIXED.
(FT_FIXED_TO_INT): Move to ...
* include/freetype/internal/ftcalc.h (FIXED_TO_INT): Here.
Update all users.
2009-06-21 20:17:01 +02:00
Werner Lemberg
1f540eff0b Remove unused variables.
* include/freetype/internal/psaux.h (T1_BuilderRec),
src/cff/cffgload.h (CFF_Builder): Remove `last'.
Update all users.
2009-06-20 13:24:08 +02:00
Werner Lemberg
41821f8a8a [psaux] Check large integers while parsing charstrings.
* src/psaux/t1decode.c (t1_decoder_parse_charstrings): Large
integers must be followed by a `div' operator.
2009-06-20 09:31:19 +02:00
Werner Lemberg
541ab5adda [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...
2009-06-20 07:31:44 +02:00
Werner Lemberg
b34c9b49cc aflatin.c: Fix compiler warning. 2009-06-20 06:32:23 +02:00
Werner Lemberg
ae342dab60 builds/compiler/gcc.mk (CFLAGS): Use -O3, not -O6. 2009-06-20 06:01:57 +02:00
Werner Lemberg
f1631f2db0 [cff] Fix handling of reserved byte 0xFF.
* src/cff/cffgload.c (cff_decoder_parse_charstrings): Abort if byte
0xFF is encountered.
2009-06-19 23:50:37 +02:00
Werner Lemberg
86fa2ebc1f Improve debug messages for Type1 charstrings.
* src/psaux/t1decode.c (t1_decoder_parse_charstrings): Emit newlines
after instructions.
Prettify output.
2009-06-19 14:56:26 +02:00
Werner Lemberg
d1862d227c More ftgray fixes for FT_STATIC_RASTER.
Problems reported by suyu@cooee.cn.

* src/smooth/ftgrays.c (gray_move_to, gray_raster_render): Use
RAS_VAR.
2009-06-19 09:09:34 +02:00
Werner Lemberg
140a694373 docs/CHANGES: Updated. 2009-06-18 16:07:11 +02:00
Werner Lemberg
7227114043 Fix B/W rasterization of subglyphs with different drop-out modes.
Normally, the SCANMODE instruction (if present) to set the drop-out
mode in a TrueType font is located in the `prep' table only and thus
valid for all glyphs.  However, there are fonts like `pala.ttf'
which additionally contain this instruction in the hinting code of
some glyphs (but not all).  As a result it can happen that a
composite glyph needs multiple drop-out modes for its subglyphs
since the rendering state gets reset for each subglyph.

FreeType collects the hinted outlines from all subglyphs, then it
sends the data to the rasterizer.  It also sends the drop-out mode
-- after hinting has been applied -- and here is the error: It sends
the drop-out mode of the last subglyph only; drop-out modes of all
other subglyphs are lost.

This patch fixes the problem; it adds a second, alternative
mechanism to pass the drop-out mode: For each contour, the
rasterizer now checks the first `tags' array element.  If bit 2 is
set, bits 5-7 contain the contour's drop-out mode, overriding the
global drop-out mode.

* include/freetype/ftimage.h (FT_CURVE_TAG_HAS_SCANMODE): New macro.

* src/truetype/ttgload.c (TT_Hint_Glyph): Store drop-out mode in
`tags[0]'.

* src/raster/ftraster.c (Flow_Up, Overshoot_Top, Overshoot_Bottom):
Use bits 3-5 instead of 0-2.
(New_Profile): Set the drop-out mode in the profile's `flags' field.
(Decompose_Curve): Check `tags[0]' and set `dropOutControl' if
necessary.
(Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
Horizontal_Gray_Sweep_Drop, Draw_Sweep): Use the profile's drop-out
mode.
2009-06-18 15:42:52 +02:00
Werner Lemberg
42206ad86a Improve scan conversion rules 4 and 6.
Two new constraints are introduced to better identify a `stub' -- a
concept which is only vaguely described in the OpenType
specification.  The old code was too rigorous and suppressed more
pixel than it should.

  . The intersection of the two profiles with the scanline is less
    than a half pixel.  Code related to this was already present in
    the sources but has been commented out.

  . The endpoint of the original contour forming a profile has a
    distance (`overshoot') less than half a pixel to the scanline.

Note that the two additional conditions fix almost all differences
to the Windows rasterizer, but some problematic cases remain.

* src/raster/ftraster.c (Overshoot_Top, Overshoot_Bottom): New
macros for the `flags' field in the `TProfile' structure.
(IS_BOTTOM_OVERSHOOT, IS_TOP_OVERSHOOT): New macros.
(New_Profile, End_Profile): Pass overshoot flag as an argument and
set it accordingly.
Update callers.
(Vertical_Sweep_Drop, Horizontal_Sweep_Drop): Implement the two new
constraints.
2009-06-16 15:14:21 +02:00
Werner Lemberg
0409ef3268 Increase precision for B/W rasterizer.
* src/raster/ftraster.c (Set_High_Precision): Add two more bits to
the precision.  This corrects rendering of some small glyphs, for
example, glyph `xi' in verdana.ttf at 13 ppem.  Testing with ftbench
on my GNU/Linux box I don't see a performance degradation.
2009-06-11 17:32:31 +02:00
Michael Zucchi
f33b237c96 Handle FT_STROKER_LINECAP_BUTT.
This fixes Savannah bug #26757.

* src/base/ftstroke.c (ft_stroker_cap): Implement it.
2009-06-08 17:12:40 +02:00
Werner Lemberg
c6788a389d Fix some potential out-of-memory crashes.
* src/base/ftobjs.c (ft_glyphslot_done): Check `slot->internal'.
* src/base/ftstream.c (FT_Stream_ReleaseFrame): Check `stream'.
* src/truetype/ttinterp.c (TT_New_Context): Avoid double-free of
`exec' in case of failure.
2009-06-07 13:09:21 +02:00
Werner Lemberg
2f2b780e00 Simplify math.
Suggested by Alexei Podtelezhnikov <apodtele@gmail.com>.

* src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
Horizontal_Gray_Sweep_Drop): Do it.
2009-06-07 08:29:30 +02:00
Werner Lemberg
90c699af0c Preparation for fixing scan conversion rules 4 and 6.
* src/raster/ftraster.c (TFlow): Replace enumeration with...
(Flow_Up): This macro.
(TProfile): Replace `flow' member with `flags' bit field.
Update all affected code.
2009-06-05 10:37:15 +02:00