Commit Graph

228 Commits

Author SHA1 Message Date
Werner Lemberg 9c45ac3966 Add `FT_Get_{MM,Var}_Blend_Coordinates' functions.
* include/freetype/ftmm.h: Declare.

* include/freetype/internal/services/svmm.h (FT_Get_MM_Blend_Func):
New typedef.
(MultiMasters): New MM service function `get_mm_blend'.
(FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated.
Update all callers.

* src/base/ftmm.c (FT_Get_MM_Blend_Coordinates,
FT_Get_Var_Blend_Coordinates): Implement.

* src/truetype/ttdriver.c: Updated.

* src/truetype/ttgxvar.c (TT_Get_MM_Blend): New function to handle
`get_mm_blend' service.
* src/truetype/ttgxvar.h: Updated.

* src/type1/t1driver.c: Updated.

* src/type1/t1load.c (T1_Get_MM_Blend): New function to handle
`get_mm_blend' service.
* src/type1/t1load.h: Updated.

* docs/CHANGES: Document.
2016-10-26 16:00:00 +02:00
Werner Lemberg 7eeaf986b5 [truetype] Fix handling of `cvar' table data.
Reported as

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

* src/truetype/ttgxvar.c (tt_face_vary_cvt): Ignore invalid CVT
indices.
2016-10-14 08:58:17 +02:00
Werner Lemberg 922812281c * src/truetype/ttgxvar.c (tt_done_blend): Fix deallocation. 2016-10-11 07:12:12 +02:00
Werner Lemberg 2067c6985a [truetype] Disallow bitmap strokes for non-default instances.
Also speed up access of default instances if GX variations are
active.

* include/freetype/internal/tttypes.h (TT_FaceRec): Add
`is_default_instance' member.

* src/sfnt/sfobjs.c (sfnt_init_face): Initialize
`is_default_instance'.

* src/truetype/ttgload.c (TT_Process_Simple_Glyph,
load_truetype_glyph): Add test for default instance.
(TT_Load_Glyph): Load embedded bitmaps for default instance only.

* src/truetype/ttgxvar.c (TT_Set_MM_Blend): Compute
`is_default_instance'.
2016-09-29 19:49:07 +02:00
Werner Lemberg 4e659d7ead [truetype] More fixes for handling of GX deltas.
Problems reported by Bob Taylor <Bob.Taylor@monotype.com>.

* src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix rough
sanity test for glyph variation array header size.
Always set stream position before reading packed x and y deltas.
Fix thinko w.r.t. `localpoints' array.
2016-09-03 18:14:00 +02:00
Werner Lemberg 7f63105c07 [truetype] Sanitizer fix, second try.
* src/truetype/ttgxvar.c (ft_var_readpackedpoints): Fix boundary
tests and use only one slot more.
2016-07-19 21:35:58 +02:00
Werner Lemberg 9f6426eb16 Thinko; fix previous commit. 2016-07-19 07:23:38 +02:00
Werner Lemberg e69f34b1e2 [truetype] Sanitizer fix.
* src/truetype/ttgxvar.c (ft_var_readpackedpoints): Increase array
to fix nested loops.
2016-07-19 07:06:19 +02:00
Behdad Esfahbod 69446ddcce [truetype] Make all glyphs in `Zycon' GX font work.
* src/truetype/ttgxvar.c (ft_var_readpackedpoints): Fix boundary
tests.
2016-07-16 10:52:38 +02:00
Werner Lemberg a3b61253a7 [truetype] Fix GX delta tracing.
* src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Trace
relative point movements.
2016-07-16 08:16:16 +02:00
Werner Lemberg f147fb2881 [truetype] More fixes for GX.
This finally fixes the rendering of the cyclist and the lizard in
the `Zycon' font.

* src/truetype/ttgxvar.c (ft_var_readpackedpoints): `first' point
index is always cumulative.

(tt_handle_deltas): Rename to...
(tt_interpolate_deltas): ... This.
Add new parameter for output point array.
Update caller.

(TT_Vary_Apply_Glyph_Deltas): Add `points_out' array; it now holds
the intermediate results of `tt_interpolate_deltas' that are to be
added to `outline->points'.
2016-07-16 07:06:21 +02:00
Werner Lemberg 631e218147 * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix tracing. 2016-07-14 06:25:05 +02:00
Behdad Esfahbod 0f9ddf20c8 [truetype] Fix gxvar delta interpolation.
The coordinates of the base font should be used for interpolation
purposes, NOT the current points (i.e., the result of accumulation
of previous deltas).

* src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Initialize
`points_org' before looping over all tuples.
2016-07-14 06:08:39 +02:00
Behdad Esfahbod 99eff67824 [truetype] Another fix for non-intermediate GX tuples.
* src/truetype/ttgxvar.c (ft_var_apply_tuple): Add some missing
cases.
2016-04-16 07:32:23 +02:00
Behdad Esfahbod 74c0a72d52 [truetype] Fix handling of non-intermediate GX tuples.
We probably did not notice this as all fonts we tested had only
tuple_coords[i] be +1 or -1 for non-intermediate tuples.

* src/truetype/ttgxvar.c (ft_var_apply_tuple): Implement it.
2016-03-09 20:35:27 +01:00
Werner Lemberg 3295039107 Whitespace. 2016-02-15 12:54:40 +01:00
Werner Lemberg 9adeab6452 Update copyright year. 2016-01-13 11:54:10 +01:00
Werner Lemberg 43a96eb26f [truetype] Refine some GX sanity tests.
Use the `gvar' table size instead of the remaining bytes in the
stream.

* src/truetype/ttgxvar.h (GX_BlendRec): New field `gvar_size'.

* src/truetype/ttgxvar.c (ft_var_load_gvar): Set `gvar_size'.
(ft_var_readpackedpoints, ft_var_readpackeddeltas: New argument
`size'.
(tt_face_vary_cvt, TT_Vary_Apply_Glyph_Deltas): Updated.
2015-10-13 11:18:55 +02:00
Werner Lemberg 052f6c5649 [truetype] Another GX sanity test.
* src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Check
`tupleCount'.
Add tracing message.
2015-10-13 08:24:32 +02:00
Werner Lemberg 7ef0d8661a [truetype] Fix memory leak for broken GX fonts (#46188).
* src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix scope of
deallocation.
2015-10-13 08:14:20 +02:00
Werner Lemberg f96094eef0 [truetype] Fix commit from 2015-10-10.
* src/truetype/ttgxvar.c (ft_var_load_gvar): Add missing error
handling body to condition.
2015-10-13 07:13:56 +02:00
Werner Lemberg da34673e54 [truetype] More sanity tests for GX handling.
These tests should mainly help avoid unnecessarily large memory
allocations in case of malformed fonts.

* src/truetype/ttgxvar.c (ft_var_readpackedpoints,
ft_var_readpackeddeltas): Check number of points against stream
size.
(ft_var_load_avar): Check `pairCount' against table length.
(ft_var_load_gvar): Check `globalCoordCount' and `glyphCount'
against table length.
(tt_face_vary_cvt): Check `tupleCount' and `offsetToData'.
Fix trace.
(TT_Vary_Apply_Glyph_Deltas): Fix trace.
Free `sharedpoints' to avoid memory leak.
2015-10-10 10:21:27 +02:00
Werner Lemberg c220d8b498 [truetype] Better protection against malformed GX data (#46166).
* src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Correctly
handle empty `localpoints' array.
2015-10-10 08:13:04 +02:00
Werner Lemberg 70e9d81577 Fix more invalid left-shifts.
* src/pfr/pfrgload.c (pfr_glyph_load_compound): Use multiplication,
not left-shift.

* src/truetype/ttgxvar.c (ft_var_load_avar, ft_var_load_gvar,
tt_face_vary_cvt, TT_Vary_Apply_Glyph_Deltas): Use multiplication,
not left-shift.
2015-08-02 09:42:12 +02:00
Werner Lemberg 6f91896980 Minor documentation issue. 2015-07-04 11:35:28 +02:00
Werner Lemberg eb1bba9be4 Fix some clang compiler warnings.
* src/base/ftoutln.c (FT_Outline_EmboldenXY), src/cff/cf2intrp.c
(cf2_interpT2CharString), src/truetype/ttgload.c
(load_truetype_glyph), src/truetype/ttgxvar.c (tt_handle_deltas),
src/truetype/ttinterp.c (Ins_INSTCTRL): Fix signedness issues.
2015-06-30 09:46:39 +02:00
Werner Lemberg e9df4e47e3 [truetype] In GX, make private point numbers work correctly.
This is completely missing in Apple's documentation: If a `gvar'
tuple uses private point numbers (this is, deltas are specified for
some points only), the uncovered points must be interpolated for
this tuple similar to the IUP bytecode instruction.  Examples that
need this functionality are glyphs `Oslash' and `Q' in Skia.ttf.

* src/truetype/ttgxvar.c (tt_delta_shift, tt_delta_interpolate,
tt_handle_deltas): New functions.
(TT_Vary_Get_Glyph_Deltas): Renamed to...
(TT_Vary_Apply_Glyph_Deltas): ... this; it directly processes the
points and does no longer return an array of deltas.
Add tracing information.
Call `tt_handle_deltas' to interpolate missing deltas.
Also fix a minor memory leak in case of error.

* src/truetype/ttgxvar.h: Updated.

* src/truetype/ttgload.c (TT_Process_Simple_Glyph,
load_truetype_glyph): Updated.
2015-05-31 12:21:34 +02:00
Werner Lemberg 9845c1d4e9 [truetype] In GX, make intermediate tuplets work at extrema.
* src/truetype/ttgxvar.c (ft_var_apply_tuple): Fix range condition.
2015-05-31 11:57:31 +02:00
Werner Lemberg cdee7d1423 [truetype] Add tracing information to GX code.
* src/truetype/ttgxvar.c (ft_var_load_avar, ft_var_load_gvar,
ft_var_apply_tuple, TT_Get_MM_Var, TT_Set_MM_Blend,
TT_Set_Var_Design, tt_face_vary_cvt): Do it.
2015-05-31 11:54:42 +02:00
Werner Lemberg a678560dc2 Minor. 2015-05-28 17:31:15 +02:00
Werner Lemberg 10e2bb8b3d [type1, truetype] Make the MM API more flexible w.r.t. `num_coords'.
This commit allows `num_coords' to be larger or smaller than the
number of available axes while selecting a design instance, either
ignoring excess data or using defaults if data is missing.

* src/truetype/ttgxvar.c (TT_Set_MM_Blend, TT_Set_Var_Design):
Implement it.

* src/type1/t1load.c (T1_Set_MM_Blend, T1_Set_MM_Design,
T1_Set_Var_Design): Ditto.
2015-03-29 13:32:47 +02:00
Werner Lemberg 6cc425db91 [truetype] Improve `gvar' handling.
* src/truetype/ttgxvar.c (ft_var_readpackedpoints): Correctly handle
single-element runs.  Cf. glyph `Q' in Skia.ttf with weights larger
than the default.
2015-03-21 06:51:07 +01:00
Werner Lemberg 0aa36160d6 Formatting, whitespace, addition of some comments. 2015-03-08 22:50:37 +01:00
Werner Lemberg 328b792313 [truetype] Some fixes and code refactoring in `ttgxvar.c'.
* src/truetype/ttgxvar.c (ft_var_readpackedpoints): Fix return value
of `point_cnt' if two bytes are read.
Use a more vertical coding style.
(ft_var_readpackeddeltas): Use FT_UInt for `delta_cnt' parameter.
Use a more vertical coding style.
2015-03-04 08:40:23 +01:00
Werner Lemberg 3a1df3e188 * src/truetype/ttgxvar.c (TT_Get_MM_Var): Ignore `countSizePairs'.
This is hard-coded to value 2 in `fvar' version 1.0 (and no newer
version exists), but some fonts set it incorrectly.

