Commit Graph

417 Commits

Author SHA1 Message Date
Werner Lemberg 6b5b6f39e7 Prepare source code for amalgamation (6/6).
* src/cff/cffdrivr.c: s/Load_Glyph/cff_glyph_load/.

* src/cid/cidload.c: s/parse_font_matrix/cid_parse_font_matrix/.
s/t1_init_loader/cid_init_loader/.
s/t1_done_loader/cid_done_loader/.

* src/pxaux/t1cmap.c: s/t1_get_glyph_name/psaux_get_glyph_name/.

* src/truetype/ttdriver.c: s/Load_Glyph/tt_glyph_load/.

* src/type1/t1load.c: s/parse_font_matrix/t1_parse_font_matrix/.
2012-02-24 12:26:25 +01:00
suzuki toshiya 1749d8bc6a Remove trailing spaces. 2012-01-17 02:00:24 +09:00
Werner Lemberg c52f44d4fd Whitespace. 2011-11-30 10:46:53 +01: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
Dirk Müller b03c4a0a3f [psaux, type1] Fix null pointer dereferences.
Found with font fuzzying.

* src/psaux/t1decode.c (t1_decoder_parse_charstrings): Check
`decoder->buildchar'.

* src/type1/t1load.c (t1_load_keyword): Check `blend->num_designs'.
2011-07-22 05:24:11 +02:00
Matthias Drochner 143799d4a9 [psaux] Fix potential sign extension problems.
When shifting right a signed value, it is not defined by the
C standard whether one gets a sign extension or not.  Use a macro to
do an explicit cast from a signed short (assuming that this is
16bit) to an int.

* src/psaux/t1decode.c (Fix2Int): New macro.
Use it where appropriate.
2011-07-14 07:35:51 +02:00
Werner Lemberg 60f8371353 * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
<op_callothersubr>: Better handling of subroutine index 0.
From Matthias Drochner <M.Drochner@fz-juelich.de>.
2011-07-14 07:34:12 +02:00
Werner Lemberg 403559b84a Sort case in switch statement numerically. 2011-07-14 07:21:11 +02:00
Алексей Подтележников dc33b4a155 [psaux] Optimize previous commit.
* src/psaux/t1decode.c (t1_decoder_parse_charstrings)
<op_callothersubr>: Move error check down to avoid testing twice for
good cases.
2011-07-10 07:08:51 +02:00
Werner Lemberg c46b1e2476 [psaux] Add better argument check for `callothersubr'.
* src/psaux/t1decode.c (t1_decoder_parse_charstrings)
<op_callothersubr>: Reject negative arguments.
2011-07-08 13:46:42 +02:00
Werner Lemberg 9b00875093 Fix Savannah bug #33047.
Patch submitted by anonymous reporter.

* src/psaux/psobjs.c (ps_table_add): Use FT_PtrDist for pointer
difference.
2011-04-13 13:37:37 +02:00
John Tytgat ed7d1a59ff * src/psaux/t1decode.c (t1_decoder_parse_charstring): Expand
start_point, check_points, add_point, add_point1, close_contour
macros.
Remove add_contour macro.
Return error code from t1_builder_start_point and
t1_builder_check_points when there was one (instead of returning 0).
2010-11-23 19:30:38 +01:00
Werner Lemberg c8f5b98be2 Remove C++ warnings.
*/*: Initialize pointers where necessary to make g++ happy.
2010-07-12 21:13:22 +02:00
Werner Lemberg 90b07bd541 Fix Savannah bug #30145.
* src/psaux/psobjs.c (t1_builder_add_contour): Protect against
`outline == NULL' which might happen in invalid fonts.
2010-06-20 16:27:36 +02:00
Werner Lemberg 370aea802c Formatting. 2010-06-08 08:37:11 +02:00
Werner Lemberg 30b8480bbb Whitespace. 2010-05-11 00:06:02 +02:00
Ken Sharp 88169b107a Fix Savannah bug #29846.
Previously we discovered fonts which used `setcurrentpoint' to set
the initial point of a contour to 0,0.  This caused FreeType to
raise an error, because the `setcurrentpoint' operator is only
supposed to be used with the results from an OtherSubr subroutine.

This was fixed by simply ignoring the error and carrying on.

Now we have found a font which uses setcurrentpoint to actually
establish a non-zero point for a contour during the course of a
glyph program.  FWIW, these files may be produced by an application
called `Intaglio' on the Mac, when converting TrueType fonts to
Type 1.

The fix allows the new invalid behaviour, the old invalid behaviour
and real proper usage of the operator to work the same way as Adobe
interpreters apparently do.

(t1_decoder_parse_charstrings): Make `setcurrentpoint' use the top
two elements of the stack to establish unconditionally the current x
and y coordinates.

Make the `flex' subroutine handling (OtherSubr 0) put the current
x,y coordinates onto the stack, instead of two dummy uninitialised
values.
2010-05-11 00:03:33 +02:00
Ken Sharp 54e63755f3 Fix Savannah bug #29444.
* src/psaux/psobjs.c (t1_builder_start_point): Accept (invalid)
`lineto' immediately after `hsbw', in accordance with Acrobat, GS,
and others.
2010-04-14 23:38:35 +02:00
Ken Sharp 8ea31415f4 Fix Savannah bug #28521.
Issue #28226 involved a work-around for a font which used the
`setcurrentpoint' operator in an invalid way; this operator is only
supposed to be used with the result of OtherSubrs, and the font used
it directly.  The supplied patch removed the block of code which
checked this usage entirely.

This turns out to be a Bad Thing.  If `setcurrentpoint' is being
used correctly it should reset the flex flag in the decoder.  If we
don't do this then the flag never gets reset and we omit any further
contours from the glyph (at least until we close the path or
similar).

* src/psaux/t1decode.c (t1_decoder_parse_charstrings)
<op_setcurrentpoint>: Handle `flex_state' correctly.
2010-01-08 18:13:02 +01:00
Werner Lemberg fe6da50d04 Thinkos. 2010-01-05 10:10:15 +01:00
Ken Sharp dbe5622335 Make Type 1 `seac' operator work with incremental interface.
* src/psaux/t1decode.c (t1operator_seac): Don't check `glyph_names'
if incremental interface is used.
2010-01-05 09:43:01 +01:00
Ken Sharp ce41259372 Ignore invalid `setcurrentpoint' operations in Type 1 fonts.
This fixes Savannah bug #28226.

At least two wild PostScript files of unknown provenance contain
Type 1 fonts, apparently converted from TrueType fonts in earlier
PDF versions of the files, which use the `setcurrentpoint' operator
inappropriately.

FreeType currently throws an error in this case, but Ghostscript and
Adobe Distiller both accept the fonts and ignore the problem.  This
commit #ifdefs out the check so PostScript interpreters using
FreeType can render these files.

The specification says `setcurrentpoint' should only be used to set
the point after a `Subr' call, but these fonts use it to set the
initial point to (0,0).  Unnecessarily so, as they correctly use an
`hsbw' operation which implicitly sets the initial point.
2009-12-14 22:32:32 +01:00
suzuki toshiya f2647ddabb [cache, psaux, type1] Fix for multi build. 2009-09-26 00:48:37 +09:00
suzuki toshiya 0729bc9f52 [Win64] Improve the computation of random seed from stack address. 2009-09-10 16:09:55 +09:00
John Tytgat 03e8b2f763 Fix custom cmap for empty Type 1 font (Savannah bug #27294).
* include/freetype/internal/t1types.h (T1_EncodingRecRec_): Update
comment to reflect revised code_last meaning.
* src/type1/t1load.c (T1_Open_Face), src/type42/t42objs.c
(T42_Open_Face): Assign max_char as highest character code + 1 and
use this for T1_EncodingRecRec_::code_last.
* src/psaux/t1cmap.c (t1_cmap_custom_init): Follow revised
T1_EncodingRecRec_::code_last meaning.
2009-09-01 08:10:24 +02:00
suzuki toshiya e6d0c1fb9c psaux: Fix a few casts to FT_Int32 value. 2009-08-01 00:37:58 +09:00
suzuki toshiya 259568cf68 psaux: Handle the string length by FT_Offset variables. 2009-08-01 00:32:13 +09:00
suzuki toshiya 3f0f2e462b XXX_cmap_encoding_char_next() return FT_UInt32 values. 2009-08-01 00:32:09 +09:00
suzuki toshiya d3ed6d1bba psaux: Prevent invalid arguments to afm_parser_read_vals(). 2009-08-01 00:30:43 +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
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 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 e15d9c52bc Formatting etc. 2009-06-25 21:31:53 +02:00
Werner Lemberg 1e8bf5831a Thinko. 2009-06-23 15:48:52 +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 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 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
Ralph Giles 04a7858c61 Make `seac' operator work correctly with incremental interface.
SEAC (Single Encoding Accented Characters) are composed of (basically) two
indices specifying two other glyphs, and a movement to position the accent
properly with respect to the main glyph.

To make it work with the incremental interface we now demand that the caller
handles the encoding by itself.
2009-04-30 20:32:31 +02:00
Oran Agra 1dcd0f2399 Add #error to modules and files that do not support PIC yet.
When FT_CONFIG_OPTION_PIC is defined the following files will
create #error:
* src/bdf/bdfdrivr.h
* src/cache/ftcmanag.c
* src/cid/cidriver.h
* src/gxvalid/gxvmod.h
* src/gzip/ftgzip.c
* src/lzw/ftlzw.c
* src/otvalid/otvmod.h
* src/pcf/pcfdrivr.h
* src/pfr/pfrdrivr.h
* src/psaux/psauxmod.h
* src/type1/t1driver.h
* src/type42/t42drivr.h
* src/winfonts/winfnt.h
2009-04-05 18:25:14 +03: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 e85baf4f8e Fix stdlib dependencies.
Problem reported by Mickey Gabel <mickey@monfort.co.il>.

* include/freetype/config/ftstdlib.h (ft_exit): Removed.  Unused.

* src/autofit/afhints.c, src/base/ftlcdfil.c, src/smooth/ftsmooth.c:
s/memcpy/ft_memcpy/.
* src/psaux/t1decode.c: s/memset/ft_memset/, s/memcpy/ft_memcpy/.
2009-01-12 20:01:10 +00:00
Werner Lemberg 9d83d29028 Fix problem with T1_FIELD_{NUM,FIXED}_TABLE2.
* src/psaux/psobjs.c (ps_parser_load_field_table): Don't handle
`count_offset' if it is zero (i.e., unused).  Otherwise, the first
element of the structure which holds the data is erroneously
modified.  Problem reported by Chi Nguyen <chint@necsv.com>.
2009-01-09 07:58:08 +00:00
Werner Lemberg ce33a312da 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.
2008-12-21 10:29:30 +00:00
Werner Lemberg 52cd0fc8b9 Fixes from the gnuwin32 port.
* src/base/ftlcdfil.c: s/EXPORT/EXPORT_DEF/.

* src/base/ftotval.c: Include FT_OPENTYPE_VALIDATE_H.

* src/psaux/psobjs.c (ps_table_add): Check `length'.
2008-11-24 08:15:05 +00:00
Werner Lemberg e0ed07d767 * src/type1/t1load.c (parse_subrs): Use an endless loop. There are
fonts (like HELVI.PFB version 003.001, used on OS/2) which define
some `subrs' elements more than once.  Problem reported by Peter
Weilbacher <mozilla@weilbacher.org>.
2008-11-04 10:37:30 +00:00
Werner Lemberg a4cb0d95d9 * src/type/t1afm.c (compare_kern_pairs), src/pxaux/afmparse.c
(afm_compare_kern_pairs): Fix comparison.  This fixes Savannah bug
#24119.
2008-08-23 19:54:06 +00:00
Werner Lemberg 5563bea093 * src/psaux/psobjs.c (t1_builder_close_contour): Don't add contour
if it consists of one point only.  Based on a patch from Savannah
bug #23683 (from John Tytgat).
2008-06-24 05:44:28 +00:00
Werner Lemberg 7cb9ec0f1c * src/type1/t1parse.h (T1_ParserRec): Make `base_len' and
`private_len' unsigned.

* src/type1/t1parse.c (read_pfb_tag): Make `asize' unsigned and read
it as such.
(T1_New_Parser, T1_Get_Private_Dict): Make `size' unsigned.


* src/base/ftstream.c (FT_Stream_Skip): Reject negative values.


* src/type1/t1load.c (parse_blend_design_positions): Check `n_axis'
for sane value.
Fix typo.


* src/psaux/psobjs.c (ps_table_add): Check `idx' correctly.


* src/truetype/ttinterp (Ins_SHC): Use BOUNDS() to check
`last_point'.


* src/sfnt/ttload.c (tt_face_load_max_profile): Limit
`maxTwilightPoints'.
2008-06-09 20:49:29 +00:00
Werner Lemberg bcc750e511 * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
<op_closepath>: `closepath' without a path is a no-op, not an error
(cf. the PS reference manual).

Reported by Martin McBride.
2008-05-16 04:50:00 +00:00
Werner Lemberg de9479a00d * include/freetype/internal/psaux.h (T1_BuilderRec): Mark `scale_x'
and `scale_y' as obsolete since they aren't used.
* src/psaux/psobjs.c (t1_builder_init): Updated.

* src/cff/cffgload.h (CFF_Builder): Mark `scale_x' and `scale_y' as
obsolete since they aren't used.
* src/cff/cffgload.c (cff_builder_init): Updated.
2008-04-26 12:52:57 +00:00
Werner Lemberg 048b756389 * src/psaux/psconv.c (PS_Conv_ToFixed): Increase precision if
integer part is zero.
2008-04-13 05:55:36 +00:00
Werner Lemberg 9a966b7d1b Add support for cmap type 14.
* devel/ftoption.h, include/freetype/config/ftoption.h
(TT_CONFIG_CMAP_FORMAT_14): New macro.

* include/freetype/internal/ftobjs.h (FT_CMap_CharVarIndexFunc,
FT_CMap_CharVarIsDefaultFunc, FT_CMap_VariantListFunc,
FT_CMap_CharVariantListFunc, FT_CMap_VariantCharListFunc): New
support function prototypes.
(FT_CMap_ClassRec): Add them.
Update all users.

* include/freetype/ttnameid.h (TT_APPLE_ID_VARIANT_SELECTOR): New
macro.

* include/freetype/freetype.h (FT_Get_Char_Variant_Index,
FT_Get_Char_Variant_IsDefault, FT_Get_Variant_Selectors,
FT_Get_Variants_Of_Char, FT_Get_Chars_Of_Variant): New API
functions.

* src/base/ftobjs.c (find_variant_selector_charmap): New auxiliary
function.
(FT_Set_Charmap): Disallow cmaps of type 14.
(FT_Get_Char_Variant_Index, FT_Get_Char_Variant_IsDefault,
FT_Get_Variant_Selectors, FT_Get_Variants_Of_Char,
FT_Get_Chars_Of_Variant): New API functions.

* src/sfnt/ttcmap.c (TT_PEEK_UINT24, TT_NEXT_UINT24): New macros.