Problem reported by Adam Twardoch <adam@fontlab.com>.
2015-02-19 15:42:48 +01:00
Werner Lemberg 1f7a4e1f40 [truetype] Finish compiler warning fixes for signedness issues.
* src/truetype/ttgxvar.c, src/truetype/ttsubpix.c,
src/truetype/ttsubpix.h: Apply.
2015-02-17 10:17:56 +01:00
Werner Lemberg f57fc59e01 Run `src/tools/update-copyright'. 2015-01-17 20:41:43 +01:00
Werner Lemberg 6689a009ce [Savannah bug #43682] Properly handle missing return errors.
The functions in this patch *do* return non-trivial errors that must
be taken care of.

* src/autofit/afloader.c (af_loader_load_g), src/base/ftobjs.c
(FT_Render_Glyph_Internal), src/base/ftoutln.c (FT_Outline_Render),
src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_endchar>,
src/psaux/psobjs.c (ps_parser_load_field_table), src/psaux/t1decode
(t1_decoder_parse_charstrings) <op_endchar>, src/truetype/ttgload.c
(load_truetype_glyph <subglyph loop>, tt_loader_init,
TT_Load_Glyph), src/truetype/ttgxvar.c (TT_Set_MM_Blend),
src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Do it.
2014-11-25 08:53:09 +01:00
Werner Lemberg badf317840 Next round of compiler fixes.
* builds/win32/ftdebug.c, builds/wince/ftdebug.c (ft_debug_init):
Add proper cast.

* include/freetype/internal/ftserv.h (FT_SERVICE_UNAVAILABLE): Fix
cast.
* include/freetype/internal/ftstream.h: Decorate stream and frame
macros with `FT_Long' and `FT_ULong' as appropriate.

* src/base/ftrfork.c (raccess_guess_darwin_hfsplus,
raccess_guess_darwin_newvfs): Use cast.

* src/bdf/bdflib.c (_bdf_set_default_spacing): Use cast.

* src/cache/ftcmanag.c (FTC_Manager_Check): Fix cast.
* src/cache/ftcmanag.h (FTC_ManagerRec): Ditto.

* src/cff/cf2arrst.c (cf2_arrstack_setNum_Elements): Use cast.
* src/cff/cf2ft.c (cf2_freeSeacComponent): Ditto.
* src/cff/cffobjs.c (remove_subset_prefix, remove_style): Ditto.

* src/cid/cidparse.c (cid_parser_new): Use cast.

* src/pcf/pcfdrivr.c (PCF_Glyph_Load): Use cast.

* src/psaux/psobjs.c (reallocate_t1_table): Fix argument type.

* src/raster/ftraster.c (ft_black_reset): Use cast.

* src/truetype/ttgxvar.c (FT_Stream_FTell): Use cast.
(ALL_POINTS): Fix cast.

* src/type1/t1driver.c (t1_ps_get_font_value): Add casts.
* src/type1/t1parse.c (T1_Get_Private_Dict): Add cast.
2013-06-06 09:16:38 +02:00
Werner Lemberg 45392b77a8 Fix compiler warnings.
* include/freetype/internal/ftmemory.h: Decorate memory allocation
macros with `FT_Long' where appropriate.
Remove duplicate of FT_MEM_QRENEW_ARRAY definition.

* src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use
cast.

* src/base/ftobjs.c: Add warning disabling pragma for MSVC while
including `md5.c'.