(TT_CMap14Rec, tt_cmap14_init, tt_cmap14_validate,
tt_cmap14_char_index, tt_cmap14_char_next, tt_cmap14_get_info,
tt_cmap14_char_map_def_binary, tt_cmap14_char_map_nondef_binary,
tt_cmap14_find_variant, tt_cmap14_char_var_index,
tt_cmap14_char_var_isdefault, tt_cmap14_variants,
tt_cmap14_char_variants, tt_cmap14_def_char_count,
tt_cmap14_get_def_chars, tt_cmap14_get_nondef_chars,
tt_cmap14_variant_chars, tt_cmap14_class_rec): New functions and
structures for cmap 14 support.
(tt_cmap_classes): Register tt_cmap14_class_rec.
(tt_face_build_cmaps): One more error message.

* docs/CHANGES: Mention cmap 14 support.
2007-10-15 17:21:32 +00:00
Werner Lemberg f9fa1c8b77 * src/psaux/psobjs.c (ps_parser_skip_PS_token): Remove incorrect
assertion.
(ps_parser_to_bytes): Fix error message.

* src/type42/t42objs.c (T42_Open_Face): Handle one more error
return.
* src/type42/t42parse.c (t42_parse_sfnts): s/alloc/allocated/.
Don't allow mixed binary and hex strings.
Handle zero string_size == 0 and string_buf == 0.
2007-06-18 17:00:05 +00:00
Werner Lemberg f48aec7b1e * src/psaux/psobjs.c (ps_tofixedarray, ps_tocoordarray): Fix exit
logic.
(ps_parser_load_field) <T1_FIELD_TYPE_BBOX>: Skip delimiters
correctly.
(ps_parser_load_field_table): Use `fields->array_max' instead of
T1_MAX_TABLE_ELEMENTS to limit the number of arguments.
2007-06-18 07:07:55 +00:00
Werner Lemberg 33db39e292 * src/sfnt/sfobjs.c (sfnt_load_face): Undo change from 2007-04-28.
Fonts without a cmap must be handled correctly by FreeType (anything
else would be a bug).


* src/psaux/t1decode.c (t1_decoder_parse_charstrings)
[FT_DEBUG_LEVEL_TRACE]: Improve tracing message.
2007-06-08 06:30:29 +00:00
Werner Lemberg e5c14d93b8 * src/psaux/psobjs.c (ps_tocoordarray, ps_tofixedarray): Return -1
in case of parsing error.
(ps_parser_load_field): Updated.

* src/type1/t1load.c (parse_font_matrix): Updated.
2007-06-05 20:50:37 +00:00
Werner Lemberg 607dec79bb * src/autofit/afcjk.c (af_cjk_hints_compute_edges): Remove unused
variable.
* src/autofit/afloader.c (af_loader_load_g): Ditto.

* src/base/ftobjs.c (ft_validator_error): Use `ft_jmp_buf'.
(open_face_from_buffer): Initialize `stream'.
(FT_Request_Metrics): Remove unused variable.
Remove redundant `break' statements.
(FT_Get_Track_Kerning): Remove unused variable.

* src/psaux/afmparse.c (afm_parse_track_kern, afm_parse_kern_pairs,
afm_parse_kern_data): Remove redundant
`break' statements.
(afm_parser_parse): Ditto.
Don't use uninitialized variables.

* src/psnames/psmodule.c (VARIANT_BIT): Define as unsigned long.
Use `|' operator instead of `^' to set it.
Update all users.

* src/sfnt/ttcmap.c (tt_face_build_cmaps): Use `ft_jmp_buf'.
* src/sfnt/ttkern.c (tt_face_load_kern): Remove unused variable.

* src/truetype/ttgload.c (TT_Load_Simple_Glyph): Remove redundant
comparison.
(TT_Process_Simple_Glyph): Use FT_UInt for `n_points' and `i'.
(TT_Load_Glyph): Remove unused variable.
2007-05-15 06:49:37 +00:00
Werner Lemberg 6e87ed9f04 Spelling fixes from Alexei. 2007-01-26 22:18:56 +00:00
Werner Lemberg 9b774e2822 Remove trailing whitespace. From Alexei. 2007-01-16 06:11:27 +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 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 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 e9a746674a Fix handling of self-delimiting tokens. 2006-06-26 17:37:44 +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
Werner Lemberg 4836f955f3 formatting 2006-06-06 12:54:08 +00:00
David Turner 457b4a81a1 * include/freetype/internal/services/svpscmap.h, src/cff/cffcmap.c,
src/psaux/t1cmap.c, src/psnames/psmodule.c: Fix for the memory
        leak described in bug #16759.

        We change 'ps_unicodes_init' so that it also takes a 'free_glyph_name'
        callback to release the glyph names returned by 'get_glyph_name'
2006-06-06 08:14:14 +00:00
Werner Lemberg 545c4e566e * src/truetype/ttgload.c (TT_Load_Composite_Glyph)
[FT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Make it compilable again.


Formatting, documentation fixes.
2006-05-17 22:55:04 +00:00
David Turner 281679de85 * include/freetype/internal/tttypes.h, src/autofit/afangles.c,
src/autofit/afcjk.c, src/autofit/afhints.c, src/autofit/aflatin.c,
        src/autofit/aftypes.h, src/base/ftcalc.c, src/base/ftoutln.c,
        src/gzip/ftgzip.c, src/psaux/psconv.c, src/truetype/ttgload.c,
        src/type1/t1gload.c:

          this is a major patch used to drastically improve the performance
          of loading glyphs. This both speeds up loading the glypn vector
          themselves and the auto-fitter.

          note that we've started using inline assembler with GCC to
          implement FT_MulFix, given that this function is so damn
          important for the engine's performance.

          the resulting speed-up is about 25%.
2006-05-17 13:34:21 +00:00
Werner Lemberg 564b4432ca * src/psaux/psobjs.c (shift_elements): Don't use FT_Long but
FT_PtrDiff for `delta'.  Reported by Cline PILLET
<Celine.Pillet@Tagginfo.com>.
2006-04-26 15:02:52 +00:00
Detlef Würkner d51b41e085 no message 2006-03-29 06:35:26 +00:00
David Turner de271ab8f0 * builds/unix/ftsystem.c, include/freetype/config/ftheader.h,
include/freetype/internal/services/svotval.h,
    include/freetype/internal/services/svpfr.h,
    src/base/ftsystem.c, src/bdf/bdfdrivr.c, src/cache/ftcbasic.c,
    src/cff/cffcmap.c, src/gzip/ftgzip.c, src/lzw/ftlzw.c,
    src/lzw/ftlzw2.c, src/psaux/t1cmap.c, src/sfnt/ttbdf.c,
    src/smooth/ftgrays.c:

       solved -Wmissing-prototypes warnings with GCC
2006-02-25 14:53:02 +00:00
David Turner 6c71c6b968 * include/freetype/config/ftoption.h, src/autofit/afcjk.c,
src/base/ftobjs.c, src/base/ftutil.c, src/cff/cffobjs.c,
    src/psaux/afmparse.c, src/sfnt/ttbdf.c, src/tools/apinames.c,
    src/truetype/ttdriver.c:

       solved compiler warnings as well as C++ compilation problems
2006-02-25 12:49:40 +00:00
David Turner cda2d957dc * builds/amiga/src/base/ftsystem.c, devel/ftoption.h
include/freetype/ftcache.h, include/freetype/ftoutln.h,
      include/freetype/cache/ftccache.h, include/freetype/cache/ftccmap.h,
      include/freetype/config/ftoption.h, include/freetype/internal/ftcalc.h,
      include/freetype/internal/ftdriver.h,
      include/freetype/internal/ftmemory.h,
      include/freetype/internal/ftobjs.h, include/freetype/internal/ftrfork.h,
      include/freetype/internal/psaux.h, include/freetype/internal/sfnt.h,
      include/freetype/internal/t1types.h, include/freetype/internal/tttypes.h,
      src/base/ftcalc.c, src/base/ftdbgmem.c, src/base/ftobjs.c,
      src/base/ftsystem.c, src/base/ftutil.c, src/bdf/bdfdrivr.c,
      src/cache/ftccache.c, src/cache/ftccback.h, src/cache/ftccmap.c,
      src/cache/ftcmanag.c, src/cff/cffdrivr.c, src/cid/cidriver.c,
      src/pcf/pcfdrivr.c, src/pfr/pfrdrivr.c, src/psaux/psauxmod.c,
      src/sfnt/sfdriver.c, src/truetype/ttdriver.c, src/type1/t1driver.c,
      src/type1/t1objs.c, src/type42/t42drivr.c, src/winfonts/winfnt.c:

    massive changes to the internals to respect the internal object layouts
    and exported functions of FreeType 2.1.7. Note that the cache sub-system
    cannot be fully retrofitted, unfortunately.
2006-02-16 22:45:31 +00:00
Werner Lemberg 59939244ad Implement new, simplified module selection. With GNU make it is now
sufficient to modify a single file, `modules.cfg', to control the
inclusion of modules and base extension files.

This change also fixes the creation of ftmodule.h; it now depends on
`modules.cfg' and thus is rebuilt only if necessary.

Finally, a version of `ftoption.h' in OBJ_DIR is preferred over the
default location.

* modules.cfg: New file.

* builds/freetype.mk: Don't include `modules.mk'.
Include all `rules.mk' files as specified in `modules.cfg'.
(FTOPTION_FLAG, FTOPTION_H): New variables.
(FT_CFLAGS): Add macro definition for FT_CONFIG_MODULES_H.
Add FTOPTION_FLAG.
($(FT_INIT_OBJ)): Don't use FT_MODULE_LIST.
(CONFIG_H): Add FTMODULE_H and FTOPTION_H.
(INCLUDES): Add DEVEL_DIR.
(INCLUDE_FLAGS, FTSYS_SRC, FTSYS_OBJ, FTDEBUG_SRC, FTDEBUG_OBJ,
OBJ_M, OBJ_S): Use `:=', not `='.
(remove_ftmodule_h): New phony target to delete `ftmodule.h'.
(distclean): Add remove_ftmodule_h.

* builds/modules.mk: (MODULE_LIST): Removed.
(make_module_list, clean_module_list): Replace targets
with...
(FTMODULE_H_INIT, FTMODULE_H_CREATE, FTMODULE_H_DONE): New
variables.  Reason for the change is that it is not possible to have
a phony prerequisite which is run only if the target file must be
rebuilt (phony prerequisites act like subroutines and are *always*
executed).  We only want to rebuild `ftmodule.h' if `module.cfg' is
changed.
Update all callers.
($FTMODULE_H)): Rule to create `ftmodule.h', depending on
`modules.cfg'.

* builds/toplevel.mk: Rewrite and simplify module handling.
(MODULES_CFG, FTMODULE_H): New variables.
Include MODULES_CFG.
(MODULES): New variable to include all `module.mk' and `rules.mk'
files.  We no longer use make's `wildcard' function for this.

* Makefile (USE_MODULES): Remove.  Update all users.
(OBJ_DIR): Define it here.

* src/*/module.mk: Change

    make_module_list: foo
    foo: ...

to

    FTMODULE_H_COMMANDS += FOO
    define FOO
    ...
    endef

in all files.  `FTMODULE_H_COMMANDS' is used in `FTMODULE_H_CREATE'.

* src/base/rules.mk (BASE_EXT_SRC): Use BASE_EXTENSIONS.

* builds/unix/detect.mk (setup): Always execute `configure' script.
(have_mk): Rename to...
(have_Makefile): This.
Don't use `strip' function.

* builds/unix/unix.mk: Include `install.mk' only if BUILD_PROJECT is
defined.
(have_mk): Don't use `strip' function.
Test for unix-def.mk in OBJ_DIR, not BUILD_DIR (and invert the test
accordingly).

* builds/unix/install.mk (install, uninstall): Handle `ftmodule.h'.

* builds/os2/os2-dev.mk, builds/unix/unix-dev.mk,
builds/win32/w32-bccd.mk, builds/win32/w32-dev.mk: Don't define
BUILD_DIR but DEVEL_DIR for development header files.

* builds/ansi/ansi-def.mk (TOP_DIR, OBJ_DIR),
builds/beos/beos-def.mk (TOP_DIR, OBJ_DIR), builds/unix/unix-def.in
(TOP_DIR, OBJ_DIR): Removed.  Defined elsewhere.

* builds/dos/dos-def.mk (OBJ_DIR), builds/os2/os2-def.mk (OBJ_DIR),
builds/win32/win32-def.mk (OBJ_DIR): Removed.  Defined elsewhere.

* builds/unix/unixddef.mk: Don't define BUILD_DIR but DEVEL_DIR for
development header files.
Don't define PLATFORM.

* configure: Copy `modules.cfg' to builddir if builddir != srcdir.
Update snippet taken from autoconf's m4sh.m4 to current CVS version.
Be more verbose.

* include/freetype/config/ftmodule.h: Add comments -- this file is
no longer used if FreeType is built with GNU make.

* docs/CHANGES, docs/CUSTOMIZE, docs/INSTALL, docs/INSTALL.ANY,
docs/INSTALL.GNU, docs/INSTALL.UNX: Document new build mechanism.
Other minor updates.

* modules.txt: Removed.  Contents included in `modules.cfg'.


* include/freetype/internal/ftmemory.h (FT_QAlloc_Debug,
FT_Free_Debug) [FT_STRICT_ALIASING]: Fix typos.

* src/base/ftdbgmem.c (FT_Alloc_Debug, FT_Realloc_Debug,
FT_QAlloc_Debug, FT_QRealloc_Debug, FT_Free_Debug)
[FT_STRICT_ALIASING]: Implement.
2006-01-31 20:17:42 +00:00
Wu, Chia-I (吳佳一) 98d802b83a * include/freetype/internal/t1types.h (AFM_FontInfo),
src/psaux/afmparse.c, src/tools/test_afm.c: Read `FontBBox',
`Ascender', and `Descender' from an AFM.

* src/type1/t1afm.c (T1_Read_Metrics): Use the metrics from the AFM.

* include/freetype/freetype.h (FT_FaceRec): Mention that fields may be
changed after file attachment.
2006-01-31 07:01:24 +00:00
Werner Lemberg 7596fd3a46 * src/*/module.mk (.PHONY): Add. 2006-01-28 16:29:29 +00:00
Werner Lemberg be3c9814a4 Formatting, copyright years. 2006-01-27 14:16:16 +00:00
David Turner 6a681fa84a * src/autofit/afwarp.c: simple #ifdef to prevent compilation when
the warp hinter isn't active (it shouldn't, still experimental)

    * Jamfile, include/freetype/config/ftmodule.h: removed "gxvalid"
    and "otvalid" from the list of modules that are linked statically
    to a given FreeType library. Functionality has been moved to the
    "ftvalid" CVS module.

    note also that current Make-based build system still compiles the
    modules though...

    * include/freetype/config/ftoption.h: added FT_STRICT_ALIASING,
    which controls the definitions of the memory management functions
    to avoid warnings with recent versions of GCC. this macro is
    only here to be disabled, in case we detect problems with the
    new scheme.

    NOTE: disable macro to use the memory debugger. this will be fixed
          later !!