* src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdESC>: Add
cast.

* src/sfnt/ttsbit.c (tt_sbit_decoder_load_compound): Fix casts.
(tt_sbit_decoder_load_bitmap): Beautification.

* src/smooth/ftsmooth.c (ft_smooth_render_generic): Initialize
variables (earlier).

* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Pacify compiler.

* src/truetype/ttgxvar.c (TT_Get_MM_Var): Use unsigned constants
where appropriate.

* src/type1/t1load.c (T1_Get_MM_Var): Ditto.
2013-06-05 13:43:20 +02:00
Werner Lemberg e3c9301581 */*: Use FT_Err_Ok only.
This is a purely mechanical conversion.
2013-03-14 11:21:17 +01:00
Werner Lemberg 059bc335ce */*: Use `FT_THROW'.
This is essentially a mechanical conversion, adding inclusion of
`FT_INTERNAL_DEBUG_H' where necessary, and providing the macros for
stand-alone compiling modes of the rasterizer modules.

To convert the remaining occurrences of FT_Err_XXX and friends it is
necessary to rewrite the code.  Note, however, that it doesn't harm
if some cases are not handled since FT_THROW is a no-op.
2013-03-14 10:27:35 +01:00
Werner Lemberg a9f6f85e77 Various compiler warning fixes.
* include/freetype/internal/ftserv.h (FT_SERVICE_UNAVAILABLE): Use
`logical not' operator instead of negation.  The idea is that `~'
returns exactly the data type enforced by the cast to a pointer (be
it 32bit or 64bit or whatever), while a negative integer has not
this flexibility.
* src/cache/ftccmap.c (FTC_CMAP_UNKNOWN): Ditto.
* src/truetype/ttgxvar.c (ALL_POINTS, TT_Get_MM_Var): Ditto.
* src/type/t1load.c (T1_Get_MM_Var): Ditto.
(parse_blend_axis_types): Use cast.
* src/bdf/bdflib.c (_bdf_readstream): Use cast.
2012-12-17 09:08:09 +01:00
Alexei Podtelezhnikov 4ae9cbb025 [truetype, type1] Revise the use of FT_MulDiv.
* src/truetype/ttgxvar.c: Updated.
* src/truetype/ttobjs.c: Updated.
* src/type1/t1load.c: Updated.
2012-12-01 23:36:02 -05:00
Werner Lemberg 9c98fbf634 Handle some border cases.
* include/freetype/config/ftstdlib.h (FT_USHORT_MAX): New macro.

* src/base/ftbitmap.c (FT_Bitmap_Convert): Protect against invalid
value of `target->rows'.

* src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add check for
flex start.

* src/raster/ftrend1.c (ft_raster1_render): Check `width' and
`height'.

* src/truetype/ttgxvar.c (TT_Vary_Get_Glyph_Deltas): Protect against
invalid values in `localpoints' array.
2011-10-01 09:25:55 +02:00
suzuki toshiya e62c876bb0 Fix g++4.6 compiler warnings in module drivers.
The background is same with previous commit.

* src/truetype/ttgxvar.c (ft_var_readpackedpoints):
Init `points'.  (TT_Vary_Get_Glyph_Deltas): Init
`delta_xy'.  (TT_Get_MM_Var): Init `mmvar'.
* src/type1/t1load.c (T1_Get_MM_Var): Ditto.
* src/cff/cffdrivr.c (cff_ps_get_font_info): Init
`font_info'.
* src/cff/cffload.c (cff_index_get_pointers): Init `t'.
(cff_font_load): Init `sub'.
* src/cff/cffobjs.c (cff_size_init): Init `internal'.
(cff_face_init): Init `cff'.
* src/pfr/pfrload.c (pfr_extra_item_load_stem_snaps):
Init `snaps'.
* src/pcf/pcfread.c (pcf_get_properties): Init `properties'.
(pcf_get_bitmaps): Init `offsets'.  (pcf_get_encodings):
Init `tmpEncoding'.
* src/sfnt/ttload.c (tt_face_load_gasp): Init `gaspranges'.
* src/sfnt/ttsbit.c (Load_SBit_Image): Init `components'.
* src/cache/ftcmru.c (FTC_MruList_New): Init `node'.
* src/gzip/ftgzip.c (FT_Stream_OpenGzip): Init `zip' and
`zip_buff'.
* src/lzw/ftlzw.c (FT_Stream_OpenLZW): Init `zip'.
* src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Init `zip'.
2011-06-15 02:48:33 +09:00
Werner Lemberg 59eb9f8cfe Fix Savannah bug #31310.
* src/truetype/ttgxvar.c (ft_var_readpackedpoints): Protect against
invalid `runcnt' values.
2010-10-12 07:49:17 +02:00
Werner Lemberg c8f5b98be2 Remove C++ warnings.
*/*: Initialize pointers where necessary to make g++ happy.
2010-07-12 21:13:22 +02:00
Jonathan Kew 25e742c573 Add overflow check to `fvar' table.
* src/truetype/ttgxvar.c (TT_Get_MM_Var): Check axis and instance
count.
2010-04-06 16:42:56 +02:00
Werner Lemberg 7da7ad9457 Really fix compiler warnings.
Reported by Sean.