2006-01-27 12:11:22 +00:00
Werner Lemberg 9cc4aed879 Formatting. 2006-01-26 21:03:58 +00:00
Wu, Chia-I (吳佳一) bcc438b15e * include/freetype/freetype.h (FT_Select_Size): Rename the second
argument from `idx' to `strike_index'.
(FT_Size_Request_Type): Add FT_SIZE_REQUEST_TYPE_MAX to the end of
this enum.

* include/freetype/internal/ftobjs.h (FT_REQUEST_WIDTH,
FT_REQUEST_HEIGHT): New macros to get the width and height of a
request, in fractional pixels.

* include/freetype/internal/ftobjs.h (FT_Select_Metrics,
FT_Request_Metrics), src/base/ftobjs.c (FT_Select_Metrics,
FT_Request_Metrics): New base functions to set the font metrics.  They
were part of FT_Select_Size/FT_Request_Size and are made independent
functions so that metrics are not set again and again.

* src/base/ftobjs.c (FT_Select_Size, FT_Request_Size): Metrics are set
only when driver's size_select/size_request is NULL.  That is, drivers
should set the metrics themselves.
(FT_Match_Size): Round before matching.  This was what we did and it
does cause some problems without rounding.

* src/cff/cffobjs.c (cff_size_select), src/truetype/ttdriver.c
(tt_size_select): Set the font metrics.
s/index/strike_index/.
The scaled metrics are always preferred over strikes' metrics, even
when some strike is selected.  This is done because the strikes'
metrics are not reliable, e.g., the sign of the descender is wrong for
some fonts.

* src/cff/cffobjs.c (cff_size_request), src/truetype/ttdriver.c
(tt_size_request): Set the font metrics.
Call cff_size_select/tt_size_select when some strike is matched.

* src/bdf/bdfdrivr.c, src/cff/cffobjs.c, src/cid/cidobjs.c,
src/pcf/pcfdrivr.c, src/truetype/ttdriver.c, src/type1/t1objs.c,
src/type1/t1objs.h, src/type42/t42objs.c, src/winfonts/winfnt.c:
Set the font metrics.
s/index/strike_index/.

* src/tools/test_afm.c, src/psaux/psconv.c: Older versions of these
files were committed.  Just a catch-up.
(PS_Conv_ToFixed): Remove the `goto'.
(PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Speed up a little.

* src/sfnt/ttsbit.c (tt_face_load_sbit_strikes,
tt_face_load_strike_metrics), src/sfnt/ttsbit0.c
(tt_face_load_sbit_strikes, tt_face_load_strike_metrics): The
advertised metrics in `available_sizes' are different from those
actually used.
2006-01-23 14:12:40 +00:00
Wu, Chia-I (吳佳一) 4c6234d963 * src/psaux/psaux.c src/psaux/psauxmod.c src/type1/t1driver.c: Make
AFM parser optional, controlled by `T1_CONFIG_OPTION_NO_AFM'.
2006-01-23 10:46:38 +00:00
Werner Lemberg 47bf95dd70 Use pscmap service in CFF module.
* src/cff/cffcmap.c (cff_cmap_uni_pair_compare): Removed.
(cff_sid_to_glyph_name): New function.
(cff_cmap_unicode_init, cff_cmap_unicode_done,
cff_cmap_unicode_char_index, cff_cmap_unicode_char next): Use pscmap
service.
(cff_cmap_unicode_class_rec): Updated.
* src/cff/cffcmap.h (CFF_CMapUnicode, CFF_CMap_UniPair): Removed.


* src/psnames/psmodule.c (ps_unicodes_char_next): Fix `unicode'
return value.


* src/psaux/afmparse.c (afm_parser_read_vals): Use double casting
to avoid type-punning compiler warnings.
2006-01-17 16:55:32 +00:00
Werner Lemberg ce94c7a9aa Formatting, copyright years. 2006-01-16 22:35:33 +00:00
Wu, Chia-I (吳佳一) 108fdbbbd3 * src/psaux/afmparse.c, src/psaux/afmparse.h: New files which
implement an AFM parser.  It is used to parse an AFM file.

* src/psaux/psconv.c, src/psaux/psconv.h: New files to provide
conversion functions (e.g, PS real number => FT_Fixed) for the
PS_Parser and AFM_Parser.  Some of the functions are taken, with some
modifications, from the psobjs.c

* src/psaux/psobjs.c: Use functions from psconv.c.

* include/freetype/internal/psaux.h, src/psaux/psauxmod.c:: Add
`AFM_Parser' to the `psaux' service.

* src/psaux/psaux.c, src/psaux/rules.mk: Include those new files.

* src/tools/test_afm.c: A test program for AFM parser.

* include/freetype/internal/services/svkern.h,
include/freetype/internal/ftserv.h: New service `Kerning'.  It is
currently only used to get the track kerning information.

* src/type1/t1driver.c, src/type1/t1objs.c, src/type1/t1afm.c,
src/type1/t1afm.h: Update to use the AFM parser.
Provide the `Kerning' service.

* include/freetype/freetype.h, src/base/ftobjs.c: New API
`FT_Get_Track_Kerning'.
2006-01-16 15:35:56 +00:00
Werner Lemberg 8ab0979d6e Prepare use of pscmap service within CFF module.
* include/freetype/internal/services/svpscmap.h: Include
FT_INTERNAL_OBJECTS_H.
(PS_Unicode_Index_Func): Removed.  Unused.
(PS_Macintosh_Name_Func): Renamed to...
(PS_Macintosh_NameFunc): This.
Update all callers.
(PS_Adobe_Std_Strings_Func): Renamed to...
(PS_Adobe_Std_StringsFunc): This.
Update all callers.
(PS_UnicodesRec): This is the former `PS_Unicodes' structure.
Add `cmap' member.
Update all callers.
(PS_Unicodes): This is now a typedef'd pointer to PS_UnicodesRec.
Update all callers.
(PS_Glyph_NameFunc): New typedef.
(PS_Unicodes_InitFunc): Change arguments to expect a function
and generic data pointer which returns a glyph name from a given
index.

* src/psnames/psmodule.c (ps_unicodes_init, ps_unicodes_char_index,
ps_unicodes_char_next, pscmaps_interface): Updated.

* include/freetype/internal/t1types.h (T1_FaceRec): Updated.

* src/psaux/t1cmap.h (T1_CmapStdRec): Updated.
(T1_CmapUnicode, T1_CmapUnicodeRec): Removed.

* src/psaux/t1cmap.c (t1_get_glyph_name): New callback function.
(t1_cmap_unicode_init, t1_cmap_unicode_done,
t1_cmap_unicode_char_index, t1_cmap_unicode_char_next,
t1_cmap_unicode_class_rec): Updated.

* src/type42/t42types.h (T42_FaceRec): Updated.
2006-01-12 08:12:27 +00:00
Werner Lemberg adf828ff95 Fix Savannah bug #15056 and use pscmap service in psaux module.
* include/freetype/internal/services/svpscmap.h (PS_UniMap): Use
FT_UInt32 for `glyph_index'.
(PS_Unicodes_InitFunc): Use FT_String for `glyph_names'.
(PS_Unicodes_CharIndexFunc): Use FT_UInt32 for `unicode'.
(PS_Unicodes_CharNextFunc): Make second argument a pointer to
FT_UInt32.