* src/truetype/ttgxvar.c (GX_PT_POINTS_ARE_WORDS,
GX_PT_POINT_RUN_COUNT_MASK): Convert enum values to macros.
2009-12-16 18:13:55 +01:00
Werner Lemberg 481324cd36 Fix compiler warnings.
Reported by Sean.

* src/truetype/ttgxvar.c (ft_var_readpackeddeltas): Fix counter data
type.
2009-12-15 08:58:37 +01:00
bram tassyns 06ba45978d Fix Savannah bug #27811.
* src/truetype/ttxgvar.c (ft_var_readpackeddeltas): Fix
signed/unsigned mismatch.
2009-10-26 22:26:31 +01:00
suzuki toshiya ec7bc863fb truetype: Extend TrueType GX packed deltas to FT_Offset. 2009-08-01 00:32:19 +09: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 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
Suzuki, Toshiya (鈴木俊哉) 6922266b2c * src/truetype/ttgxvar.c (TT_Set_MM_Blend): Disambiguate 2008-10-15 15:22:39 +00:00
Werner Lemberg 0192230ea2 (important) formatting 2008-10-11 06:00:15 +00:00
Werner Lemberg 2b0b4221ab Cosmetic code changes. 2008-05-28 22:17:28 +00:00
Werner Lemberg 3863c95146 * src/truetype/ttgxvar.c (TT_Get_MM_Var): Fix named style loop.
Patch from Savannah bug #22541.
2008-03-13 06:38:37 +00:00
Werner Lemberg 6e87ed9f04 Spelling fixes from Alexei. 2007-01-26 22:18:56 +00:00
Werner Lemberg c6afa1221a * include/freetype/internal/ftmemory.h: s/new/newsz/ (for C++).
(FT_ALLOC): Remove redundant redefinition.

* builds/compiler/gcc-dev.mk (CFLAGS) [g++]: Don't use
`-Wstrict-prototypes'.

* src/base/ftstream.c (FT_Stream_EnterFrame): Add cast.

Formatting, copyright years.
2006-05-02 22:22:16 +00:00
David Turner 9ca782569c * include/freetype/internal/ftmemory.h, src/base/ftbitmap.c,
src/base/ftmac.c, src/base/ftrfork.c, src/lzw/ftzopen.c,
    src/raster/ftrend1.c, src/sfnt/ttpost.c, src/truetype/ttgxvar.c,
    src/type42/t42parse.c, src/winfonts/winfnt.c: hardening the code
    against out-of-bounds conditions when allocating arrays. This is
    for the cases where FT_NEW_ARRAY and FT_RENEW_ARRAY are not used
    already. Introducing the new FT_ALLOC_MULT and FT_REALLOC_MULT
    macros.
2006-05-02 09:00:29 +00:00
Werner Lemberg f814f68231 * src/base/ftrfork.c (raccess_guess_apple_generic): Mark
`version_number' and `entry_length' as unused.
(raccess_guess_linux_double_from_file_name): Remove `memory'.
(raccess_make_file_name): Mark `error' as unused.