* src/psnames/psmodule.c (VARIANT_BIT, BASE_GLYPH): New macros.
(ps_unicode_value): Set VARIANT_BIT in return value if glyph is a
variant glyph (this is, it has non-leading `.' in its name).
(compare_uni_maps): Sort base glyphs before variant glyphs.
(ps_unicodes_init): Use FT_String for `glyph_names' argument.
Reallocate only if number of used entries is much smaller.
Updated to handle variant glyphs.
(ps_unicodes_char_index, ps_unicodes_char_next): Prefer base glyphs
over variant glyphs.
Simplify code.

* src/psaux/t1cmap.c (t1_cmap_uni_pair_compare): Removed.
(t1_cmap_unicode_init, t1_cmap_unicode_char_index,
t1_cmap_unicode_char_next): Use pscmap service.
(t1_cmap_unicode_done): Updated.

* src/psaux/t1cmap.h (T1_CMapUniPair): Removed.
(T1_CMapUnicode): Use PS_Unicodes structure.
2006-01-11 10:08:49 +00:00
David Turner 9fbd2ab884 - various performance enhancements
- fixing apinames.c, adding support for Watcom and Borland compilers
- adding generation of exported symbols list to the build system, including the Unix one !!

sorry Werner, I have no time to document this in ChangeLog at the moment
2005-10-28 16:14:14 +00:00
Werner Lemberg da245ee30a Forgot to check in last change. 2005-08-18 07:40:32 +00:00
Werner Lemberg 60a04df7b0 Add license. 2005-06-04 23:04:30 +00:00
Werner Lemberg 1d565fb01b * src/type1/t1load.c (read_binary_data): Return more meaningful
value.
(parse_encoding, parse_subrs, parse_charstrings, parse_dict): Check
parser error value after call to T1_Skip_PS_Token (where necessary).

* src/type1/t1parse.c (T1_Get_Private_Dict): Check parser error
value after call to T1_Skip_PS_Token.

* src/cid/cidparse.c (cid_parser_new): Check parser error value
after call to cid_parser_skip_PS_token.

* src/type42/t42parse.c (t42_parse_encoding, t42_parse_sfnts,
t42_parse_charstrings, t42_parse_dict): Check parser error value
after call to T1_Skip_PS_Token (where necessary).

* src/psaux/psobjc.c (skip_string, ps_parser_skip_PS_token,
ps_tobytes): Add error messages.
2005-02-13 21:42:42 +00:00
Werner Lemberg c9114b9926 * builds/unix/freetype-config.in: Add new flag `--ftversion' to
return the FreeType version.  Suggested by George Williams
<gww@silcom.com>.


* docs/CHANGES: Updated.


* src/otvalid/otvmod.c (otv_validate): Deallocate arrays in case
of error.  Reported by YAMANO-UCHI Hidetoshi <mer@din.or.jp>.


* src/psaux/t1decode.c (t1_decoder_parse_charstrings)
<op_closepath>: Accept `T1_Parse_Have_Moveto' state also which can
happen in empty glyphs.  Reported by Ian Brown
<ian.brown@printsoft.de>.
2005-02-10 08:18:27 +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 efd4e87778 * include/freetype/internal/psaux.h (T1_ParseState): New
enumeration.
(T1_BuilderRec): Replace `path_begun' with `parse_state'.
Remove `error'.
* src/psaux/t1decode.c (t1_decoder_parse_charstrings): Replace
`Memory_Error' with `Fail' and update all users.
Don't use `builder->error'.
Replace `path_begun' with `parse_state' and check parsing states.

* src/psaux/psobjs.c (t1_builder_init, t1_builder_start_point):
Replace `path_begun' with `parse_state' and check parsing states.
2004-05-13 12:59:59 +00:00
Werner Lemberg 2b32a177f3 * src/cff/cffparse.c (cff_parser_run), src/psaux/psobjs.c
(ps_parser_load_field): Use FT_CHAR_BIT.
2004-04-24 06:06:39 +00:00
Werner Lemberg 07dcc10170 formatting, doc improvements 2004-04-21 22:27:11 +00:00
David Turner 10bf05a31d * src/cff/cffobjs.c (cff_face_init): fixed a small memory leak
* src/autofit/afloader.c, src/autofit/afmodule.c, src/base/ftdebug.c:
        removed compiler warnings

        * src/autofit/aftypes.h, src/lzw/zopen.c, src/pcf/pcfdrivr.c,
        src/pcf/pcfread.c, src/psaux/psobjs.c, src/type42/t42drivr.c:
        changed data arrays to "const" to avoid populating the ".data"
        segment
2004-04-21 14:30:37 +00:00
Werner Lemberg c78df1ef6e * src/psaux/psobjs.c (T1Radix): Renamed to...
(ps_radix): This.
Update current cursor position.

* docs/CHANGES: Updated.
2004-04-21 07:36:38 +00:00
Werner Lemberg 95867077e8 * src/cid/cidload.c (cid_face_open): Always allocate
face->cid_stream so that we can deallocate it safely.


Make the PS parser more tolerant w.r.t. non-standard font data.  In
general, an error is only reported in case of a syntax error; a
wrong type is now simply ignored (if possible).  To be independent
of the order of various MM-specific keywords, the parse_shared_dict
routine has been removed -- the PS parser is now capable to skip
this data.  It no longer fails on parsing e.g.

  dup /WeightVector exch def

Since the token following /WeightVector isn't `[' (starting an
array) it is simply ignored.

* include/freetype/fterrdef.h: Define `FT_Err_Ignore' (0xA2) as a
new internal error value.

* src/type1/t1load.c (parse_blend_axis_types,
parse_blend_design_positions, parse_blend_design_map): Return
T1_Err_Ignore if no proper array is following the keyword.
(parse_weight_vector): Use T1_ToTokenArray, initializing `blend'
structure, if necessary.
Return T1_Err_Ignore if no proper array is following the keyword.
(parse_shared_dict): Removed.
(parse_encoding): Set parser->root.error to return T1_Err_Ignore
if no result can be obtained.
Check for errors before accessing `elements' array.
(t1_keywords): Remove /shareddict.
(parse_dict): Reset error if t1_load_keyword returns T1_Err_Ignore.
Set keyword_flag only in case of success.
Check error code if skipping an unrecognized token.
(T1_Open_Face) [!T1_CONFIG_OPTION_NO_MM_SUPPORT]: Call T1_Done_Blend
if blend commands haven't set up a proper MM font.

* src/psaux/psobjs.c (ps_parser_load_field_table): Remove special
code for synthetic fonts.
Return PSaux_Err_Ignore if no proper value has been found.
2004-02-12 08:33:20 +00:00
Werner Lemberg 5972e9abf8 * src/cff/cffgload.c (cff_operator_seac): Fix magnitude of
accent offset.
Update code similarly to the seac support for Type 1 fonts.
(cff_decoder_parse_charstrings) <cff_op_endchar>: Fix magnitude
of accent offset.
Don't hint glyphs twice if seac is emulated.
<cff_op_flex>: Assign correct point tags.
* docs/CHANGES: Updated.

* src/type1/t1parse.c (T1_Get_Private_Dict): Use FT_MEM_MOVE, not
FT_MEM_COPY, for copying the private dict.

* src/type1/t1load.c (parse_subrs): Assign number of subrs only
in first run.
(parse_charstrings): Parse /CharStrings in second run without
assigning values.
(parse_dict): Skip all /CharStrings arrays but the first.  We need
this for non-standard fonts like `Optima' which have different
outlines depending on the resolution.  Note that there is no
guarantee that we get fitting /Subrs and /CharStrings arrays; this
can only be done by a real PS interpreter.
2004-02-01 00:49:56 +00:00
David Turner 87c0d30fc5 * include/freetype/fttypes.h
src/autofit/afangles.c
        src/autofit/aflatin.c
        src/autohint/ahglyph.c
        src/autohint/ahhint.c
        src/base/ftcalc.c
        src/base/ftgloadr.c
        src/base/ftglyph.c
        src/base/ftobjs.c
        src/base/ftsynth.c
        src/base/fttrigon.c
        src/cff/cffgload.c
        src/cid/cidgload.c
        src/cid/cidload.c
        src/pfr/pfrgload.c
        src/pfr/pfrload.c
        src/pfr/pfrsbit.c
        src/psaux/psobjs.c
        src/pshinter/pshalgo.c
        src/pshinter/pshglob.c
        src/pshinter/pshrec.c
        src/raster/ftrend1.c
        src/sfnt/ttcmap0.c
        src/smooth/ftsmooth.c
        src/truetype/ttdriver.c
        src/truetype/ttgload.c
        src/truetype/ttinterp.c
        src/truetype/ttobjs.c
        src/type1/t1gload.c
        src/winfonts/winfnt.c:

          use of the FT_PAD_XXX and FT_PIX_XXX macros to avoid compiler
          warnings with very pedantic compilers. Hints:  (x) & -64 will
          warn if (x) is not signed.. use (x) & ~63 instead !
2003-12-24 01:10:46 +00:00
Werner Lemberg b36d4a53e9 * src/cff/cffdrivr.c (cff_get_glyph_name): Improve error message.
(cff_get_name_index): Return if no PSNames service is available.
(cff_ps_has_glyph_names): Handle CID-keyed fonts correctly.
* src/cff/cfftypes.h (CFF_CharsetRec): New field `cids', used for
CID-keyed fonts.  This is the inverse mapping of `sids'.
* src/cff/cffload.c (cff_charset_load): New argument `invert'.
Initialize charset->cids if `invert' is set.
(cff_font_load): In call to cff_charset_load, set `invert' to true
for CID-keyed fonts.
* src/cff/cffgload.c (cff_slot_load): Handle glyph index as CID
and map it to the real glyph index.

* docs/CHANGES: Updated.
2003-12-12 15:38:39 +00:00
Werner Lemberg dc8ad54f10 * include/freetype/internal/psaux.h (PS_TableRec): Change type
of `lengths' to FT_PtrDist.
(T1_DecoderRec): Change type of `subrs_len' to FT_PtrDist.
* include/freetype/internal/t1types.h (T1_FontRec): Change type
of `subrs_len' and `charstrings_len' to FT_PtrDist.

* src/base/ftobjs.c (Mac_Read_POST_Resource): Replace `junk'
variable with better solution.
(IsMacResource): Remove unused variable `map_len'.
Replace `junk' variable with better solution.
(FT_Open_Face) [!FT_MACINTOSH]: Add conditional
FT_CONFIG_OPTION_MAC_FONTS.

* src/autohint/ahhint.c (ah_hinter_hint_edges,
ah_hinter_align_strong_points): Add some casts.

* src/base/ftoutln.c (FT_OrientationExtremumRec): Change type
of `pos' to FT_Long.

* src/base/ftobjs.c (Mac_Read_POST_Resource,
Mac_Read_sfnt_Resource): Change type of `len' to FT_Long.

* src/type42/t42parse.c (t42_parse_dict): Add cast for `n_keywords'.
2003-12-09 02:12:14 +00:00
David Turner 7760595f84 * include/freetype/internal/bdftypes.h: removed obsolete header
* include/freetype/internal/cfftypes.h, src/cff/cfftypes.h,
        src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h,
        include/freetype/internal/services/svbdf.h: moving "cfftypes.h" from
        'include/freetype/internal' to 'src/cff' since no other modules needs
        to known about these types

        * include/freetype/internal/t42types.h,
        include/freetype/internal/internal.h, src/type42/t42objs.h,
        src/type42/t42drivr.c, src/type42/t42types.h: moving "t42types.h" from
        'include/freetype/internal' to 'src/type42' since no other modules needs
        to known about these types

        * src/gzip/infblock.c: removing compiler warning

        * include/freetype/internal/services/svpsinfo.h,
        include/freetype/internal/ftserv.h, src/cff/cffdrivr.c,
        src/cid/ciddrivr.c, src/type1/t1driver.c, src/type42/t42drivr.c,
        src/base/fttype1.c: migrating to FT_SERVICE_ID_POSTSCRIPT_INFO defined
        in "svpsinfo.h", removing some sad hacks.
2003-10-29 21:43:52 +00:00
Werner Lemberg 17d7581918 * src/autohint/ahhint.c (ah_hinter_load_glyph): Patch from
2003-08-18 introduced a severe bug (FT_Render_Glyph was called
twice under some circumstances, causing strange results).  This
is fixed now by clearing the FT_LOAD_RENDER bit of `load_flags'.

* src/base/ftpfr.c (FT_Get_PFR_Metrics): Initialize `error'.
* src/psaux/psobjs.c (ps_tobytes): Initialize `n'.
* src/type42/t42parse.c (t42_parse_sfnts): Initialize `string_size'.
2003-10-20 08:29:46 +00:00
Werner Lemberg e3f41982a2 Completely revised Type 42 parser. It now handles both fonts
produced with ttftot42 (tested version 0.3.1) and
TrueTypeToType42.ps (tested version May 2001; it is necessary to
fix the broken header comment to be `%!PS-TrueTypeFont...').

* src/type42/t42objs.c (T42_GlyphSlot_Load): Change fourth
parameter to `FT_UInt'.
* src/type42/t42objs.h: Updated.

* src/type42/t42parse.h (T42_ParserRec): Change type of `in_memory'
to FT_Bool.
(T42_Loader): Change type of `num_chars' and `num_glyphs' to
FT_UInt.
Add `swap_table' element.
* src/type42/t42parse.c (T42_KEYWORD_COUNT, T1_ToFixed,
T1_ToCoordArray, T1_ToTokenArray): Removed.
(T1_ToBytes): New macro.
(t42_is_alpha, t42_hexval): Removed.
(t42_is_space): Handle `\0'.
(t42_parse_encoding): Updated to use new PostScript parser routines
from psaux.
Handle `/Encoding [ ... ]' also.
(T42_Load_Status): New enumeration.
(t42_parse_sfnts): Updated to use new PostScript parser routines
from psaux.
(t42_parse_charstrings): Updated to use new PostScript parser
routines from psaux.
Handle `/CharStrings << ... >>' also.
Don't expect that /.notdef is the first element in dictionary.  Copy
code from type1 module to handle this.
(t42_parse_dict): Updated to use new PostScript parser routines
from psaux.
Remove code for synthetic fonts (which can't occur in Type 42
fonts).
(t42_loader_done): Release `swap_table'.

* src/psaux/psobjs.c (skip_string): Increase `cur' properly.

* src/type1/t1load.c (parse_charstrings): Make test for `.notdef'
faster.
2003-10-16 15:48:39 +00:00
Werner Lemberg ed3a7d7b0f * src/type1/t1load.c (parse_dict): Handle synthetic
fonts properly.
(parse_charstrings): Copy correct number of characters into
`name_table'.
2003-10-07 20:06:35 +00:00
Werner Lemberg 52f911a12d Heavy modification of the PS parser to handle comments and strings
correctly.  This doesn't slow down the loading of PS fonts
significantly since charstrings aren't affected.

* include/freetype/config/ftstdlib.h (ft_xdigit): Renamed to...
(ft_isxdigit): This.  Updated all callers.
(ft_isdigit): New alias to `isdigit'.

* include/freetype/internal/psaux.h (PS_Parser_FuncsRec): Renamed
`skip_alpha' to `skip_PS_token'.
Add parameter to `to_bytes' and change some argument types.

* src/psaux/psauxmod.c (ps_parser_funcs): Updated.
* src/psaux/psobjs.c (ft_char_table): New array to map character
codes (ASCII and EBCDIC) of digits to numbers.
(OP): New auxiliary macro holding either `>=' or `<' depending on
the character encoding.
(skip_comment): New function.
(skip_spaces): Use it.
(skip_alpha): Removed.
(skip_literal_string, skip_string): New functions.
(ps_parser_skip_PS_token): New function.  This is a better
replacement of...
(ps_parser_skip_alpha): Removed.
(ps_parser_to_token, ps+parser_to_token_array): Updated.
(T1Radix): Rewritten, using `ft_char_table'.
(t1_toint): Renamed to...
(ps_toint): This.  Update all callers.
Use `ft_char_table'.
(ps_tobytes): Add parameter to handle delimiters and change some
argument types.
Use `ft_char_table'.
(t1_tofixed): Renamed to...
(ps_tofixed): This.  Update all callers.
Use `ft_char_table'.
(t1_tocoordarray): Renamed and updated to...
(ps_tocoordarray): This.  Update all callers.
(t1_tofixedarray): Renamed and updated to...
(ps_tofixedarray): This.  Update all callers.
(t1_tobool): Renamed to...
(ps_tobool): This.  Update all callers.
(ps_parser_load_field): Updated.
(ps_parser_load_field_table): Use `T1_MAX_TABLE_ELEMENTS'
everywhere.
(ps_parser_to_int, ps_parser_to_fixed, ps_parser_to_coord_array,
ps_parser_to_fixed_array): Skip spaces.  Updated.
(ps_parser_to_bytes): Add parameter to handle delimiters and change
some argument types.  Updated.
* src/psaux/psobjs.h: Updated.

* src/cid/cidload.c (cid_parse_dict): Updated.
* src/cid/cidparse.c (cid_parser_new): Check whether the `StartData'
token was really found.
* src/cid/cidparse.h (cid_parser_skip_alpha): Updated and renamed
to...
(cid_parser_skip_PS_token): This.

* src/type1/t1parse.h (T1_ParserRec): Use `FT_Bool' for boolean
fields.
(T1_Skip_Alpha): Replaced with...
(T1_Skip_PS_Token): This new macro.
* src/type1/t1parse.c (hexa_value): Removed.
(T1_Get_Private_Dict): Use `ft_isxdigit' and
`psaux->ps_parser_funcs_to_bytes' for handling ASCII hexadecimal
encoding.
After decrypting, replace the four random bytes at the beginning
with whitespace.
* src/type1/t1load.c (t1_allocate_blend): Use proper error values.
(parser_blend_design_positions, parse_blend_design_map,
parse_weight_vector): Updated.
(is_space): Handle `\f' also.
(is_name_char): Removed.
(read_binary_data): Updated.
(parse_encoding): Use `ft_isdigit'.
Updated.
(parse_subrs): Updated.
(TABLE_EXTEND): New macro.
(parse_charstrings): Updated.
Provide a workaround for buggy fonts which have more entries in the
/CharStrings dictionary then expected; the function now adds some
slots and skips entries which still exceed the new limit.
(parse_dict): Updated.
Terminate on the token `closefile'.

* src/type42/t42parse.c (T1_Skip_Alpha): Replaced with...
(T1_Skip_PS_Token): This new macro.  Updated all callers.
(t42_parse_encoding): Use `ft_isdigit'.


* src/base/ftmm.c (ft_face_get_mm_service): Return FT_Err_OK if
success.
2003-10-07 05:49:41 +00:00
Werner Lemberg d393ca3738 Updated copyright years. 2003-09-30 07:00:42 +00:00
David Turner b72d8a8521 * include/freetype/internal/services/svpsname.h (added),
include/freetype/internal/psnames.h (removed),
        include/freetype/internal/internal.h (FT_SERVICE_POSTSCRIPT_NAMES):

          added new service to handle glyph name dictionaries, replacing
          the old internal header named "psnames.h" by "services/svpsname.h"
          note that this is different from "services/svpostnm.h" which only
          handles the retrieval of Postscript font name for a given face.
          (should we merge these two services into a single header ??)


        * include/freetype/internal/ftserv.h: adding
        FT_FACE_FIND_GLOBAL_SERVICE (used to lookup a service globally,
        instead of only within the current module)

        * include/freetype/internal/ftobjs.h, src/base/ftobjs.c: adding
        the new base function ft_module_get_service
2003-09-29 20:33:37 +00:00
David Turner 17dd0634f2 * include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
        include/freetype/internal/pfr.h,
        src/base/ftpfr.c:

          migrating the functions of "ftpfr.h" to the new
          service-base internal API

        * src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
        src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
        src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
        src/type42/t42objs.c, src/winfonts/winfnt.c:

          removing various compiler warnings
2003-09-21 16:04:05 +00:00
Werner Lemberg 754d558893 * src/cff/cffcmap.c: Include `cfferrs.h'.
* src/pfr/pfrdrivr.c: Include `pfrerror.h'.
* src/sfnt/sfdriver.c: Include `sferrors.h'.
* src/psaux/psobjs.h: Add declaration for `ps_parser_to_bytes'.
2003-09-12 20:32:51 +00:00
Werner Lemberg 64f1ba9064 Make reference valid HTML 4.01 transitional.
* src/tools/docmaker/tohtml.py (html_header_1): Add doctype
and charset.
(html_header_2): Fix style elements and add some more.
Fix syntax.
(block_header, block_footer, description_header, description_footer,
marker_header, marker_footer, source_header, source_footer,
chapter_header, chapter_footer): Don't use <center>...</center> but
`align=center' table attribute.
Use double quotes around table widths given in percent.
(keyword_prefix, keyword_suffix): Don't change font colour directly
but use a new <span> class.
(section_synopsis_header, section_synopsis_footer): Don't change
colour.
(print_html_field): <tr> gets the `valign' attribute, not <table>.
(print_html_field_list): Ditto.
(index_exit): Don't use <center>...</center> but `align=center'
table attribute.
(toc_exit, section_enter): Ditto.
(block_enter): Use <h4><a>, not <a><h4>.


This change reimplements fix from 2003-05-30 without breaking
binary compatibility.

* include/freetype/t1tables.h (PS_FontInfoRec): `italic_angle',
`is_fixed_pitch', `underline_position', `underline_thickness' are
reverted to be normal values.

* include/freetype/internal/psaux.h (T1_FieldType): Remove
`T1_FIELD_TYPE_BOOL_P', `T1_FIELD_TYPE_INTEGER_P',
`T1_FIELD_TYPE_FIXED_P', `T1_FIELD_TYPE_FIXED_1000_P'.
(T1_FIELD_TYPE_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P,
T1_FIELD_FIXED_1000_P): Removed.
(T1_FIELD_TYPE_BOOL): Renamed to...
(T1_FIELD_BOOL): New macro.  Updated all callers.

* src/type42/t42parse.c: `italic_angle', `is_fixed_pitch',
`underline_position', `underline_thickness', `paint_type',
`stroke_width' are reverted to be normal values.
(T42_KEYWORD_COUNT): New macro.
(t42_parse_dict): New array `keyword_flags' to mark that a value has
already been assigned to a dictionary entry.
* src/type42/t42objs.c (T42_Face_Init, T42_Face_Done): Updated.

* src/cid/cidtoken.h: `italic_angle', `is_fixed_pitch',
`underline_position', `underline_thickness' are reverted to be
normal values.
* src/cid/cidobjs.c (cid_face_done, cid_face_init): Updated.

* src/psaux/psobjs.c (ps_parser_load_field): Updated.

* src/type1/t1tokens.h: `italic_angle', `is_fixed_pitch',
`underline_position', `underline_thickness', `paint_type',
`stroke_width' are reverted to be normal values.
* src/type1/t1objs.c (T1_Face_Done, T1_Face_Init): Updated.
* src/type1/t1load.c (T1_FIELD_COUNT): New macro.
(parse_dict): Add parameter for keyword flags.
Record only first instance of a field.
(T1_Open_Face): New array `keyword_flags'.
2003-07-25 22:09:53 +00:00
Werner Lemberg 850fee2ccb * include/freetype/internal/psaux.h (PS_Parser_FuncsRec): New
member function `to_bytes'.

* src/psaux/psauxmod.c (ps_parser_funcs): New member
`ps_parser_to_bytes'.
(psaux_module_class): Increase version to 0x20000L.

* src/psaux/psobjs.c (IS_T1_LINESPACE): Add \f.
(IS_T1_NULLSPACE): New macro.
(IS_T1_SPACE): Add it.
(skip_spaces, skip_alpha): New functions.
(ps_parser_skip_spaces, ps_parser_skip_alpha): Use them.
(ps_tobytes, ps_parser_to_bytes): New functions.
2003-07-24 06:16:21 +00:00
Werner Lemberg 779afe4b91 * src/winfonts/winfnt.c (FNT_Load_Glyph): Use first_char in
computation of glyph_index.
(FNT_Size_Set_Pixels): To find a strike, first check pixel_height
only, then try to find a better hit by comparing pixel_width also.
Without this fix it isn't possible to access all strikes.
Also compute metrics.max_advance to be in sync with other bitmap
drivers.

* src/base/ftobjs.c (FT_Set_Char_Size): Remove redundant code.
(FT_Set_Pixel_Size): Assign value to `metrics' after validation of
arguments.


Synchronize computation of height and width for bitmap strikes.  The
`width' field in the FT_Bitmap_Size structure is now only useful to
enumerate different strikes.  The `max_advance' field of the
FT_Size_Metrics structure should be used to get the (maximum) width
of a strike.

* src/bdf/bdfdrivr.c (BDF_Face_Init): Don't use AVERAGE_WIDTH for
computing `available_sizes->width' but make it always equal to
`available_sizes->height'.

* src/pcf/pcfread.c (pcf_load_font): Don't use RESOLUTION_X for
computing `available_sizes->width' but make it always equal to
`available_sizes->height'.

* src/truetype/ttdriver.c (Set_Pixel_Sizes): Pass only single
argument to function.

* src/psnames/psmodule.c (ps_unicode_value): Handle `.' after
`uniXXXX' and `uXXXX[X[X]]'.


* src/bdf/bdfdrivr.c: s/FT_Err_/BDF_Err/.
* src/cache/ftccache.c, src/cache/ftcsbits.c, src/cache/ftlru.c:
s/FT_Err_/FTC_Err_/.
* src/cff/cffcmap.c: s/FT_Err_/CFF_Err_/.
* src/pcf/pcfdrivr.c: s/FT_Err_/PCF_Err_/.
* src/psaux/t1cmap.c: Include psauxerr.h.
s/FT_Err_/PSaux_Err_/.
* src/pshinter/pshnterr.h: New file.
* src/pshinter/rules.mk: Updated.
* src/pshinter/pshalgo.c, src/pshinter/pshrec.c: Include pshnterr.h.
s/FT_Err_/PSH_Err_/.
* src/pfr/pfrdrivr.c, src/pfr/pfrobjs.c, src/pfr/pfrsbit.c:
s/FT_Err_/PFR_Err_/.
* src/sfnt/sfdriver.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c,
src/sfnt/ttload.c: s/FT_Err_/SFNT_Err_/.
* src/truetype/ttgload.c: s/FT_Err_/TT_Err_/.
* src/gzip/ftgzip.c: Load FT_MODULE_ERRORS_H and define
FT_ERR_PREFIX and FT_ERR_BASE.
s/FT_Err_/Gzip_Err_/.
2003-06-22 15:33:53 +00:00
Werner Lemberg 052904e3a0 * include/freetype/ftglyph.h (ft_glyph_bbox_unscaled,
ft_glyph_bbox_subpixels, ft_glyph_bbox_gridfit,
ft_glyph_bbox_truncate, ft_glyph_bbox_pixels): Replaced with
FT_GLYPH_BBOX_UNSCALED, FT_GLYPH_BBOX_SUBPIXELS,
FT_GLYPH_BBIX_GRIDFIT, FT_GLYPH_BBOX_TRUNCATE, FT_GLYPH_BBOX_PIXELS.
The lowercase variants are now (deprecated aliases) to the uppercase
versions.
Updated all other files.

* include/freetype/ftmodule.h (ft_module_font_driver,
ft_module_renderer, ft_module_hinter, ft_module_styler,
ft_module_driver_scalable, ft_module_driver_no_outlines,
ft_module_driver_has_hinter): Replaced with FT_MODULE_FONT_DRIVER,
FT_MODULE_RENDERER, FT_MODULE_HINTER, FT_MODULE_STYLER,
FT_MODULE_DRIVER_SCALABLE, FT_MODULE_DRIVER_NO_OUTLINES,
FT_MODULE_DRIVER_HAS_HINTER.
The lowercase variants are now (deprecated aliases) to the uppercase
versions.
Updated all other files.

* src/base/ftglyph.c (FT_Glyph_Get_CBox): Handle bbox_mode better
as enumeration.

* src/pcf/pcfdrivr.c (pcf_driver_class), src/winfonts/winfnt.c
(winfnt_driver_class), src/bdf/bdfdrivr.c (bdf_driver_class): Add
the FT_MODULE_DRIVER_NO_OUTLINES flag.
2003-06-17 10:42:27 +00:00
Werner Lemberg 88c0478dce * include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_KEY.
(T1_FIELD_KEY): New macro.
* src/psaux/psobjs.c (ps_parser_load_field): Handle
T1_FIELD_TYPE_KEY.

* src/cid/cidtoken.h: Use T1_FIELD_KEY for /CIDFontName.


* src/cache/ftlru.c (FT_LruList_Remove_Selection): Decrease
number of nodes.
(FT_LruList_Lookup): Fix assertion for out-of-memory case.
2003-06-12 13:14:15 +00:00
Werner Lemberg 858f310b80 Completely revised FreeType's make management.
. In all makefiles `/' is used as the path separator.  The
  conversion to the real path separators is done as late as
  possible using $(subst ...).

. $(HOSTSEP) no longer exists.  Now, $(SEP) gives the path separator
  for the operating system, and the new $(COMPILER_SEP) the path
  separator for the compiler tools.

. $(BUILD) has been renamed to $(BUILD_DIR).  In general, all
  directory variables end with `_DIR'.  The variants ending in `_'
  (like `BASE_' have been removed).

The following ChangeLog entries only describe changes which are
not related to the redesign.

* builds/beos/beos-def.mk (BUILD_DIR): Fix typo.
* builds/compiler/watcom.mk (LINK_LIBRARY): Fix linker call to avoid
overlong arguments as suggested by J. Ali Harlow
<ali@avrc.city.ac.uk>.
* builds/dos/dos-wat.mk: New file.
* builds/freetype.mk (FREETYPE_H): Include header files from the
`devel' subdirectory.

* builds/os2/os2-dev.mk, builds/unix/unixddef.mk,
builds/unix/unixddef.mk, builds/win32/w32-bccd.mk,
builds/win32/w32-dev.mk (BUILD_DIR): Fix path.

* builds/unix/configure.ac, builds/unic/configure: Updated.
* builds/unix/unix-def.in (DISTCLEAN): Add `freetype2.pc'.


* devel/ftoption.h: Updated.
2003-06-09 04:46:30 +00:00
Werner Lemberg bf7c8321f2 * include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_FIXED_1000 and T1_FIELD_TYPE_FIXED_1000_P.
(T1_FIELD_FIXED_1000, T1_FIELD_FIXED_1000_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle
T1_FIELD_TYPE_FIXED_1000 and T1_FIELD_TYPE_FIXED_1000_P.

* src/cff/cffparse.c (cff_kind_fixed_thousand): New enumeration.
(CFF_FIELD_FIXED_1000): New macro.
(cff_parser_run): Handle cff_kind_fixed_thousand.
* src/cff/cfftoken.h: Use CFF_FIELD_FIXED_1000 for blue_scale.
* src/cff/cffload (cff_subfont_load): Fix default values of
expansion_factor and blue_scale.

* src/cif/cidtoken.h, src/type1/t1tokens.h: Use T1_FIELD_FIXED_1000
for blue_scale.

* src/pshinter/pshglob.c (psh_globals_new): Fix default value of
blue_scale.
2003-06-06 05:07:53 +00:00
Werner Lemberg 7386197677 * include/freetype/internal/ftdriver.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/psaux.h, src/cid/cidgload.c,
src/psaux/psobjs.c, src/psaux/t1decode.c, src/psaux/psobjs.h,
src/pshinter/pshrec.c, src/pshinter/pshalgo.c,
src/psnames/psmodule.c, src/raster/ftraster.c, src/sfnt/sfobjs.c,
src/smooth/ftgrays.c, src/smooth/ftsmooth.c, src/truetype/ttobjs.c,
src/truetype/ttdriver.c, src/truetype/ttgload.c, src/type1/t1afm.c,
src/type1/t1gload.c, src/type1/t1gload.h, src/type1/t1load.c,
src/type1/t1objs.c, src/type42/t42parse.c, src/type42/t42parse.h:
Many casts and slight argument type changes to make it work with
a 16bit compiler.
2003-06-05 04:31:05 +00:00
Werner Lemberg 8b88466061 * src/autohint/ahhint.c (ah_hinter_hint_edges): Removed. Just a
wrapper for ah_hint_edges.
(ah_hint_edges): Renamed to...
(ah_hinter_hint_edges): This.

* src/base/ftobjs.c (FT_Set_Hint_Flags): Removed.  Unused.

* include/freetype/internal/ftobjs.h (FT_Face_InternalRec),
include/freetype/internal/psaux.h (T1_DecoderRec),
src/cff/cffgload.h (CFF_Builder): Remove `hint_flags' field.
Unused.

* src/cff/cffgload.c (cff_builder_init): Updated.
(cff_decoder_parse_charstrings) <cff_op_endchar>: Call hinter->apply
with decoder->hint_mode instead of builder->hint_flags.
* src/psaux/t1decode.c (t1_decoder_init): Updated.

* src/base/ftstroker.c (ft_stroke_border_export): s/index/idx/.

* src/sfnt/sfobjs.c (sfnt_load_face): Commented out code which
increased root->height by 15% if the line gap was zero.  There exist
fonts (containing e.g. form drawing characters) which intentionally
have a zero line gap value.
2003-06-03 11:51:43 +00:00
Werner Lemberg 65ba724b66 Avoid overwriting of numeric font dictionary entries for synthetic
fonts. Additionally, some entries were handled as `integer' instead
of `number'.

* include/freetype/internal/psaux.h (T1_FieldType): Add
T1_FIELD_TYPE_BOOL_P, T1_FIELD_TYPE_INTEGER_P, and
T1_FIELD_TYPE_FIXED_P.
(T1_FIELD_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P): New macros.
* src/psaux/psobjs.c (ps_parser_load_field): Handle new field types.

* include/freetype/internal/cfftypes.h (CFF_FontRecDict),
src/cff/cfftoken.h: Change type of underline_position and
underline_thickness to FT_Fixed.
* src/cff/cffload.c (cff_subfont_load): Fix default values of
underline_position and underline_thickness.
* src/cff/cffobjs.c (cff_face_init): Set underline_position
and underline_thickness in `root'.

* include/freetype/internal/t1types.h (T1_Font): Change point_type
and stroke_width to pointers.
* include/freetype/t1tables.h (PS_FontInfo): Change italic_angle,
is_fixed_pitch, underline_position, and underline_thickness to
pointers.
* src/type1/t1tokens.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers.  Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type1/t1objs.c (T1_Face_Done): Updated.
(T1_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.

* src/cid/cidtoken.h: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers.  Change
the type of the latter two to `fixed'.
Change type of stroke_width to `fixed'.
* src/cid/cidobjs.c (cid_face_done): Updated.
(cid_face_init): Updated.
Fix assignment of underline_position and underline_thickness.

* src/type42/t42parse.c: Change italic_angle, is_fixed_pitch,
underline_position, and underline_thickness to pointers.  Change the
type of the latter two to `fixed'.
Change type of stroke_width to `fixed' and make it a pointer.
Change paint_type to pointer.
* src/type42/t42objs.c (T42_Face_Init): Updated.
Fix assignment of underline_position and underline_thickness.
(T42_Face_Done): Updated.

* src/base/ftobjs.c (open_face_from_buffer): Fix compiler warning.
* src/pshinter/pshglob.c, src/pshinter/pshglob.h
(psh_globals_set_scale): Make it a local function.

* test/gview.c: Fix remaming ps3->ps typo.
Formatting.
2003-05-30 09:12:50 +00:00
Werner Lemberg bb3105e256 Cleanups. 2003-04-23 15:17:43 +00:00
David Turner b280537b6d * src/base/ftdbgmem.c, docs/DEBUG.TXT: added new environment variables
to control memory debugging with FreeType. See the description of
    "FT2_DEBUG_MEMORY", "FT2_ALLOC_TOTAL_MAX" and "FT2_ALLOC_COUNT_MAX"
    in DEBUG.TXT

    * src/cache/ftccache.c, src/cache/ftccmap.c, src/cache/ftcsbits.c,
    ftlru.c: fixed the cache sub-system to correctly deal with out-of-memory
    conditions.

    * src/pfr/pfrobjs.c, src/pfr/pfrsbits.c: fixing compiler warnings and a
    small memory leak

    * src/psaux/psobjs.c (t1_reallocate_table): fixed a bug (memory leak) that
    only happened when trying to resize an array would end in an OOM.

    * src/smooth/ftgrays.c: removed compiler warnings / volatile bug

    * src/truetype/ttobjs.c: removed segmentation fault that happened in
    tight memory environments.
2003-03-13 21:07:51 +00:00
David Turner 60b32e16e7 2002-11-05 David Turner <david@freetype.org>
* include/freetype/config/ftoption.h, src/gzip/ftgzip.c: added
        support for the FT_CONFIG_OPTION_SYSTEM_ZLIB option, used to specify
        the use of system-wide zlib.

        Note that this macro, as well as FT_CONFIG_OPTION_BYTECODE_INTERPRETER,
        is not #undef-ed anymore. This allows the build system to define them
        depending on the configuration (typically by adding -D flags at
        compile time).

        * src/sfnt/ttcmap0.c (tt_face_build_cmaps): removed compiler warnings
        in optimized mode relative to the "volatile" local variables. This was
        not a compiler bug after all, but the fact that a pointer to a volatile
        variable is not the same than a volatile pointer to a variable :-)

        the fix was to change  "volatile FT_Byte*  p"
        into                   "FT_Byte* volatile  p"

        * src/pfr/pfrload.c, src/pfr/pfrdrivr.c, src/gzip/inftrees.c: removed
        compiler warnings in optimized modes

        * src/gzip/*.[hc]: modified our ZLib copy in order to prevent exporting
        any zlib function names outside of the component. This prevents linking
        problems on some platforms, when applications want to link FreeType
        _and_ ZLib together.


2002-11-05  Juliusz  <jch@pps.jussieu.fr>

        * src/psaux/psobjs.c (ps_table_add): modified increment loop in
        order to implement exponential behaviour
2002-11-06 22:32:54 +00:00
Werner Lemberg 68e9f92710 * src/sfnt/ttpost.c (load_post_names, tt_face_free_ps_names,
tt_face_get_ps_name): Replace switch statement with if clauses to
make it more portable.

* src/cff/cffobjs.c (cff_face_init): Ditto.

* include/freetype/ftmodule.h (FT_Module_Class): Use `FT_Long' for
`module_size'.
* include/freetype/ftrender.h (FT_Glyph_Class_): Use `FT_Long' for
`glyph_size'.

* src/base/ftobjs.c (FT_Render_Glyph): Change second parameter to
`FT_Render_Mode'.
(FT_Render_Glyph_Internal): Change third parameter to
`FT_Render_Mode'.
* src/base/ftglyph.c (FT_Glyph_To_Bitmap): Change second parameter
to `FT_Render_Mode'.

* src/raster/ftrend1.c (ft_raster1_render): Change third parameter
to `FT_Render_Mode'.
* src/smooth/ftsmooth.c (ft_smooth_render, ft_smooth_render_lcd,
ft_smooth_render_lcd_v): Ditto.
(ft_smooth_render_generic): Change third and fifth parameter to
`FT_Render_Mode'.

* include/freetype/freetype.h, include/freetype/internal/ftobjs.h,
include/freetype/ftglyph.h: Updated.

* src/cff/cffdrivr.c (Load_Glyph), src/pcf/pcfdriver.c
(PCF_Glyph_Load), src/pfr/pfrobjs.c (pfr_slot_load),
src/winfonts/winfnt.c (FNT_Load_Glyph), src/t42/t42objs.c
(T42_GlyphSlot_Load), src/bdf/bdfdrivr.c (BDF_Glyph_Load): Change
fourth parameter to `FT_Int32'.

* src/pfr/pfrobjs.c (pfr_face_init): Add two missing parameters
and declare them as unused.

* src/cid/cidparse.h (CID_Parser): Use FT_Long for `postscript_len'.

* src/psnames/psnames.h (PS_Unicode_Value_Func): Change return
value to FT_UInt32.
* src/psnames/psmodule.c (ps_unicode_value, ps_build_unicode_table):
Updated accordingly.

* src/cff/cffdrivr.c (Get_Kerning): Use FT_Long for `middle'.
(cff_get_glyph_name): Use cast for result of ft_strlen.
* src/cff/cffparse.c (cff_parse_real): User cast for assigning
`exp'.
* src/cff/cffload.c (cff_index_get_pointers): Use FT_ULong for
some local variables.
(cff_charset_load, cff_encoding_load): Use casts to FT_UInt for some
switch statements.
(cff_font_load): Use cast in call to CFF_Load_FD_Select.
* src/cff/cffobjs.c (cff_size_init): Use more casts.
(cff_face_init): Use FT_Int32 for `flags'.
* src/cff/cffgload.c (cff_operator_seac): Use cast for assigning
`adx' and `ady'.
(cff_decoder_parse_charstrings): Use FT_ULong for third parameter.
Use more casts.
* src/cff/cffcmap.c (cff_cmap_unicode_init): Use cast for `count'.

* src/cid/cidload.c (cid_read_subrs): Use FT_ULong for `len'.
* src/cid/cidgload.c (cid_load_glyph): Add missing cast for
`cid_get_offset'.

* src/psaux/t1decode.c (t1_decoder_parse_charstrings) <18>: Use
cast for `num_points'.
(t1_decoder_init): Use cast for assigning `decoder->num_glyphs'.

* src/base/ftdebug.c (ft_debug_init): Use FT_Int.
* include/freetype/internal/ftdriver.h (FT_Slot_LoadFunc): Use
`FT_Int32' for fourth parameter.
* src/base/ftobjs.c (open_face): Use cast for calling
clazz->init_face.

* src/raster/ftraster.c (Set_High_Precision): Use `1' instead of
`1L'.
(Finalize_Profile_Table, Line_Up, ft_black_init): Use casts.
* src/raster/ftrend1.c (ft_raster1_render): Ditto.

* src/sfnt/sfnt_dir_check: Compare `magic' with unsigned long
constant.

* builds/amiga/include/freetype/config/ftmodule.h: Updated.
2002-09-27 11:09:23 +00:00
Werner Lemberg 55e80ec200 More 16bit fixes.
* src/psaux/psobjs.c (reallocate_t1_table): Use FT_Long for
second parameter.
2002-09-17 13:56:44 +00:00
Werner Lemberg 6b5c669b7b * src/cid/cidobjs.c (CID_Size_Init): Renamed to...
(cid_size_init): This.
* src/psaux/psobjs.c (T1_Builder_Add_Point1): Renamed to...
(t1_builder_add_point1): This.

Updated all affected code.

* src/pshinter/pshalgo3.c (psh3_hint_align): Fix compiler warnings.
* src/type1/t1gload.c (T1_Compute_Max_Advance): Ditto.

Formatting, minor doc fixes.
2002-09-05 15:10:54 +00:00
David Turner d1245c0dd2 updating sources to support the new FT_LOAD_TARGET_ constants
to support target-specific hinting
2002-08-27 22:34:20 +00:00
David Turner b08fe2dc7a * massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
    transformations of the sources:

      - trying to convert all enums and constants to CAPITALIZED_STYLE, with
        #define definitions like

          #define  my_old_constants   MY_NEW_CONSTANT

      - big, big update of the documentation comments

    * include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
    include/freetype/ftimage.h: adding support for LCD-optimized rendering
    though the new constants/enums:

      FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
      FT_PIXEL_MODE_LCD,  FT_PIXEL_MODE_LCD_V

    this is still work in progress, don't expect everything to work correctly
    though most of the features have been implemented.

    * adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
    targets:

      FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
      FT_LOAD_TARGET_MONO   :: monochrome bitmaps
      FT_LOAD_TARGET_LCD    :: horizontal RGB/BGR decimated hinting & rendering
      FT_LOAD_TARGET_LCD_V  :: vertical RGB/BGR decimated hinting & rendering

    note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
    behaviour of the font engine is _unchanged_.
2002-08-27 20:20:29 +00:00
Werner Lemberg b3d5e9cf03 s/ft_memset/FT_MEM_SET/.
s/FT_MEM_SET/FT_MEM_ZERO/ where appropriate.
2002-07-28 05:05:24 +00:00
Werner Lemberg 7f74a52a21 Fixing ChangeLog entries.
Some formatting.

* src/truetype/ttgload.c (load_truetype_glyph)
[FT_CONFIG_OPTION_INCREMENTAL]: s/memset/ft_memset/.

* src/autohint/ahhint.c (ah_hint_edges_3): Fix compiler warning.
* src/cff/cffload.c (cff_encoding_load): Remove `memory' variable.
* src/cff/cffcmap.c (cff_cmap_encoding_init): Remove `psnames'
variable.
* src/truetype/ttgload.c (load_truetype_glyph): Remove statement
without effect.
* src/truetype/ttdriver (Get_Char_Index, Get_Next_Char): Removed.
2002-07-26 09:09:10 +00:00
David Turner 8db6a07021 * include/freetype/t1tables.h, include/freetype/internal/psaux.h,
src/psaux/psobjs.c, src/type1/t1load.c, src/type1/t1tokens.h:
    fixing a bug in the Type 1 loader that prevented valid font bounding
    boxes to be loaded from multiple master fonts.
2002-07-11 11:26:21 +00:00
David Turner 27c322e983 * include/freetype/freetype.h, src/base/ftobjs.h,
freetype/internal/ftobjs.h, freetype/internal/psaux.h,
    freetype/internal/pshints.h, src/psaux/t1decode.c, src/cff/cffgload.h,
    src/cff/cffgload.c, src/pshinter/pshalgo1.h, src/pshinter/pshalgo1.c,
    src/pshinter/pshalgo2.h, src/pshinter/pshalgo2.c, src/pshinter/pshalgo3.h,
    src/pshinter/pshalgo3.c: Adding support for hinter-specific bit flags,
    and the new FT_Set_Hint_Flags high-level API
2002-07-08 22:26:11 +00:00
Werner Lemberg 0bb4a0f93a * src/psaux/t1cmap.c (t1_cmap_custom_char_index,
t1_cmap_custom_char_next): Fix index computation -- indices start
with 0 and not with cmap->first.

Provide default charmaps.

* src/bdf/bdfdrivr.c (BDF_Face_Init), src/pcf/pcfdriver.c
(PCF_Face_Init), src/pfr/pfrobjs.c (pfr_face_init),
src/type1/t1objs (T1_Face_Init), src/winfonts/winfnt.c
(FNT_Face_Init): Implement it.
2002-06-19 15:57:55 +00:00
Werner Lemberg b1859049e2 * src/psaux/psobjs.c (T1Radix): New function.
(t1_toint): Use it to handle numbers in radix format.

* src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Add dummy
for undocumented, obsolete opcode 15.
2002-05-22 04:53:25 +00:00
Werner Lemberg 94ffae5239 * src/cff/cffgload.c (CFF_Parse_CharStrings): s/rand/Rand/ to avoid
compiler warning.

formatting/fixing ChangeLog
2002-04-14 00:54:32 +00:00
David Turner d15bc0d13a * README.UNX: updated the Unix-specific quick-compilation guide to
warn about the GNU Make requirement at compile time..

        * include/freetype/config/ftstdlib.h,
          include/freetype/config/ftconfig.h,
          include/freetype/config/ftheader.h,
          include/freetype/internal/ftmemory.h,
          include/freetype/internal/ftobjs.h,

          src/autohint/ahoptim.c,

          src/base/ftdbgmem.c, src/base/ftdebug.c,
          src/base/ftmac.c,    src/base/ftobjs.c,
          src/base/ftsystem.c,

          src/cache/ftcimage.c, src/cache/ftcsbits.c,

          src/cff/cffdriver.c, src/cff/cffload.c, src/cff/cffobjs.c,

          src/cid/cidload.c, src/cid/cidparse.c, src/cid/cidriver.c,

          src/pcf/pcfdriver.c, src/pcf/pcfread.c,

          src/psaux/t1cmap.c, src/psaux/t1decode.c,

          src/pshinter/pshalgo1.c, src/pshinter/pshalgo2.c,
          src/pshinter/pshrec.c,

          src/psnames/psmodule.c,

          src/raster/ftraster.c,

          src/sfnt/sfdriver.c, src/sfnt/ttload.c, src/sfnt/ttpost.c,

          src/smooth/ftgrays.c,

          src/type1/t1afm.c,  src/type1/t1driver.c, src/type1/t1gload.c,
          src/type1/t1load.c, src/type1/t1objs.c,   src/type1/t1parse.c:

            added the new configuration file "ftstdlib.h" used to define
            aliases for all ISO C library functions used by the engine
            (e.g. strlen, qsort, setjmp, etc...)

            this eases the porting of FreeType 2 to exotic environments like
            XFree86 modules/extensions..

            also removed many #include <string.h>, #include <stdlib.h>, etc...
            from the engine's sources where they're not needed..
2002-04-12 09:31:48 +00:00
Werner Lemberg 91db04cb9c * src/truetype/ttgload.c: 16bit fixes.
(TT_Load_Simple_Glyph): Improve debug messages.
(load_truetype_glyph): Remove dead code.
* src/truetype/ttinterp.c: 16bit fixes.
* src/truetype/ttobjs.c: Ditto.

* include/freetype/ftsnames.h, include/freetype/internal/sfnt.h,
src/cff/cffload.h, src/psaux/psobjs.h, src/truetype/ttinterp.[ch],
src/sfnt/ttpost.h: s/index/idx/.

formatting, copyright updates.
2002-04-01 14:25:28 +00:00
Werner Lemberg 545a75fdd7 * src/psaux/t1cmap.c: s/index/idx/.
* src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Fix debug
messages.
2002-03-31 11:18:15 +00:00
Werner Lemberg 1305f2616d * include/freetype/internal/psaux.h (PSAux_ServiceRec): Fix
compiler warnings.
* include/freetype/internal/t1types.h (T1_FaceRec): Use `const' for
some members.
* src/base/ftapi.c (FT_New_Memory_Stream): Fix typos.
* src/psaux/t1cmap.c (t1_cmap_std_init, t1_cmap_unicode_init): Add
cast.
(t1_cmap_{standard,expert,custom,unicode}_class_rec): Use
`FT_CALLBACK_TABLE_DEF'.
* src/psaux/t1cmap.h: Updated.
* src/sfnt/ttcmap0.c (TT_Build_CMaps): Use `ft_encoding_none'
instead of zero.
* src/type1/t1objs.c (T1_Face_Init): Use casts.
2002-03-28 08:07:16 +00:00
David Turner 4b29d58761 removing compiler warnings 2002-03-25 17:02:26 +00:00
David Turner effa96496e formatting 2002-03-22 15:55:55 +00:00
David Turner e459d742e6 * include/freetype/internal/ftmemory.h, and a lot of other files !!:
changed the names of memory macros. Examples:

              MEM_Set   => FT_MEM_SET
              MEM_Copy  => FT_MEM_COPY
              MEM_Move  => FT_MEM_MOVE

              ALLOC     => FT_ALLOC
              FREE      => FT_FREE
              REALLOC   = >FT_REALLOC

            FT_NEW was introduced to allocate a new object from a _typed_
            pointer..

            note that ALLOC_ARRAY and REALLOC_ARRAY have been replaced
            by FT_NEW_ARRAY and FT_RENEW_ARRAY which take _typed_ pointer
            arguments.

            This results in _lots_ of sources being changed, but makes the
            code more generic and less error-prone..
2002-03-22 13:52:37 +00:00
David Turner 42372fd4d8 * src/psaux/t1cmap.h, src/psaux/t1cmap.c, src/type1/t1cmap.h,
src/type1/t1cmap.c: updating and moving the Type 1 FT_CMap support
        from "src/type1" to "src/psaux" since it's going to be shared
        by the Type 1 and CID font drivers..

        * src/psaux/Jamfile, src/psaux/psaux.c, src/psaux/psauxmod.c,
        src/psaux/rules.mk, include/freetype/internal/psaux.h: added support
        for Type 1 FT_CMaps.
2002-03-21 15:02:54 +00:00
David Turner 5a83a00d11 moving the Type 1 CMap support to "psaux" 2002-03-21 10:39:23 +00:00
David Turner eba5ad4b37 no message 2002-03-14 12:56:35 +00:00
David Turner 429978bdca * include/freetype/internal/psaux.h,
src/cid/cidload.c, src/cidtoken.h,
          src/psaux/psobjs.c, src/psaux/psobjs.h, src/psaux/t1decode.c,
          stc/type1/t1load.c, src/type1/t1tokens.h: updated common Postscript
          type definitions
2002-03-14 10:09:35 +00:00
Werner Lemberg 0d9165e1d6 * src/base/ftdbgmem.c (ft_mem_table_resize, ft_mem_table_new,
ft_mem_table_set, ft_mem_debug_alloc, ft_mem_debug_free,
ft_mem_debug_realloc, ft_mem_debug_done, FT_Alloc_Debug,
FT_Realloc_Debug, FT_Free_Debug): Fix compiler warnings.
* src/base/ftcalc.c (FT_MulFix): Ditto.
* src/cff/cffdrivr.c (cff_get_name_index): Ditto.
* src/cff/cffobjs.c (CFF_Size_Get_Global_Funcs, CFF_Size_Init,
CFF_GlyphSlot_Init): Ditto.
* src/cid/cidobjs.c (CID_GlyphSlot_Init,
CID_Size_Get_Globals_Funcs): Ditto.
* src/type1/t1objs.c (T1_Size_Get_Globals_Funcs, T1_GlyphSlot_Init):
Ditto.
* src/pshinter/pshmod.c (pshinter_interface): Use `static const'.
* src/winfonts/winfnt.c (FNT_Get_Next_Char): Remove unused
variables.

* include/freetype/internal/psaux.h (T1_Builder_Funcs): Renamed
to...
(T1_Builder_FuncsRec): This.
(T1_Builder_Funcs): New typedef.
(PSAux_Interface): Remove compiler warnings.
* src/psaux/psauxmod.c (t1_builder_funcs), src/psaux/psobjs.h
(t1_builder_funcs): Updated.

* src/pshinter/pshglob.h (PSH_Blue_Align): Replaced with ...
(PSH_BLUE_ALIGN_{NONE,TOP,BOT}): New defines.
(PSH_AlignmentRec): Updated.

* include/freetype/internal/ftstream.h (GET_Char, GET_Byte): Fix
typo.
* include/freetype/internal/ftgloadr.h (FT_SubGlyph): Ditto.
* src/base/ftstream (FT_Get_Char): Rename to...
(FT_Stream_Get_Char): This.

* src/base/ftnames.c (FT_Get_Sfnt_Name): s/index/idx/ -- `index' is
a built-in function in gcc, causing warning messages with gcc 3.0.
* src/autohint/ahglyph.c (ah_outline_load): Ditto.
* src/autohint/ahglobal.c (ah_hinter_compute_blues): Ditto.
* src/cache/ftcmanag.c (ftc_family_table_alloc,
ftc_family_table_free, FTC_Manager_Done, FTC_Manager_Register_Cache):
Ditto.
* src/cff/cffload.c (cff_new_index, cff_done_index,
cff_explicit_index, CFF_Access_Element, CFF_Forget_Element,
CFF_Get_Name, CFF_Get_String, CFF_Load_SubFont, CFF_Load_Font,
CFF_Done_Font): Ditto.
* src/psaux/psobjs.c (PS_Table_Add, PS_Parser_LoadField): Ditto.
* src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto.
* src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_clear_bit,
ps_mask_set_bit, ps_dimension_add_t1stem, ps_hints_t1stem3,
* src/pshinter/pshalgo1.c (psh1_hint_table_record,
psh1_hint_table_record_mask, psh1_hint_table_activate_mask): Ditto.
* src/pshinter/pshalgo2.c (psh2_hint_table_record,
psh2_hint_table_record_mask, psh2_hint_table_activate_mask): Ditto.
* src/sfnt/ttpost.c (Load_Format_20, Load_Format_25,
TT_Get_PS_Name): Ditto.
* src/truetype/ttgload.c (TT_Get_Metrics, Get_HMetrics,
load_truetype_glyph): Ditto.
* src/type1/t1load.c (parse_subrs, T1_Open_Face): Ditto.
* src/type1/t1afm.c (T1_Get_Kerning): Ditto.
* include/freetype/cache/ftcmanag.h (ftc_family_table_free): Ditto.
2002-03-07 21:59:59 +00:00
David Turner 9ddeee1d41 formatting 2002-03-06 12:36:22 +00:00
David Turner bc82f1bbef * include/freetype/ftconfig.h: changed FT_LOCAL xxxx to FT_LOCAL( xxxx )
everywhere in the source. Sames goes for FT_LOCAL_DEF xxxx translated
        into FT_LOCAL_DEF( xxxxx )
2002-03-01 02:26:22 +00:00
David Turner 29644179cc still more logical transformations. This time, some public API headers have
been touched, while keeping everything backwards-compatible..

        * include/freetype/t1tables.h: re-naming structure types. This done
        basically:

          typedef T1_Struct_
          {
          } T1_Struct;

        becomes:

          typedef PS_StructRec_
          {
          } PS_StructRec, *PS_Struct;

          typedef PS_StructRec  T1_Struct;  /* backwards-compatibility */


        hence, we increase the coherency of the source code by effectuively
        using the 'Rec' prefix for structure types..
2002-02-28 18:59:37 +00:00
David Turner 4e7eeeec7b yet another logical transformation of the internals to make them
more consistent and understandable..

mainly, changing things like PS_Table  => PS_TableRec + *PS_Table
2002-02-28 16:10:29 +00:00
David Turner 4d57024d1c * moving all code related to glyph loaders to "internal/ftgloadr.h"
and "src/base/ftgloadr.c".

        Note also that the type "FT_GlyphLoader" is now a pointer to the
        structure "FT_GlyphLoaderRec"..
2002-02-24 02:59:24 +00:00
Werner Lemberg b5349a9b75 * builds/freetype.mk (FT_CFLAGS): Use $(INCLUDE_FLAGS) first.
* src/cache/ftccache.c (ftc_cache_resize): Mark `error' as unused
to avoid compiler warning.
* src/cff/cffload.c (CFF_Get_String): Ditto.
* src/cff/cffobjs.c (CFF_StrCopy): Ditto.
* src/psaux/psobjs.c (PS_Table_Done): Ditto.
* src/pcf/pcfread.c (pcf_seek_to_table_type): Ditto.
* src/sfnt/sfdriver.c (get_sfnt_postscript_name): Ditto.
(pcf_get_bitmaps): The same for `sizebitmaps'.
* src/psaux/t1decode.c (T1_Decode_Parse_Charstrings): The same for
`orig_y'.
(t1operator_seac): Comment out more dead code.
* src/pshinter/pshalgo2.c (ps2_hints_apply): Add `DEBUG_HINTER'
conditional.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph,
load_truetype_glyph): Add `TT_CONFIG_OPTION_BYTECODE_INTERPRETER'
conditional.
2002-02-19 16:30:15 +00:00
Werner Lemberg 8880f2c14d * src/cache/ftccache.c (ftc_node_done, ftc_node_destroy): Fix
compilation warnings.
* src/base/descrip.mms (OBJS): Add `ftmm.obj'.
* src/cache/descrip.mms (ftcache.obj): Dependencies added.
2002-01-25 16:05:39 +00:00
David Turner 7c0d20814a * src/cff/cffgload.c, src/psaux/t1decode.c, src/pshinter/pshrec.c,
src/pshinter/ahalgo2.c, src/pshinter/pshglob.h: fixed a bug where
        the X and Y axis where inversed in the postscript hinter. this
        caused problem when displaying on non-square surfaces..
2001-12-21 15:59:43 +00:00
Werner Lemberg c3b2160869 Formatting.
Cleaning up of ChangeLog.

* docs/license.txt: s/X Windows/X Window System/.

* src/raster/ftraster.c: Fix definition condition of MEM_Set().
* src/smooth/ftgrays.c (M_Y): Change value to 192.
* src/base/ftdbgmem.c (ft_mem_table_destroy): Fix printf() parameter.
Remove unused variable.
* src/cache/ftcimage.c (ftc_image_node_init,
ftc_image_node_compare): Remove unused variables.
* src/cache/ftcsbits.c (ftc_sbit_node_weight): Remove unused
variable.
* src/raster/ftraster.c (MEM_Set): Move definition down to avoid
compiler warning.
* src/autohint/ahhint.c (ah_hinter_hint_edges): Use UNUSED() to
avoid compiler warnings.
* src/pcf/pcfread.c (tableNames): Use `const'.
(pcf_read_TOC): Change counter name to avoid compiler warning.
Use `const'.
* src/pshinter/pshrec.c (ps_hints_close): Remove redundant
declaration.
* src/pshinter/pshalgo1.c (psh1_hint_table_init): Rename variables
to avoid shadowing.
* src/pshinter/pshalgo2.c (psh2_hint_table_activate_mask): Ditto.
* src/type1/t1objs.h: Remove double declarations of `T1_Size_Init()'
and `T1_Size_Done()'.
2001-12-05 01:22:05 +00:00
David Turner 5893c1bb2a add support for new postscript hinter 2001-10-18 11:49:26 +00:00
Werner Lemberg ec342907b3 formatting 2001-09-10 06:55:43 +00:00
David Turner 8ab0add6b4 Martin Muskens bufixes:
- reallocation bug in T1_Table_Add
  - increased accuracy of units per EM computation in T1 fonts
  - support "+" as valid font name character (used in embedded fonts)
2001-08-30 07:59:28 +00:00
Werner Lemberg 36af3ea62b * include/freetype/internal/psaux.h (PS_Table): Use FT_Offset for
`cursor' and `capacity'.
* src/psaux/psobjc.c (reallocate_t1_table): Use FT_Long for second
parameter.
(PS_Table_Add): Use FT_Offset for `new_size'.


* src/base/ftsynth.c: Include ftcalc.h unconditionally.
2001-07-17 12:37:54 +00:00
Werner Lemberg a560a1e018 * src/autohint/ahhint.c (ah_hinter_align_weak_points): Remove
unused variable `edges'.
(ah_hinter_load): Remove unused variables `old_width' and
`new_width'.
* src/cid/cidload.c (cid_decrypt): Use `U' for constant (again).
* src/psaux/psobjs.c (T1_Decrypt): Ditto.
* src/type1/t1parse.c (T1_Get_Private_Dict): Ditto.
2001-07-03 12:45:24 +00:00
Werner Lemberg 415235df1b finishing function header formatting
updating copyrights
2001-06-28 17:49:10 +00:00
Werner Lemberg 93616ecb66 next round in function header formatting 2001-06-27 19:46:12 +00:00
Werner Lemberg 99b744164d * src/cid/cidload.c, src/cid/cidload.h (cid_decrypt): Use FT_Offset
instead of FT_Int as type for `length' parameter.
* include/freetype/internal/psaux.h (PSAux_Interface): Updated.


* src/psaux/psobjs.c, src/psaux/psobjs.h (T1_Decrypt): Use FT_Offset
instead of FT_Int as type for `length' parameter.
2001-06-27 17:06:28 +00:00
Werner Lemberg 8eb0353fec Formatting. 2001-06-19 23:03:41 +00:00
David Turner 61f0685683 * include/freetype/fterrors.h: updated some of the error macros to
simplify Werner's latest tricks :o)
2001-06-19 13:41:59 +00:00
David Turner 8edbcabce1 - updated doc for FT_New_Memory_Face
- removed lots of compiler warnings in lint-style
  warning modes (/W4 with Visual C++)
2001-06-19 08:28:24 +00:00
Werner Lemberg cf24d51531 Minor cleanups to remove compiler warnings.
* include/freetype/cache/ftcmanag.h (FTC_MAX_BYTES_DEFAULT): Use
`L' for constant.
* include/freetype/config/ftoption.h (FT_RENDER_POOL_SIZE): Ditto.
* src/base/ftcalc.c (FT_MulDiv): Use `L' for constant.
* src/base/ftglyph.c (FT_Glyph_Get_CBox): Remove `error' variable.
* src/base/fttrigon.c (ft_trig_arctan_table): Use `L' for constants.
* src/base/ftobjs.c (FT_Done_Size): Fix return value.
(FT_Set_Char_Size, FT_Set_Pixel_Sizes, FT_Get_Kerning): Remove
unused `memory' variable.
* src/autohint/ahglyph.c (ah_get_orientation): Use `L' for constant.
* src/autohint/ahhint.c (ah_hint_edges_3,
ah_hinter_align_edge_points): Remove unused `before' and `after'
variables.
(ah_hinter_align_weak_points): Remove unused `edge_limit' variable.
(ah_hinter_load): Remove unused `new_advance', `start_contour',
and `metrics' variables.
* src/cff/cffload.c (CFF_Load_Encoding): Remove dead code to avoid
compiler warning.
* src/cff/cffobjs.c (CFF_Init_Face): Remove unused `base_offset'
variable.
* src/cff/cffgload.c (CFF_Parse_CharStrings): Remove unused
`outline' variable.
(cff_compute_bias): Use `U' for constant.
* src/cid/cidload.c (cid_decrypt): Ditto.
* src/psaux/psobjs.c (T1_Decrypt): Ditto.
* src/psaux/t1decode.c (T1_Decoder_Parse_CharStrings): Ditto.
* src/sfnt/ttload.c (TT_Load_Kern): Remove unused `version'
variable.
* src/sfnt/ttsbit.c (TT_Load_SBit_Image): Remove unused `top'
variable.
* src/truetype/ttgload.c (load_truetype_glyph): Remove unused
`num_contours' and `ins_offset' variables.
(compute_glyph_metrics): Remove unused `Top' and `x_scale'
variables.
(TT_Load_Glyph): Remove unused `memory' variable.
* src/smooth/ftgrays.c (grays_raster_render): Use `L' for constants.
2001-06-18 14:23:45 +00:00
Werner Lemberg 00a2207fd8 Make the new error scheme source compatible with older FT versions
by introducing another layer.

* include/freetype/fterrors.h (FT_ERRORDEF_, FT_NOERRORDEF_): New
macros.
(FT_NOERRORDEF): Removed.
* include/*/*err*.h: Use FT_ERRORDEF_ and FT_NOERRORDEF_.
2001-06-18 10:35:00 +00:00
Werner Lemberg 1f7f0e87e5 Complete redesign of error codes. Please check ftmoderr.h for more
details.

* include/freetype/internal/cfferrs.h,
include/freetype/internal/tterrors.h,
include/freetype/internal/t1errors.h: Removed.  Replaced with files
local to the module.  All extra error codes have been moved to
`fterrors.h'.

* src/sfnt/ttpost.h: Move error codes to `fterrors.h'.

* src/autohint/aherrors.h, src/cache/ftcerror.h, src/cff/cfferrs.h,
src/cid/ciderrs.h, src/pcf/pcferror.h, src/psaux/psauxerr.h,
src/psnames/psnamerr.h, src/raster/rasterrs.h, src/sfnt/sferrors.h,
src/smooth/ftsmerrs.h, src/truetype/tterrors.h,
src/type1/t1errors.h, src/winfonts/fnterrs.h: New files defining the
error names for the module it belongs to.

* include/freetype/ftmoderr.h: New file, defining the module error
offsets.  Its structure is similar to `fterrors.h'.

* include/freetype/fterrors.h (FT_NOERRORDEF): New macro.
(FT_ERRORDEF): Redefined to use module error offsets.
All internal error codes are now public; unused error codes have
been removed, some are new.

* include/freetype/config/ftheader.h (FT_MODULE_ERRORS_H): New
macro.
* include/freetype/config/ftoption.h
(FT_CONFIG_OPTION_USE_MODULE_ERRORS): New macro.

All other source files have been updated to use the new error codes;
some already existing (internal) error codes local to a module have
been renamed to give them the same name as in the base module.

All make files have been updated to include the local error files.


* src/cid/cidtokens.h: Replaced with...
* src/cid/cidtoken.h: This file for 8+3 consistency.

* src/raster/ftraster.c: Use macros for header file names.
2001-06-06 17:30:41 +00:00
Werner Lemberg cbc9938e68 * builds/os2/*.mk: These files have been forgotten to update to
the structure of similar makefiles.
* builds/dos/*.mk: Ditto.
* builds/ansi/*.mk: Ditto.

* builds/win32/win32-def.mk (BUILD): Fix typo.

* builds/compiler/*.mk (CLEAN_LIBRARY): Don't use NO_OUTPUT.
This is already used in the link_*.mk files.


* src/*/Jamfile: Slight changes	to make files more cryptic.
2001-04-06 07:05:50 +00:00
Werner Lemberg a1844e0927 * Jamfile, src/Jamfile, src/*/Jamfile: Formatted. Slight changes
to give files identical structure.
2001-04-03 21:07:36 +00:00
Werner Lemberg 1429db6c4f * README: Formatting.
* Jamfile: Fix typo.

* src/cff/cffparse.c: Move error code #defines to...
* include/freetype/internal/cfferrs.h: This file.
* src/cff/cffdrivr.c, src/cff/cffobjs.c, src/cff/cffload.c: Replaced
`FT_Err_*' with `CFF_Err_*'.
* src/cid/cidparse.c: Replaced `FT_Err_*' with `T1_Err_*'.
* src/psaux/psobjs.c, src/psaux/t1decode.c: Ditto.
* src/sfnt/sfobcs.c, src/sfnt/ttload.c: Replaced `FT_Err_*' with
`TT_Err_*'.
* src/truetype/ttgload.c, src/truetype/ttobjs.c: Ditto.
* src/type1/t1gload.c, src/type1/t1load.c, src/type1/t1objs.c,
src/type1/t1parse.c: Replaced `FT_Err_*' with `T1_Err_*'.

* include/freetype/internal/cfferrs.h: Add
`CFF_Err_Unknown_File_Format'.
* include/freetype/internal/t1errors.h: Add
`T1_Err_Unknown_File_Format'.
* include/freetype/internal/tterrors.h: Add
`TT_Err_Unknown_File_Format'.

* src/cff/cffload.h: Add `cff_*_encoding' and `cff_*_charset'
references.
* src/psaux/psobjs.c: Include `FT_INTERNAL_TYPE1_ERRORS_H'.

* src/cff/cffobjs.c (CFF_Init_Face, CFF_Done_Face): Use
FT_LOCAL_DEF.
* src/cid/cidobjs.c (CID_Done_Driver): Ditto.
* src/trutype/ttobjs.c (TT_Init_Face, TT_Done_Face, TT_Init_Size):
Ditto.
* src/type1/t1objs.c (T1_Done_Driver): Ditto.
* src/pcf/pcfdriver.c (PCF_Done_Face): Ditto.
* src/pcf/pcf.h: Use FT_LOCAL for `PCF_Done_Face'.
2001-04-02 23:54:01 +00:00
David Turner 5bf0a39485 * Jamrules, Jamfile, src/Jamfile, src/*/Jamfile: Adding jamfiles
to the source tree. see www.freetype.org/jam/index.html for details
2001-03-24 17:10:09 +00:00
David Turner 8d3a401fa8 * builds/*/*-def.mk: changed the objects directory from "obj" to "objs"
* include/freetype/config/ftheader.h: removed obsolete macros like
	FT_SOURCE_FILE, etc.. and added cache-specific macro definitions that
	were previously defined in <freetype/ftcache.h>. Added comments to be
	included in a new API Reference section.

	* src/*/*: removed the use of FT_SOURCE_FILE, etc.. now, each component
	needs to added its own directory to the include path at compile time.
	Modified all "rules.mk" and "descrip.mms" accordingly..
2001-03-20 11:14:24 +00:00
Werner Lemberg 9a8b536fb9 * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Fix error
messages.

* INSTALL, docs/BUILD: We need GNU make 3.78.1 or newer.
2001-03-12 22:33:52 +00:00
Tom Kacvinsky 9b59f2c385 In function T1_Decoder_Parse_Charstrings, take into account lenIV seed
bytes at the start of a decrypted subroutine.
2001-03-12 01:42:38 +00:00
Werner Lemberg 914b289f16 * src/*/*.c: Added many casts to make code more 64bit-safe. 2001-03-10 17:07:42 +00:00
Werner Lemberg e56b411f32 * src/psaux/psobjs.c (shift_elements): Remove if clause (which is
obsolete now).

(reallocate_t1_table, PS_Table_Done): Replace REALLOC() with ALLOC()
+ MEM_Copy() to avoid a memory bug.
2001-02-03 04:34:53 +00:00
Werner Lemberg c3e987e2aa * builds/vms: Support files for VMS architecture added.
* descrip.mms, src/*/descrip.mms: VMS makefiles added.
* README.VMS: New file.


* LICENSE.TXT: Added info about PCF driver license.
2001-01-03 06:47:10 +00:00
David Turner 170c0d4c0d * include/freetype/config/ft2build.h,
include/freetype/internal/internal.h: fixed header inclusion macros
	to use direct definitions. This is the only way to do these things
	in a portable way :-( The rest of the code should follow shortly
	though everything compiles now..

	* builds/compiler/intelc.mk, builds/compiler/watcom.mk,
	builds/win32/detect.mk: added support for the Intel C/C++ compiler,
	as well as _preliminary_ (read: doesn't work !!) support for Watcom.
	Also added a new setup target. Type "make setup list" for a list
	of supported command-line compilers on Win32..
2000-12-13 19:55:11 +00:00
Werner Lemberg d5c1b27d58 * include/freetype/config/ft2build.h (FT2_ROOT, FT2_CONFIG_ROOT):
Removed.  ANSI C doesn't (explicitly) allow macro expansion in
arguments using `##'.
(FT2_PUBLIC_FILE, FT2_CONFIG_FILE, FT2_INTERNAL_FILE): Use directory
names directly.  Make them configurable.  Use `##' to strip leading
and trailing spaces from arguments.

* builds/unix/ft2unix.h: Adapted.

* src/base/ftsystem.c (ft_alloc, ft_realloc, ft_free, ft_io_stream,
ft_close_stream): Use FT_CALLBACK_DEF.

* builds/unix/ftsystem.c: Use new header scheme.
(FT_Done_Memory): Use free() from FT_Memory structure.

* src/base/ftinit.c, src/base/ftmac.c: Header scheme fixes.

* include/freetype/config/ft2build.h (FT2_CONFIG_ROOT,
FT2_PUBLIC_FILE, FT2_CONFIG_FILE, FT2_INTERNAL_FILE,
FT_SOURCE_FILE): Use `##' operator to be really ANSI C compliant.
2000-12-12 22:28:12 +00:00
Werner Lemberg 90d9964ec9 * */*.h: Changed body inclusion macro names to start and end with
`__' (those which haven't converted yet).  Fixed minor conversion
issues.

* src/winfonts/winfnt.c: Updated to new header inclusion scheme.

* */*.[ch]: Changed source files to adhere to the new
* src/cff/cff.c, src/cff/rules.mk: Updated.

* */*.[ch]: Now using <ft2build.h> as the default build and setup
2000-12-09 00:45:38 +00:00
Werner Lemberg cc069beb2d cleanups 2000-12-08 16:17:16 +00:00
David Turner 19ed8afe60 - updated all source files to adhere to the new inclusion scheme
- the CFF loader now loads the encodings and charset tables
  though doesn't use them for now
2000-12-08 02:42:29 +00:00
Werner Lemberg 33d023680f * builds/module.mk: Replaced `xxx #' with `xxx$(space).
* builds/os2/detekt.mk, builds/win32/detekt.mk: Moved comment to
avoid trailing spaces in variable.
* builds/freetype.mk: Use $(D) instead of $D to make statement more
readable.

* docs/docmaker.py: Formatting.

* src/psaux/psauxmod.c: Fixed a broken inclusion of component
header files (an FT_FLAT_COMPILE test was missing).
* src/cache/ftcmanag.c (FTC_Manager_Done): Fixed a bug that caused
an occasional crash when the function was called (due to a dangling
pointer).
* src/base/ftsystem.c (FT_Done_Memory): Fixed an obvious bug:
The ANSI "free()" function was called instead of "memory->free()".
* docs/docmaker.py: Added section filtering, multi-page generation
(index page generation is still missing though).
* builds/unix/install.mk, builds/unix/ft2unix.h: The file "ft2unix.h"
is now installed as <ft2build.h> for Unix systems.  Note that we
still use the "freetype2/freetype" installation path for now.

* many files: Now using <ft2build.h> as the default build and setup
configuration file in all public headers.  Internal source files
still need some changes though.
* builds/devel/ft2build.h, builds/devel/ftoption.h: Created a new
Win32 developer builds.
builds/win32/w32-dev.mk: Changed the developer build targets to
"devel-gcc" and "devel-bcc" in order to be able to develop with the
Borland C++ compiler.
2000-12-06 16:31:30 +00:00
David Turner 00004eef27 fixed a broken inclusion of header files (a FT_FLAT_COMPILE test
was missing !!)
2000-12-05 22:28:15 +00:00
Werner Lemberg 8c883fb542 minor fixes.
Add more gcc warnings for development on UNIX.
2000-11-05 23:41:08 +00:00
Werner Lemberg dc72aff43d Finishing David's latest changes (there were some errors in it). 2000-11-04 08:33:38 +00:00
David Turner 54e7574946 defining new types to hold "internal" fields of public
objects:

  FT_Face_Internal, FT_Size_Internal, FT_Slot_Internal

these contain some fields that may change between releases
of FreeType, without affecting the size of FT_FaceRec,
FT_SizeRec, FT_GlyphSlotRec, etc.., which means that
drivers wouldn't need to be recompiled if we only add new
fields to an internal structure..

I plan to hack a few things related to the auto-hinter and
I need this move to ensure that we will not break binary
compatibility between 2.0 and 2.1 :-)

- David
2000-11-04 02:52:02 +00:00
David Turner 76a5f62323 major reformatting of the sources:
FT_EXPORT_DEF    => FT_EXPORT
  FT_EXPORT_FUNC => FT_EXPORT_DEF
  BASE_DEF               => FT_BASE
  BASE_FUNC            => FT_BASE_DEF
  LOCAL_DEF             => FT_LOCAL
  LOCAL_FUNC          => FT_LOCAL_DEF
  LOCAL_FUNC_X     => FT_CALLBACK_DEF
  LOCAL_DEF_X       => FT_CALLBACK_TABLE
  FT_CPLUSPLUS     => FT_CALLBACK_TABLE_DEF
2000-11-04 01:55:49 +00:00
Werner Lemberg e4b32a5dc5 Removing trailing whitespace. 2000-10-31 20:42:18 +00:00
Werner Lemberg ddbb8e7b6a Some formatting.
Fixed some data types/added header files to remove compiler warnings.

Added trivial input data check to FT_Outline_Get_BBox().

Fixed type1z -> type1 file inclusions.
2000-10-26 10:04:16 +00:00
Werner Lemberg 47a5f41de6 Added copyright messages to all Makefiles.
Added documentation to FT_Get_Sfnt_* stuff (in ftnames.[ch])

minor other doc fixes
2000-10-17 03:38:43 +00:00
David Turner b89fb71ce6 fixed a subtle 64-bit problem that only appears with
Compaq C compiler (though it's really a bug)
2000-10-11 23:39:03 +00:00
Werner Lemberg eadc8df24d A fix from Tom to fix the last=first point problem if it is a control point. 2000-10-11 05:52:42 +00:00
Werner Lemberg 0634cedb62 patch from Tom to fix a problem with path_begun. 2000-10-09 01:44:40 +00:00
Werner Lemberg 8925009f79 Adding missing code for flat compiling mode. 2000-09-26 13:25:15 +00:00
Werner Lemberg 4a5c142a40 Minor fixes. 2000-08-29 18:37:25 +00:00
Werner Lemberg 4e9dae68b7 Introducing new macro LOCA_VAR to solve some problems with structures
containing function pointers.

FT will now compile again with C++.
2000-08-29 16:50:01 +00:00
Just van Rossum 9b4bb291d9 #include <freetype/internal/ftdebug.h> /* for FT_ERROR() */ 2000-08-25 20:00:58 +00:00
Werner Lemberg d1b7475be1 Formatting, small fixes.
Adding basic input parameter checking for exported functions.
2000-08-24 16:29:15 +00:00
Just van Rossum 4a47f668a1 fixed typo in FT_FLAT_COMPILE section 2000-08-24 00:43:08 +00:00
David Turner fcf5e68650 renamed "psmodule.c" to "psauxmod.c" 2000-08-24 00:30:24 +00:00
David Turner 34f1c2f5f4 finally, the CID and Type1z driver are finished !!
Werner, please have a look at the code and start
re-formatting it :-)
2000-08-23 22:47:44 +00:00
Werner Lemberg 8728f294bc Formatting, small fixes.
Adding copyright notices etc.
2000-08-23 17:32:42 +00:00
David Turner a39acf55f7 updated "psaux" and "type1z".
The Type 1 driver now completely relies on "psaux". I
now need to change the CID driver accordingly, then
finally move the Type 2 parsing routines to "psaux"
when appropriate..
2000-08-23 02:47:57 +00:00
David Turner 9748807412 the psaux module is now nearly completed
the "type1z" driver uses it to parse Type 1 charstrings
(not to parse the Type 1 token stream yet though)..
2000-08-22 22:36:33 +00:00
David Turner f95a603117 minor updates to the "psaux" module.
Werner, please do not start re-formatting my experimental
code until I declare it "finished", because I still make big
changes to it that create lots of CVS conflicts..

thanks for your work, anyway :-)
2000-08-21 04:58:49 +00:00
Werner Lemberg b1c8bf0683 Minor formatting.
Adding copyright/C++ guards to psaux files.
2000-08-17 07:18:04 +00:00
David Turner 24d7024c44 added draft "psaux" code
the t1 driver now reads the complete font matrix

and applies it (some fonts do not work properly without
hinting though...)
2000-08-17 01:09:06 +00:00