* src/bdf/bdflib.c (_bdf_parse_properties): Remove `memory'.

* src/cid/cidobjs.c (cid_face_init): Remove `psnames'.

* src/sfnt/sfobjs.c (sfnt_load_face): Remove `memory'.

* src/truetype/ttgxvar.c (ft_var_readpackedpoints,
ft_var_readpackeddeltas, ft_var_load_avar): Mark `error' as unused.
2005-05-22 20:33:09 +00:00
Werner Lemberg 22ad9ef024 Handle unsorted SFNT type 4 cmaps correctly (reported by Dirck
Blaskey).

* src/sfnt/ttcmap.h (TT_CMap): Add member `unsorted'.
* src/sfnt/ttcmac.c: Use SFNT_Err_Ok where appropriate.

(tt_cmap0_validate, tt_cmap2_validate, tt_cmap6_validate,
tt_cmap8_validate, tt_cmap10_validate, tt_cmap12_validate): Use
`FT_Error' as return type.
(tt_cmap4_validate): Use `FT_Error' as return type.
Return error code for unsorted cmap.
(tt_cmap4_char_index, tt_cmap4_char_next): Use old code for unsorted
cmaps.
(tt_face_build_cmaps): Set `unsorted' variable in cmap.


Minor formatting.
2005-05-09 22:11:36 +00:00
David Turner 750fa961c6 * Jamfile: removing otvalid from the list of compiled modules
* include/freetype/internal/ftserv.h: added compiler pragmas to get rid
    of annoying warnings with Visual C++ compiler in maximum warning mode

  * src/autofit/afhints.c, src/autofit/aflatin.c, src/base/ftstroke.c,
    src/bdf/bdfdrivr.c, src/cache/ftcbasic.c, src/cache/ftccmap.c,
    src/cache/ftcmanag.c, src/cff/cffload.c, src/cid/cidload.c,
    src/lzw/zopen.c, src/otvalid/otvgdef.c, src/pcf/pcfread.c,
    src/sfnt/sfobjs.c, src/truetype/ttgxvar.c: removing compiler warnings
2005-05-01 10:11:32 +00:00
Werner Lemberg bbdee28f75 * builds/unix/configure.ac: Add `-fno-strict-aliasing' if gcc is
used.
* builds/unix/configure: Regenerated.
* builds/unix/config.guess, builds/unix/config.sub: Updated from
`config' CVS module at subversions.gnu.org.


* src/cache/ftcglyph.c (FTC_GNode_UnselectFamily,
FTC_GCache_Lookup): Fix comparison with zero.

* docs/INSTALL.VMS: Updated.

* vms_make.com: Updated.  All `descrip.mms' files are now created
automatically.

* src/*/descrip.mms: Removed.
2004-11-17 08:19:27 +00:00
Werner Lemberg 619e147621 * src/truetype/ttgxvar.c (TT_Vary_Get_Glyph_Deltas): Fix call to
FT_NEW_ARRAY.
2004-09-08 09:47:44 +00:00
Werner Lemberg 3273a99160 * src/pcf/pcfread (pcf_load_font), src/bdf/bdfdrivr.c
(BDF_Face_Init), src/truetype/ttgxvar (TT_Get_MM_Var,
tt_face_vary_cvt): Fix compiler warnings.
2004-07-31 23:04:23 +00:00
David Turner c28b8c1bfb * src/truetype/ttgload.c, src/truetype/ttxgvar.c: removing
compiler warnings
2004-06-24 20:18:24 +00:00
Werner Lemberg ee6e92c28e * src/truetype/ttxgvar.c (ft_var_load_avar): Do free arrays in case
of error -- `avar' is optional so we can't rely on tt_done_blend
being called automatically.
2004-05-11 06:45:27 +00:00
Werner Lemberg 19b42a5c3a * src/truetype/ttxgvar.c (ft_var_load_avar, ft_var_load_gvar): Fix
error handling.
2004-05-10 20:54:27 +00:00
Yamato, Masatake (大和正武) 17f4b8b6f0 * src/truetype/ttgxvar.c (ft_var_load_gvar): Use FT_FACE_STREAM.
(*): Rename local variable OffsetToData to offsetToData.
2004-05-07 08:59:29 +00:00
Werner Lemberg 3bcad43998 * src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.

* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.

* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.

* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.

* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.

* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.

* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.

* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 11:48:35 +00:00
Werner Lemberg cdb6e70a36 * src/truetype/ttgxvar.c (ft_var_apply_tuple): Fix typo.
* src/truetype/Jamfile, docs/CHANGES: Updated.
2004-04-26 08:09:30 +00:00
Werner Lemberg 44bb303510 * src/pcf/pcfdrivr.c: Revert change from 2004-04-17.
* src/pcf/pcfutil.c: Use FT_LOCAL_DEF.
* src/pcf/pcfutil.h: Include FT_CONFIG_CONFIG_H.
Use FT_BEGIN_HEADER and FT_END_HEADER.
Use FT_LOCAL.

2004-04-24  George Williams  <gww@silcom.com>

Add support for Apple's distortable font technology (in GX fonts).

* devel/ftoption.h, include/freetype/config/ftoption.h
(TT_CONFIG_OPTION_GX_VAR_SUPPORT): New macro.

* include/freetype/ftmm.h (FT_Var_Axis, FT_Var_Named_Style,
FT_MM_Var): New structures.
(FT_Get_MM_Var, FT_Set_Var_Design_Coordinates,
FT_Set_Var_Blend_Coordinates): New function declarations.

* include/freetype/internal/services/svmm.h (FT_Get_MM_Var_Func,
FT_Set_Var_Design_Func): New typedefs.
Update MultiMasters service.

* include/freetype/internal/tttypes.h
[TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include FT_MULTIPLE_MASTERS_H.
(GX_Blend) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New typedef.
(TT_Face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New members `doblend'
and `blend'.

* include/freetype/tttags.h (TTAG_avar, TTAG_cvar, TTAG_gvar): New
macros.

* include/freetype/internal/fttrace.h: Add `ttgxvar'.

* src/base/ftmm.c (FT_Get_MM_Var, FT_Set_Var_Design_Coordinates,
FT_Set_Var_Blend_Coordinates): New functions.

* src/sfnt/sfobjs.c (sfnt_load_face)
[TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Set FT_FACE_FLAG_MULTIPLE_MASTERS
flag for GX var fonts.

* src/truetype/ttgxvar.c, src/truetype/ttgxvar.h: New files.

* src/truetype/truetype.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
ttgxvar.c.

* src/truetype/ttdriver.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
FT_MULTIPLE_MASTERS_H, FT_SERVICE_MULTIPLE_MASTERS_H, and ttgxvar.h.
(tt_service_gx_multi_masters) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]:
New service.
(tt_services) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Updated.

* src/truetype/ttgload.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
ttgxvar.h.
(TT_Process_Simple_Glyph, load_truetype_glyph)
[TT_CONFIG_OPTION_GX_VAR_SUPPORT] :Support GX var fonts.

* src/truetype/ttobjs.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
ttgxvar.h.
(tt_done_face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Call
tt_done_blend.

* src/truetype/ttpload.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
ttgxvar.h.
(tt_face_load_cvt)  [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Call
tt_face_vary_cvt.

* src/truetype/rules.mk (TT_DRV_SRC): Add ttgxvar.c.

* src/type1/t1driver.c (t1_service_multi_masters): Add T1_Get_MM_Var
and T1_Set_Var_Design.

* src/type1/t1load.c (FT_INT_TO_FIXED, FT_FIXED_TO_INT): New macros.
(T1_Get_MM_Var, T1_Set_Var_Design): New functions.

* src/type1/t1load.h (T1_Get_MM_Var, T1_Set_Var_Design): New
function declarations.
2004-04-25 20:15:11 +00:00