Commit Graph

548 Commits

Author SHA1 Message Date
Werner Lemberg b66efefdcd Fix some FreeType Coverity issues as reported for Ghostscript.
* src/base/ftobjs.c (FT_New_Face, FT_New_Memory_Face): Initialize
`args.stream' (#3874, #3875).
(open_face_PS_from_sfnt_stream): Improve error management (#3786).
* src/base/ftmm.c (ft_face_get_mm_service): Fix check of `aservice'
(#3870).
* src/base/ftstroke.c (ft_stroke_border_get_counts): Remove dead
code (#3790).
* src/base/ftrfork.c (raccess_guess_apple_generic): Check error
value of `FT_Stream_Skip' (#3784).

* src/type1/t1gload.c (T1_Load_Glyph): Check `size' before accessing
it (#3872)

* src/pcf/pcfdrivr.c (PCF_Glyph_Load): Check `face' before accessing
it (#3871).
* src/pcf/pcfread.c (pcf_get_metrics): Handle return value of
`pcf_get_metric' (#3789, #3782).
(pcf_get_properties): Use FT_STREAM_SKIP (#3783).

* src/cache/ftcmanag.c (FTC_Manager_RegisterCache): Fix check of
`acache' (#3797)

* src/cff/cffdrivr.c (cff_ps_get_font_info): Fix check of `cff'
(#3796).
* src/cff/cffgload.c (cff_decoder_prepare): Check `size' (#3795).
* src/cff/cffload.c (cff_index_get_pointers): Add comment (#3794).

* src/bdf/bdflib.c (_bdf_add_property): Check `fp->value.atom'
(#3793).
(_bdf_parse_start): Add comment (#3792).

* src/raster/ftraster.c (Finalize_Profile_Table): Check
`ras.fProfile' (#3791).

* src/sfnt/ttsbit.c (Load_SBit_Image): Use FT_STREAM_SKIP (#3785).

* src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Properly ignore
seek error (#3781).
2009-03-12 08:07:49 +00:00
Werner Lemberg 15b60bb513 Formatting, copyright years. 2009-03-03 21:35:32 +00:00
David Turner 01ca4da203 Remove ABI-breaking field in public PS_InfoFontRec definition.
Instead, we define a new internal PS_FontExtraRec structure to
    hold the additionnal field, then place it in various internal
    positions of the corresponding FT_Face derived objects.
2009-03-03 13:28:59 +00:00
Werner Lemberg 1ad384d881 Set `face_index' field in FT_Face for all font formats.
* cff/cffobjs.c (cff_face_init), winfonts/winfnt.c (FNT_Face_Init),
sfnt/sfobjs.c (sfnt_init_face): Do it.

* docs/CHANGES: Document it.
2008-12-25 23:52:00 +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 05bf6877a4 * docs/CHANGES: Updated.
Provide API for accessing embedding and subsetting restriction
information.

* include/freetype.h (FT_FSTYPE_INSTALLABLE_EMBEDDING,
FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING,
FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING, FT_FSTYPE_EDITABLE_EMBEDDING,
FT_FSTYPE_NO_SUBSETTING, FT_FSTYPE_BITMAP_EMBEDDING_ONLY): New
macros.
(FT_Get_FSType_Flags): New function declaration.

* src/base/ftobjs.c (FT_Get_FSType_Flags): New function.

* src/cid/cidtoken.h, src/type1/t1tokens.h, src/type42/t42parse.c
(t42_keywords): Handle `FSType'.

* include/freetype/t1tables.h (PS_FontInfoRec): Add `fs_type' field.
2008-12-18 06:32:10 +00:00
Werner Lemberg 1a5d561dce * src/autofit/afcjk.c, src/base/ftoutln.c, src/base/ftrfork.c,
src/bdf/bdfdrivr.c, src/gxvalid/gxvmorx.c, src/otvalid/otvmath.c,
src/pcf/pcfdrivr.c, src/psnames/pstables.h, src/smooth/ftgrays.c,
src/tools/glnames.py, src/truetype/ttinterp.c, src/type1/t1load.c,
src/type42/t42objs.c, src/winfonts/winfnt.c: Fix compiler warnings
(Atari PureC).
2008-11-29 22:50:24 +00:00
Werner Lemberg 8f9b7f50a5 * src/type/t1load.c (mm_axis_unmap): Revert previous patch and fix
it correctly by using FT_INT_TO_FIXED (FreeType expects 16.16 values
in the /BlendDesignMap space).
2008-11-29 17:35:58 +00:00
Werner Lemberg b2cb6ce6c4 * src/type1/t1load.c (mm_axis_unmap): `blend_points' is FT_Fixed*,
whereas `design_points' is FT_Long*.  Therefore, return blend rather
than design points.
2008-11-29 09:32:12 +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 fa9d39940e Fix Savannah bug #24485.
* src/type1/t1load.c (parse_charstrings): Assure that we always have
a .notdef glyph.
2008-10-08 16:04:46 +00:00
Werner Lemberg d03d856d95 * src/truetype/ttobjs.c (tt_face_done), src/cff/cffobjs.c
(cff_face_done), src/pfr/pfrobjs.c (pfr_face_done),
src/pcf/pcfdrivr.c (PCF_Face_Done), src/cid/cidobjs.c
(cid_face_done), src/bdf/bdfdrivr. (BDF_Face_Done),
src/sfnt/sfobjs.c (sfnt_face_done): Protect against face == 0.
Reported by Graham Asher.
2008-10-01 22:39:05 +00:00
Werner Lemberg 6bc16e92e4 s/synthetize/synthesize/ 2008-10-01 21:16:44 +00:00
Werner Lemberg ed6c0e063c Fix Savannah bug #24179, reported by Bram Tassyns.
* src/type1/t1load.c (mm_axis_unmap, T1_Get_MM_Var): Fix computation
of default values.


* src/tools/glnames.py (main): Surround `ft_get_adobe_glyph_index'
and `ft_adobe_glyph_list' with FT_CONFIG_OPTION_ADOBE_GLYPH_LIST to
prevent unconditional definition.  This fixes Savannah bug #24241.

* src/psnames/pstables.h: Regenerated.
2008-09-15 07:49:40 +00:00
Werner Lemberg b211651ac9 * autogen.sh, builds/unix/configure.raw,
include/freetype/config/ftconfig.h, builds/unix/ftconfig.in: Minor
beautifying.

* include/freetype/ftadvanc.h, include/freetype/ftgasp.h,
include/freetype/ftlcdfil.h: Protect against FreeType 1.
Some other minor fixes.

* devel/ftoption.h: Synchronize with
include/freetype/config/ftoption.h.

Formatting, documentation improvements.
2008-09-12 16:27:48 +00:00
David Turner 28534d616b * include/freetype/ftadvanc.h, src/base/ftadvanc.c,
include/freetype/config/ftheader.h, include/freetype/freetype.h,
    src/base/Jamfile, src/base/rules.mk, src/cff/cffdrivr.c,
    src/cff/cffgload.c, src/cff/cffgload.h, src/truetype/ttdriver.c,
    src/truetype/ttgload.h, src/truetype/ttgload.c, src/type1/t1driver.c,
    src/type1/t1gload.h, src/type1/t1gload.c:
    Add a new header named FT_ADVANCES_H declaring some new APIs
    to extract the advances of one or more glyphs without necessarily
    loading their outlines. Also provide 'fast loaders' for the
    TrueType, Type1 and CFF font drivers (more to come later)

    * autogen.sh: add checks for minimum version of the 'autotools'
    stuff.
2008-09-01 21:35:21 +00:00
Werner Lemberg 4dbf00aa23 * src/type1/t1load.c (parse_encoding): Protect against infinite
loop.  This fixes Savannah bug #24150 (where a patch has been posted
too).
2008-08-28 16:12:48 +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 7fd201829a * src/type1/t1tokens.h: Handle `ForceBold' keyword. This fixes
Savannah bug #23995.

* src/cid/cidload.c (parse_expansion_factor): New callback function.
(cid_field_records): Use it for `ExpansionFactor'.
* src/cod/cidtoken.h: Handle `ForceBold' keyword.
Don't handle `ExpansionFactor'.
2008-08-04 18:46:37 +00:00
Werner Lemberg cd6dcca658 * src/type/t1objs.c (T1_Face_Init): Slightly improve algorithm. 2008-06-19 06:20:21 +00:00
Werner Lemberg d57a5e9fff * src/type/t1objs.c (T1_Face_Init): Fix change from 2008-03-21.
Reported by Peter Weilbacher <mozilla@weilbacher.org>.

* docs/CHANGES: Updated.
2008-06-18 06:16:39 +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 16dc51feae * src/base/ftdebug.c (FT_Message, FT_Panic): Send output to stderr.
This fixes Savannah bug #23280.

* docs/CHANGES: Updated.

Some formatting.
2008-05-18 17:36:15 +00:00
David Turner c567ff279b add missing comment 2008-05-18 14:32:51 +00:00
Werner Lemberg 504645ed5b * src/type1/t1load.c (parse_subrs): Accept fonts with a subrs array
which contain a single but empty entry.  This is technically
invalid (since it must end with `return', but...)

Reported by Martin McBride.
2008-05-14 23:26:20 +00:00
Werner Lemberg 8575117c50 * src/type1/t1objs.c (T1_Face_Init): Use `/Weight'. Patch from
Savannah bug #22675.
2008-03-21 07:16:00 +00:00
Werner Lemberg 9fe5815c97 * src/type1/t1load.c (parse_encoding): Handle one more error. 2007-06-19 07:57:30 +00:00
Werner Lemberg 470210b73c * src/winfonts/winfnt.c (fnt_face_get_dll_font): Do a rough check of
`font_count'.


* src/type1/t1load.c (parse_font_matrix): Check `temp_scale'.


* src/cff/cffgload.c (cff_decoder_prepare): Change return type to
`FT_Error'.
Check `fd_index'.
(cff_slot_load): Updated.
* src/cff/cffgload.h: Updated.
2007-06-06 10:05:49 +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 3d507fefe8 * src/base/ftobjs.c (destroy_charmaps), src/type1/t1objs.c
(T1_Face_Done), src/winfonts/winfnt.c (FNT_Face_Done): Check for
face == NULL.  Suggested by Graham Asher.
2007-06-03 16:54:55 +00:00
Werner Lemberg ba03af6f91 * src/type1/t1load.c (parse_subrs, parse_charstrings): Protect
against too small binary data strings.

* src/bdf/bdflib.c (_bdf_parse_glyphs): Check `STARTCHAR' better.
2007-05-30 13:57:02 +00:00
David Turner 085bc6e2b2 fix bug in the PFM parser: kerning values must be read as 16-bit *signed* values 2007-03-05 17:40:03 +00:00
Werner Lemberg 442bfb8913 Formatting, copyright years, s/memcpy/ft_memcpy/. 2007-02-12 21:44:10 +00:00
David Turner c0f9c4aadd introduce ft_mem_dup, ft_mem_strdup and ft_mem_strcpyn, and the corresponding
macros to use them (e.g. FT_STRDUP, FT_DUP and FT_STRCPYN)

modify the code to use them instead of raw mallocs/strcpy
2007-02-12 14:55:03 +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
Werner Lemberg 281c148621 * src/type1/t1afm.c (T1_Read_Metrics): MS Windows allows PFM
versions up to 0x3FF without complaining.
2007-01-13 22:50:51 +00:00
Werner Lemberg 17432b5e37 * src/type1/t1load.c (is_space): Removed.
(parse_encoding, parse_charstrings): Use IS_PS_DELIM.
(parse_charstrings): Use IS_PS_TOKEN.


* autogen.sh: Avoid bash specific syntax.
2007-01-12 09:28:44 +00:00
Werner Lemberg bf02d396ca * src/type1/t1load.c (T1_Get_MM_Var): Always return fixed point
values.
2007-01-10 07:07:37 +00:00
Werner Lemberg 913a365090 Because FT_Load_Glyph expects CID values for CID-keyed fonts, the
test for a valid glyph index must be deferred to the font drivers.
This patch fixes Savannah bug #18301.

* src/base/ftobjs.c (FT_Load_Glyph): Don't check `glyph_index'.
* src/bdf/bdfdrivr.c (BDF_Glyph_Load), src/cff/cffgload.c
(cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph),
src/pcf/pcfdrivr.c (PCF_Glyph_Load), src/pfr/pfrobjs.c
(pfr_slot_load), src/truetype/ttdriver.c (Load_Glyph),
src/type1/t1gload.c (T1_Load_Glyph), src/winfonts/winfnt.c
(FNT_Load_Glyph): Check validity of `glyph_index'.
2006-11-19 09:19:17 +00:00
Werner Lemberg 1234299620 formatting 2006-08-19 11:18:09 +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 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
David Turner 5f1f75076c Fix memory leak described in Savannah bug #16768
* src/type1/t1afm.c (T1_Read_Metrics): fix memory leak
  which happened when the metrics file doesn't have kerning
  pairs.
2006-06-07 05:11:50 +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 5a73d8d20f * builds/freetype.mk (CACHE_DIR, CACHE_H): Remove.
(FREETYPE_H): Updated.

* src/cache/rules.mk (CACHE_H_DIR): Remove.
(CACHE_DRV_H): Updated.

Formatting, copyright years.
2006-03-20 16:55:32 +00:00
David Turner da95af6cf6 * builds/win32/visualc/freetype.dsp: updating the project file, adding
missing base source files (e.g. ftstroke.c, ftxf86.c, etc...)

    * src/autofit/afcjk.c, src/autofit/aflatin.c, src/base/ftobjs.c,
    src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrobjs.c,
    src/sfnt/sfobjs.c, src/sfnt/ttmtx.c, src/truetype/ttpload.c,
    src/truetype/ttpload.h, src/type1/t1afm.c, src/type1/t1objs.c:
      removing compiler warnings when building with Visual C++ 6 and /W4
2006-03-20 13:32:33 +00:00
Werner Lemberg 422d2a052a formatting, copyright years 2006-02-27 18:25:22 +00:00
David Turner c13e75fb1b * src/base/ftutil.c: ft_mem_alloc and related functions now return an
error if a negative size is passed in parameters.

    * src/cache/ftccache.c: make ftc_node_destroy FT_BASE_DEF, it needs to
    be exported for rogue clients

    * src/pshinter/pshglob.c: prevent problems with malformed fonts which
    have an odd number of blue values (these are broken according to the
    specs).

    * src/cff/cffload.c, src/type1/t1load.c: modify the loaders to force
    even-ness of 'num_blue_values'. Also change the CFF loader so that
    invalid entries in index files are ignored.
2006-02-27 13:14:42 +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
Wu, Chia-I (吳佳一) 0d565fdc1d * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): Remove
unused `max_points' and `max_contours'.

* src/cid/cidobjs.c (cid_face_init), src/type1/t1objs.c
(T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Update.

* include/freetype/internal/tttypes.h (TT_FaceRec): Remove unused
`max_components'.

* src/truetype/ttinterp.h (TT_ExecContextRec): Remove unused
`loadSize' and `loadStack'.

* src/truetype/ttinterp.c (TT_Done_Context, TT_Load_Context),
src/sfnt/ttload.c (tt_face_load_maxp): Update.

* src/cff/cffobjs.h (cff_size_select), src/sfnt/sfdriver.c
(sfnt_interface), src/truetype/ttdriver.c (tt_size_request): Fix
compiler errors/warnings when TT_CONFIG_OPTION_EMBEDDED_BITMAPS is not
defined.

* src/sfnt/ttmtx.c (tt_face_load_hmtx, tt_face_get_metrics): Fix
possible segment faults for the non-FT_OPTIMIZE_MEMORY'ed versions.
(finally!)

For most OpenType tables, `tt_face_load_xxxx' simply loads the table
and `face->root' is set later in `sfnt_load_face'.  Here, we try to
make this work for _all_ tables.

* src/sfnt/ttsbit.c, src/sfnt/ttsbit0.c, src/sfnt/ttload.c,
src/sfnt/ttmtx.c: all `tt_face_load_xxxx' should load the table and
then exit.  Error handling or setting face->root is done later in
`sfnt_load_face'.
Pretty trace messages.

* src/sfnt/sfobjs.c (sfnt_load_face): Work harder.
Mac bitmap-only fonts are not scalable.
Check that `face->header.Units_Per_EM' is not zero.
(LOAD_, LOADM_): Pretty trace messages.

* src/sfnt/ttsbit0.c (tt_face_load_strike_metrics): Read metrics from
`eblc'.

* src/sfnt/ttcmap.c (tt_face_build_cmaps), src/sfnt/ttpost.c
(load_format_20, load_format_25, tt_face_get_ps_name): Use
face->max_profile.numGlyphs, instead of face->root.num_glyphs.
2006-02-15 07:44:31 +00:00
Werner Lemberg 5225402a52 * include/freetype/ftoutln.h (FT_Outline_Embolden): Mention in
documentation that negative strength values are possible.
Give an example call.

* include/freetype/freetype.h (FT_GlyphSlotRec): Improve
documentation of `outline' field.

* src/sfnt/sfobjc.s: Inckude FT_INTERNAL_DEBUG_H.
* src/sfnt/sfdriver.c: Include ttmtx.h.

* src/autofit/afcjk.c: Include aftypes.h and aflatin.h.
2006-02-15 06:05:52 +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 (吳佳一) 5d146851df * src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c
(cid_face_init), src/pfr/pfrobjs.c (pfr_face_init), src/type1/t1objs.c
(T1_Face_Init): Set face->height to
MAX(1.2 * units_per_EM, ascender - descender).
2006-01-31 10:29:44 +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
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
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 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
Wu, Chia-I (吳佳一) ea1e8d3a53 * include/freetype/internal/ftobjs.h, src/base/ftobjs.c,
src/bdf/bdfdrivr.c, src/cff/cffgload.c, src/cid/cidgload.c,
src/pcf/pcfdrivr.c, src/type1/t1gload.c, src/winfonts/winfnt.c:
s/ft_fake_vertical_metrics/ft_synthesize_vertical_metrics/.

* docs/CHANGES: Mention that vertical metrics are synthesized for
fonts not having this info.
2006-01-15 15:01:45 +00:00
Wu, Chia-I (吳佳一) ce5ee00d02 copyright year updates. 2006-01-15 06:32:57 +00:00
Wu, Chia-I (吳佳一) 212aee0d6e * include/freetype/internal/ftobjs.h (ft_fake_vertical_metrics),
src/base/ftobjs.c (ft_fake_vertical_metrics): New function to fake the
vertical metrics.

* src/cff/cffgload.c, src/cid/cidgload.c, src/pcf/pcfdrivr.c,
src/type1/t1gload.c, src/winfonts/winfnt.c: Fake the vertical metrics.
The fake metrics is monotone.

* src/truetype/ttgload.c (compute_glyph_metrics): Some fixes and
formattings in vertical metrics faking.  There are still rooms for
improvements (and so do the CFF module).
2006-01-15 06:24:53 +00:00
Werner Lemberg f1c2b91e14 Formatting, copyright year updates.
Decorate long constants with `L' and `UL' where appropriate.
2006-01-13 14:53:28 +00:00
Wu, Chia-I (吳佳一) fa7d6ab217 * include/freetype/internal/sfnt.h (SFNT_Interface): New method
`load_strike_metrics' used to load the strike's metrics.

* src/sfnt/sfdriver.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
src/sfnt/ttsbit0.c: New function `tt_face_load_strike_metrics'.

* src/pfr/pfrobjs.c (pfr_face_init): Set FT_Bitmap_Size correctly.

* src/winfonts/winfnt.c (FNT_Face_Init): Use `nominal_point_size' for
nominal size unless it is obviously incorrect.

* include/freetype/freetype.h (FT_Bitmap_Size): Update the comments on
FNT driver.


Introduce new size selection interface.

* include/freetype/internal/ftdriver.h (struct FT_Driver_ClassRec_):
Replace `set_char_sizes' and `set_pixel_sizes' by `request_size' and
`select_size'.

* include/freetype/freetype.h (FT_Select_Size, FT_Size_Request_Type,
FT_Size_Request, FT_Request_Size, FT_Select_Size), src/base/ftobjs.c
(FT_Select_Size, FT_Request_Size): API additions to export the new
size selection interface.

* src/base/ftobjs.c (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Use
`FT_Request_Size'.

* include/freetype/internal/ftobjs.h (FT_Match_Size),
src/base/ftobjs.c (FT_Match_Size): New function to match a size
request against `available_sizes'.  Drivers supporting bitmap strikes
can use this function to implement `request_size'.

* src/bdf/bdfdrivr.c, src/cid/cidobjs.c, src/cid/cidobjs.h,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type1/t1objs.h, src/type42/t42drivr.c,
src/type42/t42objs.c, src/type42/t42objs.h, src/winfonts/winfnt.c:
Update to new size selection interface.

* src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/truetype/ttdriver.c, src/truetype/ttgload.c,
src/truetype/ttobjs.c, src/truetype/ttobjs.h: Update to new size
selection interface.
Make `strike_index' FT_ULong and always defined.
Use `load_strike_metrics' provided by SFNT interface.
2006-01-13 12:21:31 +00:00
Wu, Chia-I (吳佳一) dcb8b7103f * include/freetype/internal/ftobjs.h (ft_glyphslot_grid_fit_metrics),
src/base/ftobjs.c (ft_glyphslot_grid_fit_metrics): Removed.

* src/base/ftobjs.c (ft_recompute_scaled_metrics): Do not round.

* src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
(cid_slot_load_glyph), src/truetype/ttgload.c (compute_glyph_metrics),
src/type1/t1gload.c (T1_Load_Glyph): Do not round glyph metrics.

* doc/CHANGES: Mention the changes.
2005-12-16 14:27:14 +00:00
Werner Lemberg 6c99045972 * src/sfnt/ttload.c (tt_face_load_metrics): Ignore excess number
of metrics instead of aborting.  Patch suggested by Derek Noonburg.

* src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
(cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph): Scale
the glyph properly if no hinter is available.

* docs/CHANGES: Mention scaling bug.
2005-11-18 21:10:59 +00:00
Werner Lemberg ea4c3dc485 * src/type1/t1afm.c (T1_Read_PFM): Zero offset means `no kerning
table available'.  From Sergey Tolstov <stolstov@esri.com>.
2005-11-08 09:10:16 +00:00
Werner Lemberg 7734a1f720 Add FT_FACE_FLAG_HINTER to indicate that a specific font driver has
a hinting engine of its own.

* include/freetype/freetype.h (FT_FACE_FLAG_HINTER): New macro.

* src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c
(cid_face_init), src/truetype/ttobjs.c (tt_face_init)
[TT_CONFIG_OPTION_BYTECODE_INTERPRETER], src/type1/t1objs.c
(T1_Face_Init), src/type42/t42objs.c (T42_Face_Init)
[TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Update face flags.

* docs/CHANGES: Document it.
2005-10-05 15:18:29 +00:00
Werner Lemberg 7b33dca43c Formatting. 2005-06-23 20:31:48 +00:00
Wu, Chia-I (吳佳一) 8cfb220eb9 * include/freetype/internal/ftobjs.h, src/base/ftobjs.c: New function
ft_glyphslot_grid_fit_metrics.

* src/truetype/ttgload.c (compute_glyph_metrics): Use
ft_glyphslot_grid_fit_metrics.

* src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
(cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph): Use
ft_glyphslot_grid_fit_metrics.
FT_Outline_Get_CBox is called twice.

* src/base/ftsynth.c (FT_GlyphSlot_Embolden): Modify metrics to more
reasonable values when emboldening outline glyphs.  The theoretic
ones are unrealistic.
2005-06-20 09:04:50 +00:00
Werner Lemberg 60a04df7b0 Add license. 2005-06-04 23:04:30 +00:00
Werner Lemberg e7602c4b4a * src/type1/t1load.c (parse_charstrings): Catch this non-standard
beginning of the /CharStrings dictionary:

  /CharStrings 118 dict def
  Private begin
  CharStrings begin
2005-04-14 11:43:40 +00:00
Werner Lemberg 730b7b1f79 * src/type1/t1parse.c (T1_New_Parser): Relax the check for a valid
first line in the font.
2005-04-03 20:44:43 +00:00
Werner Lemberg ebf5585dd0 Formatting. 2005-03-16 01:49:54 +00:00
David Turner 58609c40c8 * docs/CHANGES: updating
* src/type1/t1parse.c (T1_New_Parser), src/type42/t42parse.c
    (t42_parser_init): modifying functions to check the font header before
    allocating anything on the heap.

    * internal/freetype/ftmemory.h: introducing the new macros FT_ARRAY_MAX
    and FT_ARRAY_CHECK

    * src/pcf/pcfread.c, src/pcf/pcfutil.c: minor fixes and simplifications.
    try to protect the PCF driver from doing stupid things with broken fonts.
2005-03-15 23:31:48 +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 3605e470c1 Add new function FT_Get_PS_Font_Private().
* include/freetype/internal/services/svpsinfo.h
(PS_GetFontPrivateFunc): New service function.

* include/freetype/t1tables.h, src/base/fttype1.c
(FT_Get_PS_Font_Private): New function.

* src/type1/t1driver.c (t1_ps_get_font_private): New function.
(t1_service_ps_info): Updated.

* src/cff/cffdrivr.c (cff_service_ps_info): Updated.
* src/cid/cidriver.c (cid_service_ps_info): Updated.
* src/type42/t42drivr.c (t42_ps_get_font_private): New function.
(t42_service_ps_info): Updated.

* src/type42/t42parse.c (t42_parse_dict): Remove compiler warning.
2004-11-12 07:02:45 +00:00
Werner Lemberg 023a4bf3be * include/freetype/config/ftstdlib.h: Include `stddef.h'.
(ft_ptrdiff_t): Define.

* include/freetype/fttypes.h (FT_PtrDist): Use `ft_ptrdiff_t'.

* src/cid/cidload.c (cid_parse_dict), src/type1/t1load.c
(parse_dict): Fix compiler warning.
2004-10-14 11:33:04 +00:00
Werner Lemberg 645af08157 * include/freetype/internal/ftobjs.h: Don't include
FT_CONFIG_STANDARD_LIBRARY_H.
(FT_Validator, FT_VAlidationLevel, FT_ValidatorRec, FT_VALIDATOR,
ft_validator_init, ft_validator_run, ft_validator_error, FT_INVALID,
FT_INVALID_TOO_SHORT, FT_INVALID_OFFSET, FT_INVALID_FORMAT,
FT_INVALID_GLYPH_ID, FT_INVALID_DATA): Move to...

* include/freetype/internal/ftvalid.h: New file.
Make FT_INVALID return module-specific error codes.

* include/freetype/internal/internal.h (FT_INTERNAL_VALIDATE_H): New
macro.

* include/freetype/fterrors.h: Undefine FT_ERR_PREFIX only if
FT_KEEP_ERR_PREFIX isn't defined.

* src/base/ftobjs.c: Include FT_INTERNAL_VALIDATE_H.

* src/sfnt/ttcmap.h: Don't include FT_INTERNAL_OBJECTS_H but
FT_INTERNAL_VALIDATE_H.

* src/sfnt/ttcmap.c: Don't include FT_INTERNAL_OBJECTS_H but
FT_INTERNAL_VALIDATE_H.
Include sferrors.h before FT_INTERNAL_VALIDATE_H.
s/FT_Err_Ok/SFNT_Err_Ok/.

* src/sfnt/sferrors.h: Define FT_KEEP_ERR_PREFIX.

* src/type1/t1afm.c: Include t1errors.h.
2004-09-06 07:06:56 +00:00
Werner Lemberg d232f59383 * docs/CHANGES: Updated.
FreeType now can read kerning values from PFM files.

* src/type1/t1afm.c (T1_Done_AFM): Renamed to...
(T1_Done_Metrics): This.
Update all callers.
(T1_Read_AFM): Make it static.
Don't enter and leave a frame.
(LITTLE_ENDIAN_USHORT, LITTLE_ENDIAN_UINT): New macros.
(T1_Read_PFM): New function.
(T1_Read_Metrics): New higher-level function to be used instead of
T1Read_AFM.
Update all callers.
2004-08-02 05:38:33 +00:00
Werner Lemberg 3037b069f8 * src/type1/t1afm.c (afm_atoindex): Fix boundary test. Reported
by Dirck Blaskey.
2004-06-26 07:03:53 +00:00
Werner Lemberg 24bf96c5cc * src/type1/t1load.c (mm_axis_unmap, mm_weights_unmap): New
auxiliary functions.
(T1_Get_MM_Var): Provide axis tags.
Use mm_axis_unmap and mm_weights_unmap to provide default values
for design and normalized axis coordinates.

* include/freetype/t1tables.h (PS_DesignMapRec): Change type of
`design_points' to FT_Long.
Update all users.
2004-05-20 09:21:19 +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 44bb303510 * src/pcf/pcfdrivr.c: Revert change from 2004-04-17.
* src/pcf/pcfutil.c: Use FT_LOCAL_DEF.
* src/pcf/pcfutil.h: Include FT_CONFIG_CONFIG_H.
Use FT_BEGIN_HEADER and FT_END_HEADER.
Use FT_LOCAL.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* src/type1/t1load.h (T1_Get_MM_Var, T1_Set_Var_Design): New
function declarations.
2004-04-25 20:15:11 +00:00
Werner Lemberg dfa46199d2 * Jamfile, vms_make.com, builds/win32/visualc/freetype.dsp,
builds/win32/visualc/freetype/vcproj, include/freetype/ftmoderr.h:
Add LZW module.

* Jamfile.in: Removed.

* docs/CHANGES: Updated.

* include/freetype/internal/ftobjs.h: s/MIN/FT_MIN/, s/MAX/FT_MAX/,
s/ABS/FT_ABS/.  Updated all callers.

* src/type1/t1load.c (parse_dict), src/pcf/pcfdrivr.c
(PCF_Face_Init): Use FT_ERROR_BASE.



Add support for PCF fonts compressed with LZW (extension .pcf.Z,
created with `compress').

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

* include/freetype/ftlzw.h: New file.
* include/freetype/config/ftheader.h (FT_LZW_H): New macro for
ftlzw.h.

* src/lzw/*: New files.

* src/pcf/pcfdrivr.c: Include FT_LZW_H.
(PCF_Face_Init): Try LZW also.

* src/gzip/ftgzip.c: s/0/Gzip_Err_Ok/ where appropriate.
Beautify.
2004-03-05 09:26:24 +00:00
Werner Lemberg 675431bec1 * include/freetype/t1tables.h (PS_PrivateRec): Add
`expansion_factor'.

* src/pshinter/pshglob (psh_blues_scale_zones): Fix computation
of blues->no_overshoots -- `blues_scale' is stored with a
magnification of 1000, and `scale' returns fractional pixels.

* src/type1/t1load.c (T1_Open_Face): Initialize `blue_shift',
`blue_fuzz', `expansion_factor', and `blue_scale' according to the
Type 1 specification.

* src/type1/t1tokens.h: Handle `ExpansionFactor'.

* docs/CHANGES: Updated.
2004-02-25 21:17:49 +00:00
Werner Lemberg c846eac112 * include/freetype/freetype.h: Document FT_LOAD_TARGET_XXX properly.
* src/base/ftglyph.c (ft_bitmap_glyph_class,
ft_outline_glyph_class): Tag with FT_CALLBACK_TABLE_DEF.

* src/smooth/ftsmooth.c (ft_smooth_render): Handle
FT_RENDER_MODE_LIGHT.
2004-02-19 21:39:58 +00:00
Werner Lemberg d1d2b458e9 * builds/unix/ftsystem.c: Include errno.h.
(ft_close_stream): Renamed to...
(ft_close_stream_by_munmap): This.
(ft_close_stream_by_free): New function.
(FT_Stream_Open): Use fallback method if mmap fails.
Use proper function for closing the stream.

* src/type1/t1load.c (parse_dict): Initialize `start_binary'.
2004-02-16 09:38:05 +00:00
Werner Lemberg 9472e23a6a * src/type42/t42objs.c (T42_Face_Init), src/type1/t1objs.c
(T1_Face_Init), src/cid/cidobjs.c (cid_face_init): Fix computation
of underline_position and underline_thickness.
2004-02-14 19:21:37 +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 0a84eba8a6 * include/freetype/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP):
Initialize `node'.
* src/type1/t1load.c (parse_dict): Initialize `have_integer'.
2004-02-05 14:36:43 +00:00
Werner Lemberg 6b3d00e1a0 * src/type1/t1load.c (parse_dict): Handle `RD' and `-|' commands
outside of /Subrs or /CharStrings.  This can happen if there is
additional code manipulating those two arrays so that FreeType
doesn't recognize them properly.
(T1_Open_Face): Improve an error message.

Remove CR/LF on many files.
2004-02-03 21:34:29 +00:00
Werner Lemberg cf7d908c48 * src/type1/t1load.c (parse_charstrings): Exit immediately if
there are no elements in /CharStrings.  This is needed for fonts
like Optima-Oblique which not only define /CharStrings but access it
also.
2004-02-02 19:41:09 +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
Werner Lemberg 271b1e1633 * src/type1/t1parse.c (T1_Get_Private_Dict): Skip exactly one
CR, LF, or CR/LF after `eexec'.
2004-01-19 23:31: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 63abb4bc63 * src/type1/t1load.c (parse_dict): Stop parsing if `eexec' keyword
is encountered.
2003-12-22 11:35:36 +00:00
Werner Lemberg 8f963be41c * include/freetype/ttnameid.h (TT_ADOBE_ID_LATIN_1): New macro.
* src/type1/t1objs.c (T1_Face_Init): Use TT_ADOBE_ID* values.
2003-12-18 15:29:20 +00:00
Werner Lemberg fb4bfddb1a * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Add
cast.
* src/cff/cffdrivr.c (cff_ps_has_glyph_names): Assure that return
value is either 0 or 1.
2003-12-13 18:42:31 +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 f0b752072d * src/type1/t1driver.c (Get_Interface): Remove FT_UNUSED for
t1_interface.  t1_interface is used.
2003-12-05 10:24:59 +00:00
Werner Lemberg 40bb0964f2 * src/base/fttype1.c (FT_Get_PS_Font_Info, FT_Has_PS_Glyph_Names):
Fix parameter order in calls to FT_FACE_FIND_SERVICE.

* include/freetype/internal/ftserv.h
(FT_SERVICE_POSTSCRIPT_NAMES_H): Removed.  Unused.

* src/type42/t42drivr.c (t42_services): Updated.
2003-11-01 14:36:20 +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 4795b36cf9 * src/type1/t1load.c (parse_encoding): Handle `/Encoding [ ... ]'.
* src/type1/t1parse.c (T1_Get_Private_Dict): Test whether `eexec'
is real.

* src/type42/t42parse.c (t42_parse_encoding): Improve boundary
checking while parsing.

* docs/CHANGES: Updated.
2003-10-23 16:24:10 +00:00
Werner Lemberg 1c0b8e9d72 Only whitespace changes. 2003-10-23 04:54:14 +00:00
Werner Lemberg 3061e893ce * include/freetype/internal/t1types.h (T1_FontRec): `paint_type'
and `stroke_width' aren't pointers.

* src/type42/t42objs.c (T42_Face_Done), src/type1/t1objs.c
(T1_Face_Done): Don't free `paint_type' and `stroke_width'.
2003-10-22 20:24:47 +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 38c4647427 * src/type1/t1load.c (parse_font_matrix, parse_charstrings): Remove
code specially for synthetic fonts; this is handled elsewhere.
(parse_encoding): Remove code specially for synthetic fonts; this is
handled elsewhere.
Improve boundary checking while parsing.
(parse_dict): Improve boundary checking while parsing.
Use ft_memcmp to simplify code.
2003-10-13 05:58:54 +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 34808199ce * src/type1/t1load.c (parse_subrs, parse_dict): Handle synthetic
fonts properly.
2003-10-07 11:54:03 +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
Werner Lemberg 3864f4eae9 * src/cid/cidload.c (cid_parse_dict): Skip token if no keyword is
found.

* src/type1/t1parse.c (IS_T1_WHITESPACE, IS_T1_LINESPACE,
IS_T1_SPACE): Removed.
(PFB_Tag): Removed.
(read_pfb_tag): Don't use PFB_Tag.

* src/type42/t42parse.c (t42_is_space): Handle `\f' also.
(t42_parse_encoding): Handle synthetic fonts.
2003-09-30 06:43:54 +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
Werner Lemberg a259b6dddb * include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE):
Fix compilation warning (s/pptr/Pptr/).

* include/freetype/internal/internal.h (FT_INTERNAL_PFR_H,
FT_INTERNAL_FNT_TYPES_H): Removed.
2003-09-22 09:53:56 +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 a126d4c2ef * src/type1/t1parse.c (pfb_tag_fields): Removed.
(read_pfb_tag): Fix code so that it doesn't fail on end-of-file
indicated (0x8003).
2003-09-20 14:25:10 +00:00
Werner Lemberg 013efd1410 Formatting. 2003-09-17 05:26:33 +00:00
David Turner c313c50208 * include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
          include/freetype/internal/ftobjs.h,
          include/freetype/internal/ftserv.h,
          include/freetype/internal/internal.h,
          include/freetype/internal/sfnt.h,
          include/freetype/internal/tttypes.h,
          include/freetype/internal/services/bdf.h,
          include/freetype/internal/services/glyfdict.h,
          include/freetype/internal/services/multmast.h,
          include/freetype/internal/services/postname.h,
          include/freetype/internal/services/sfnt.h,
          include/freetype/internal/services/xf86name.h,
          src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
          src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
          src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
          src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:

          heavy internal modifications to introduce the concept of
          "module services". This is the first step towards a massive
          simplification of the engine's internals, in order to
          get rid of various numbers of hacks.

          Note that this changes will break source & binary compatibility
          for authors of external font drivers.

          Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 19:51:54 +00:00
David Turner 3c40d73d2c * Jamfile: adding the "refdoc" target to the Jamfile in order to
build the API Reference in "docs/reference" automatically

        * include/freetype/t1tables.h, src/cid/cidtoken.h, src/type1/t1tokens.h,
        src/type42/t42parse.c:

        re-setting the types of "italic_angle", "underline_position" and
        "underline_thickness" to their previous values (i.e. long, short and
        ushort), in order to avoid breaking binary compatibility

        * include/freetype/ttunpath.h: fixing documentation comment
2003-08-17 22:31:23 +00:00
Werner Lemberg e52c4ba178 * src/type1/t1gload.c (T1_Load_Glyph), src/cff/cffgload.c
(cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph): Fix
previous change.
2003-08-06 17:27:14 +00:00
Werner Lemberg e8ff769c7f * src/type1/t1gload.c (T1_Load_Glyph), src/cff/cffgload.c
(cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph): Apply
font matrix to advance also.
* docs/CHANGES: Updated.
2003-08-06 04:40:48 +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 b5e8c90806 formatting, improving documentation 2003-07-03 13:56:28 +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 a959c3c960 * src/pfr/pfrobjs.c (pfr_slot_load): Apply font matrix.
* src/cid/cidload.c: Remove parse_font_bbox code (already enclosed
with #if 0 ... #endif).

* src/type1/t1tokens.h: Handle /FontName.
* src/type1/t1load.c (parse_font_name): Removed.
Remove parse_font_bbox code (already enclosed with #if 0 ...
#endif).

* src/type42/t42parse.c (t42_parse_font_name): Removed.
Remove t42_parse_font_bbox code (already enclosed with #if 0 ...
#endif).
(t42_keywords): Handle /FontName with T1_FIELD_KEY.
2003-06-14 07:40:09 +00:00
Werner Lemberg fdc042b8a9 * src/cid/cidobjs.c: Apply change 2003-05-31 from <Ron.Dev@gmx.de>.
Compute style flags.
Fix computation of root->height.
* src/cid/cidtoken.h: Handle FontBBox.
* src/cid/cidload.c (cid_load_keyword): Handle
T1_FIELD_LOCATION_BBOX.
(parse_font_bbox): Commented out.
(cid_field_record): Comment out element for parsing FontBBox.

* src/type42/t42parse.c (t42_parse_font_bbox): Commented out.
(t42_keywords): Handle FontBBox with T1_FIELD_BBOX, not with
T1_FIELD_CALLBACK.
(t42_parse_font_bbox): Commented out.
(t42_load_keyword): Handle T1_FIELD_LOCATION_BBOX.
* src/type42/t42objs.c (T42_Face_Init): Apply change 2003-05-31
from <Ron.Dev@gmx.de>.
2003-06-12 04:59:07 +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 64591b7657 * include/freetype/fttrigon.h (FT_Vector_Normalize): Removed.
* src/type1/t1objs.c (T1_Face_Init): Improve algorithm for guessing
the font style by ignoring spaces and hyphens.

* builds/unix/freetype2.in: Fix `Version' field.
2003-06-01 21:30:04 +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 26fb1bcd05 * vms_make.com: Reworked support for shareable images on VMS. The
first version was kind of a hack; the current implementation of the
procedure to extract the required symbols is much cleaner.

Reworked creation of MMS files, avoiding a number of temporary files
which were created in the previous version.

Further work on creating descrip.mms files on the fly.

* builds/vms/descrip.mms, src/autohint/descrip.mms,
src/type1/descrip.mms: Removed.
2003-05-28 06:27:26 +00:00
Werner Lemberg 77c34b8264 * t1load.c (parse_blend_axis_types): Fix compiler warning.
* src/gzip/ftgzip.c (ft_gzip_file_io): Avoid zero value of `delta'
to prevent infinite loop.

* docs/VERSION.DLL: Provide better autoconf snippet to check
FreeType version.

* src/base/ftobjs.c (open_face): Free `internal' not
`face->internal' in case of error to avoid possible segfault.

* src/pshinter/pshalgo3.c (ps3_hints_apply): Check whether we
actually have an outline.
2003-05-20 22:06:38 +00:00
Werner Lemberg 428c2e4f62 * src/bdf/bdflib.c (hash_bucket, hash_lookup): Use `const' for first
argument.
(bdf_get_font_property): Use `const' for third argument.
Updated all callers.
* src/bdf/bdfdrivr.c (BDF_Face_Init): Set pixel width and height
similar to the PCF driver.
* src/bdf/bdf.h (_hashnode): Use `const' for `key'.
Updated.

* src/gzip/ftgzip.c: C++ doesn't like that the array `inflate_mask'
is declared twice.  It is perhaps better to modify the zlip source
files directly instead of this hack.
(zcalloc, zfree, ft_gzip_stream_close, ft_gzip_stream_io): Add casts
to make build with g++ successful.
2003-04-25 05:35:04 +00:00
Werner Lemberg 319c00d7d6 Fixing bugs reported by Nelson Beebe.
* src/base/ftstroker.c (FT_Stroker_ParseOutline): Remove unused
variable `in_path'.

* src/base/ftobjs (ft_glyphslot_set_bitmap): Change type of
second argument to `FT_Byte*'.
* include/freetype/internal/ftobjs.h: Updated.

* src/bdf/bdflib.c (_bdf_readstream): Remove unused variable `res'.
(_bdf_parse_glyphs): Remove unused variable `next'.
Mark `call_data' as unused.

* src/cache/ftlru.c (FT_LruList_Lookup): Remove unused variable
`plast'.

* src/pcf/pcfread.c (pcf_seek_to_table_type): Slight recoding to
actually use `error'.
(pcf_load_font): Remove unused variable `avgw'.

* src/pfr/pfrobjs.c (pfr_face_get_kerning): Change return type
to `void'.
Mark `error' as unused.
* src/pfr/pfrobjs.h: Updated.
* src/pfr/pfrdrivr.c (pfr_get_kerning): Updated.

* src/sfnt/ttload.c (sfnt_dir_check): Remove unused variable
`format_tag'.

* src/sfnt/ttcmap0.c (tt_cmap6_validate, tt_cmap10_validate): Remove
unused variable `start'.
(tt_cmap10_char_next): Remove unused variable `result'

* src/sfnt/sfobjs.c (tt_face_get_name): Mark `error' as unused.

* src/sfnt/sfdriver.c (get_sfnt_postscript_name): Mark `error' as
unused.

* src/type1/t1objs.c (T1_Face_Init): Remove unused variable
`pshinter'.

* src/type1/t1gload.c (T1_Load_Glyph): Use `glyph_data_loaded'
only for FT_CONFIG_OPTION_INCREMENTAL.
2003-04-23 19:48:24 +00:00
Werner Lemberg b442ca1713 Cleanups. 2003-04-23 15:50:27 +00:00
David Turner e0ec6b3d53 * src/type1/t1load.c (T1_Open_Face): fixed the code to make it handle
special cases where a font only contains a ".notdef" glyph (happens in
   PDF-embedded fonts !!). Otherwise, FT_Panic was called !
2003-04-03 15:52:59 +00:00
David Turner 5158fbc03d * README: udpated
* README.UNX: removed (now replaced by docs/INSTALL.UNX)

   * src/pshinter/pshalgo3.c: the hinter now performs as in 2.1.3 and
   will ignore stem quantization only when FT_LOAD_TARGET_SMOOTH is used

   * src/base/ftobjs.c: changed the default computations to include rounding
   in all cases, this is required to provide accurate kerning data when
   native TrueType hinting is enabled.

   * src/type1/t1load.c: the Type 1 loader now accepts more general names
   according to the Postscript spec (the previous one was too restrictive)
2003-03-27 21:35:44 +00:00
Graham Asher 46960df7b3 The incremental interface now passes the old metrics when asking for
replacement metrics so that they can be modified, not just replaced.
For example, CFF fonts need this.
2003-02-13 17:49:27 +00:00
David Turner 621e488622 2002-12-16 David Turner <david@freetype.org>
* docs/VERSION.DLL: updating document to better explain the differences between
        the three version numbers being used on Unix, as well as provide the AutoConf
        fragment provided by Lars Clausen

        * src/smooth/ftgrays.c (gray_render_conic): fixed small bug that
        prevented bezier arcs with negative vertical coordinates to be rendered
        appropriately


2002-11-27  Vincent Caron <v.caron@zerodeux.net>

        * builds/unix/unix-def.in, builds/unix/freetype-config.in,
        builds/unix/configure.ac, src/gzip/rules.mk, src/gzip/ftgzip.c:
        adding support for system zlib installations when available on the
        target platform (Unix only)
2002-12-16 21:51:24 +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 bc1837a19b 16bit fixes from Wolfgang Domrse.
* src/type1/t1parse.h (T1_ParserRec): Change type of `base_len'
and `private_len' to FT_Long.
* src/type1/t1parse.c (T1_Get_Private_Dict): Remove cast for
`private_len'.
* src/type1/t1load.c: Use FT_Int cast for most calls of T1_ToInt.
Use FT_PtrDist where appropriate.
(parse_encoding): Use FT_Long for `count' and `n'.
(read_binary_data): Use FT_Long* for second parameter.
* src/type1/t1afm.c (afm_atoindex): Use FT_PtrDist.

* src/cache/ftcsbits.c (ftc_sbit_node_load): Remove unused label.
* src/pshinter/pshalgo3.c (psh3_hint_align): Remove unused variable.
2002-09-17 12:39:19 +00:00
Werner Lemberg 7a99b507ce * src/type1/t1parse.h (T1_ParserRec): Change type of `base_len'
and `private_len' to FT_Long.

* src/cache/ftcsbits.c (ftc_sbit_node_load): Remove unused label.
* src/pshinter/pshalgo3.c (psh3_hint_align): Remove unused variable.
2002-09-17 07:31:17 +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 3c403e4c17 Some formatting.
* src/cff/cffcmap.c: Remove compiler warnings.
* src/cache/ftccache.c, src/cache/ftccache.i,
src/pfr/pfrload.c, src/pfr/pfrgload.c: s/index/idx/.
* src/cff/cffload.c: s/select/fdselect/.
* src/raster/ftraster.c: s/wait/waiting/.
2002-08-06 21:47:40 +00:00
Graham Asher 733c255713 T1_Open_Face now tolerates a face with no charstrings if there is
an incremental loading interface. This is essential if incremental
loading of Type 1 fonts supplied by PostScript is to work.
2002-08-01 16:16:16 +00:00
Graham Asher ce12182cfc Modified incremental loading interface to be closer to David Turner's
preferences. The header freetype.h is not now affected, the interface is
specified via an FT_Parameter, the pointer to the interface is hidden in an
internal part of the face record, and all the definitions are in ftincrem.h.
2002-08-01 15:29:17 +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
Graham Asher bd8b08513f Added support for incrementally loaded Type 1 faces. 2002-07-18 16:57:43 +00:00
David Turner fed59b7cc2 * src/sfnt/ttload.c (TT_Load_SFNT_Header): fixed a recent bug that prevented
OpenType fonts to be recognized by FreeType
2002-07-17 22:51:06 +00:00
David Turner 3e19d85dd4 * include/freetype/config/ftoption.h, include/freetype/internal/tttypes.h,
src/base/ftobjs.c, src/bdf/bdfdrivr.c, src/cff/cffobjs.c,
    src/pcf/pcfdrivr.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c,
    src/sfnt/ttcmap0.h, src/sfnt/ttload.c, src/type1/t1objs.c,
    src/type42/t42objs.c, src/winfonts/winfnt.c: code cleanup,
    FT_CONFIG_OPTION_USE_CMAPS is now the default
2002-07-17 21:52:20 +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 971517ac8e * src/pshinter/pshglob.h, src/pshinter/pshglob.c: adding support for
blue fuzz
2002-07-08 23:13:25 +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 8ab3260239 * src/bdf/README: Mention Microsoft's SBIT tool.
* src/cff/cffdrivr.c, src/cid/cidriver.c, src/pcf/pcfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c,
src/winfonts/winfnt.c, src/type42/t42drivr.c, src/bdf/bdfdrivr.c
[FT_CONFIG_OPTION_DYNAMIC_DRIVERS]: Completely removed.  It has
been never used.
2002-05-21 20:22:59 +00:00
Werner Lemberg bd889e5de9 * src/sfnt/ttload.c (TT_LookUp_Table): Protect against tables
with a zero length value.

* builds/beos/beos.mk: Include `link-std.mk'.

* src/type1/t1load.h (T1_Loader): Renamed to...
(T1_LoaderRec): This.
(T1_Loader): Now pointer to T1_LoaderRec.
* src/type1/t1load.c: Updated.

* include/freetype/internal/t1types.h, src/type1/t1load.c,
src/type1/t1objs.c:
s/T1_ENCODING_TYPE_EXPORT/T1_ENCODING_TYPE_EXPERT/.
2002-05-12 19:59:17 +00:00
Werner Lemberg 5f0ee94c06 `interface' is reserved on the Mac.
* include/freetype/ftoutln.h, include/freetype/internal/sfnt.h,
src/base/ftoutln.c: s/interface/func_interface/.
* src/base/ftbbox.c (FT_Outline_Get_BBox):
s/interface/bbox_interface/.
* src/cff/cffdrivr.c: s/interface/module_interface/.
* src/cff/cffload.c, src/cff/cffload.h:
s/interface/psnames_interface/.
* src/cid/cidriver.c: s/interface/cid_interface/.
* src/sfnt/sfdriver.c: s/interface/module_interface/.
* src/smooth/ftgrays.c: s/interface/func_interface/.
* src/truetype/ttdriver.c: s/interface/tt_interface/.
* src/type1/t1driver.c: s/interface/t1_interface/.
2002-04-30 06:37:52 +00:00
David Turner 609e28c3be * src/type1/t1gload.h, src/type1/t1gload.c: fixed incorrect
parameter sign-ness in callback function

        * include/freetype/config/ftmodule.h,
          include/freetype/internal/fttrace.h,
          src/Jamfile, src/pfr/*:

          adding a PFR font driver to the FreeType sources. Not that it
          doesn't support embedded bitmaps or kerning tables for now..


        * include/freetype/internal/ftmemory.h: adding the FT_MEM_ZERO
          and FT_ZERO macros

        * include/freetype/internal/ftstream.h: adding the FT_NEXT_OFF3,
          FT_NEXT_UOFF3, FT_NEXT_OFF3_LE and FT_NEXT_UOFF3_LE to parse
          in-memory 24-bit integers.
2002-04-19 15:13:47 +00:00
David Turner 11cfdd04a2 fixed max advance width computation within T1 driver 2002-04-17 09:37:59 +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 04728a8bbe Fixes from the stable branch:
* include/freetype/config/ftoption.h (FT_CONFIG_OPTION_OLD_CALCS):
Removed.
[FT_CONFIG_OPTION_OLD_CALCS]: Removed.
* include/freetype/internal/ftcalc.h, src/base/ftcalc.c
[FT_CONFIG_OPTION_OLD_CALCS]: Removed.

* src/base/fttrigon.c (FT_Vector_Length): Change algorithm to match
output of FreeType 1.

* src/pshinter/pshglob.c (psh_globals_scale_widths): Fixed a small
bug that created un-even stem widths when hinting Postscript fonts.

formatting, updating copyright
2002-04-02 14:50:31 +00:00
Werner Lemberg efa996155e * src/type1/t1driver.c, src/type1/t1parse.c: 16bit fixes.
formatting, copyright updates
2002-04-01 22:01:46 +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 2ded2c1d30 * src/base/ftobjs.c, src/sfnt/ttcmap0.c, src/type1/t1objs.c:
various fixes to make the FT_CMaps support work correctly
          (more tests are still needed)
2002-03-22 22:37:40 +00:00
David Turner ed54f28e4a various fixes to the FT_CMaps support 2002-03-22 17:09:52 +00:00
David Turner fa77c87f64 polishing FT_CMaps support for Type 1 format 2002-03-22 15:56:12 +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 5a83a00d11 moving the Type 1 CMap support to "psaux" 2002-03-21 10:39:23 +00:00
David Turner 7d3a26425b * renaming stream macros. Examples:
FILE_Skip    => FT_STREAM_SKIP
           FILE_Read    => FT_STREAM_READ
           ACCESS_Frame => FT_FRAME_ENTER
           FORGET_Frame => FT_FRAME_EXIT
           etc...
2002-03-20 10:49:31 +00:00
David Turner 4bd5d0a344 formatting 2002-03-20 09:42:31 +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
David Turner ef3c12650e * include/freetype/internal/ftdriver.h,
include/freetype/internal/ftobjs.h,
          src/base/ftapi.c, src/base/ftobjs.c,
          src/cff/cffdrivr.c, src/cff/cffdrivr.h,
          src/cid/cidriver.c, src/cid/cidriver.h,
          src/pcf/pcfdriver.c, src/pcf/pcfdriver.h,
          src/truetype/ttdriver.c, src/truetype/ttdriver.h,
          src/type1/t1driver.c, src/type1/t1driver.h,
          src/winfonts/winfnt.c, src/winfonts/winfnt.h:
          updating the type definitions for font font drivers
2002-03-14 09:22:48 +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 acfea4ddd9 * src/type1/t1objs.c (T1_Face_Init), src/cid/cidobjs.c (CID_Face_Init):
fixed another bug related to the ascender/descender/text height of
        Postscript fonts. Damn, this should have been fixed on 2002-03-04 !
2002-03-06 12:38:15 +00:00
David Turner 9ddeee1d41 formatting 2002-03-06 12:36:22 +00:00
David Turner 7d0f0bafab * src/type1/t1objs.c (T1_Face_Init),
src/cff/cffobjs.c (CFF_Face_Init),
          src/cid/cidobjs.c (CID_Face_Init):

            removing the bug that returned global BBox values in
            16.16 fixed format (instead of integer font units).
2002-03-05 15:55:28 +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 617a2e1c3c adding several experimental sources:
- OpenType Layout validation and parsing (common tables)
  - Type 1 charmap processing
2002-02-27 21:25:47 +00:00
Werner Lemberg 66b3509bdd Add support for ISOLatin1 PS encoding.
* include/freetype/freetype.h (ft_encoding_latin_1): New tag
(`lat1').
* include/freetype/internal/t1types.h (T1_Encoding_Type): Add
`t1_encoding_isolatin1'.
* src/type1/t1driver.c (Get_Char_Index, Get_Next_Char): Handle
ft_encoding_latin_1.
* src/type1/t1load.c (parse_encoding): Handle `ISOLatin1Encoding'.
* src/type1/t1objs.c (T1_Face_Init): Handle `t1_encoding_isolatin1'.
2002-02-10 12:33:14 +00:00
Werner Lemberg 0f7c2f1aa5 Adding the function `FT_Get_Next_Char', doing the obvious thing
w.r.t. the selected charmap.

* include/freetype/freetype.h: Add prototype.
* include/freetype/internal/ftdriver.h: Add `FTDriver_getNextChar'
typedef.
(FT_Driver_Class): Use it.
* include/freetype/internal/psnames.h: Add `PS_Next_Unicode_Func'
typedef.
(PSNames_Interface): Use it.
* include/freetype/internal/tttypes.h: Add `TT_CharNext_Func'
typedef.
(TT_CMapTable): Use it.

* src/base/ftobjs.c (FT_Get_Next_Char): New function, implementing
high-level API.
* src/cff/cffdrivr.c (cff_get_next_char): New function.
(cff_driver_class): Add it.
* src/cid/cidriver.c (Cid_Get_Next_Char): New function.
(t1cid_driver_class): Add it.
* src/pcf/pcfdriver.c (PCF_Get_Next_Char): New function.
(pcf_driver_class): Add it.
* src/psnames/psmodule.c (PS_Next_Unicode): New function.
(psnames_interface): Add it.
* src/sfnt/ttcmap.c (code_to_next0, code_to_next2, code_to_next4,
code_to_next6, code_to_next_8_12, code_to_next_10): New auxiliary
functions.
(TT_CharMap_Load): Use them.
* src/truetype/ttdriver.c (Get_Next_Char): New function.
(tt_driver_class): Add it.
* src/type1/t1driver.c (Get_Next_Char): New function.
(t1_driver_class): Add it.
* src/winfnt/winfnt.c (FNT_Get_Next_Char): New function.
(winfnt_driver_class): Add it.

* src/pcf/pcfread.c (pcf_load_font): For now, report Unicode for
Unicode and Latin 1 encodings.
2002-02-04 20:55:58 +00:00
Werner Lemberg 556ad08f03 * src/type1/t1load.c (parse_encoding): Set `loader->num_chars'.
* src/type1/t1load.c (parse_subrs, parse_charstrings): Use copy
of `base' string for decrypting to not modify the original data.
2002-01-28 13:34:52 +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
Werner Lemberg 1a0a97938a * src/type1/t1objs.c (T1_Face_Init): Add cast to avoid compiler
warning.
2002-01-03 22:06:13 +00:00
David Turner 662b344c23 * src/type1/t1objs.c (T1_Face_Init): fixed a bug that crashed the
library when dealing with certain weird fonts (like "Stalingrad",
        in "sadn.pfb". This font has no full font name entry.. )

        * src/base/ftoutln.c, include/freetype/ftoutln.h: added the
        FT_Outline_Check API to check the consistency of outline data

        * src/base/ftobjs.c (FT_Load_Glyph): added a call to the new
        FT_Outline_Check to ensure that loaded glyphs are valid. This
        allows certain fonts like "tt1095m_.ttf" to be loaded even though
        it appears they contain really funky glyphs..

        there still is a bug there though.. !!
2002-01-03 16:56:59 +00:00
David Turner 3a664fca14 * src/cid/cidobjs.c (CID_Face_Done): fixed a memory leak, the subrs
routines were never released when CID faces were destroyed
2001-12-21 15:26:19 +00:00
David Turner 85eb669546 * src/type1/t1gload.c (T1_Load_Glyph): enable font matrix transform
on hinted glyphs..

        * src/cid/cidgload.c, src/cid/cidobjs.c, src/cid/cidobjs.h,
        src/cid/cidriver.c, include/freetype/internal/t1types.h: added
        Postscript hinter support to the CID font driver !!
2001-12-20 09:36:21 +00:00
Werner Lemberg 5da9dd77f2 * src/base/ftglyph (FT_Glyph_To_Bitmap): Remove compiler warning.
* include/freetype/ftcache.h (FTC_Node_Unref): Removed.  It is
already in ftcmanag.h.
* src/cache/ftcsbits.c (ftc_sbit_node_load): Remove unused variable
`gfam'.
* src/cache/ftcmanag.c (ftc_family_table_alloc,
* ftc_family_table_free): Use FT_EXPORT_DEF.
* include/freetype/cache/ftcmanag.h: Updated.
* src/cache/ftccache.c (ftc_node_destroy): Use FT_EXPORT_DEF.
* src/cache/ftccmap.c (ftc_cmap_node_init): Remove unused variable
`cfam'.
Remove compiler warning.
(FTC_CMapCache_Lookup): Remove compiler warnings.
(ftc_cmap_family_init): Ditto.
(FTC_CMapCache_Lookup): Ditto.

* builds/unix/configure.ac: Increase `version_info' to 8:0:2.
* builds/unix/configure: Regenerated.

* builds/mac/README: Updated.
2001-12-16 08:17:33 +00:00
David Turner bce2986d0d fixing hinted advance width bug in all font drivers 2001-12-14 14:52:58 +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 12d40dac42 * src/type1/t1load.c: fixed memory leak bugs that appeared with certain
synthetized fonts (e.g. CourierBoldOblique, a.k.a. "cobo_____.pfb")

	* src/pshinter/pshalgo2.c, src/pshinter/pshalgo1.c,
	src/pshinter/pshglob.c: removing compiler warnings in pedantic modes
	(in multi-object compilation mode, mainly)
2001-10-21 15:41:11 +00:00
Tom Kacvinsky 629bf286e7 In function parse_encoding, add a test to make sure that custom
encodings (i.e., neither StandardEncoding nor ExpertEncoding) are not
loaded twice when the Type 1 font is synthetic.
2001-10-20 20:46:36 +00:00
Tom Kacvinsky 48f26bc748 In functions parse_font_name and parse_subrs, added a test for when
loading synthetic fonts to make sure that the font name and
subrotuines are not loaded twice.  This is to remove a memory leak
that occurs because the original allocation for these objects is not
deallocated when the objects are read the second time.
2001-10-20 17:44:48 +00:00
David Turner 5893c1bb2a add support for new postscript hinter 2001-10-18 11:49:26 +00:00
David Turner 23bcde193e implementing a new function named "FT_Get_Postscript_Name" to
retrieve a face's "unique" Postscript name
2001-10-17 13:48:10 +00:00
Werner Lemberg 817a85a8ad * src/type1/t1afm.c (T1_Done_AFM): Free `afm'. 2001-09-15 10:05:12 +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
David Turner 26160d5b2c fixed Type1 kerning flag setting when reading AFM file 2001-08-30 06:56:03 +00:00
Werner Lemberg 5dea44438f Updating to OpenType 1.3.
* include/freetype/internal/tttypes.h (TT_CMap0, TT_CMap2, TT_CMap4,
TT_CMap6): Adding field `language'.
(TT_CMapTable): Removing field `language'.
Type of `length' field changed to FT_ULong.
Adding fields for cmaps format 8, 10, and 12.
(TT_CMapGroup): New auxiliary structure.
(TT_CMap8_12, TT_CMap10): New structures.
* include/freetype/tttables.h (TT_HoriHeader, TT_VertHeader):
Removed last element of `Reserved' array.
* include/freetype/ttnameid.h (TT_PLATFORM_CUSTOM, TT_MS_ID_UCS_4,
TT_NAME_ID_CID_FINDFONT_NAME): New macros.

* src/sfnt/ttcmap.c (TT_CharMap_Load): Updated loading of `language'
field to the new structures.
Fixed freeing of arrays in case of unsuccessful loads.
Added support for loading format 8, 10, and 12 cmaps.
(TT_CharMap_Free): Added support for freeing format 8, 10, and 12
cmaps.
(code_to_index4): Small improvement.
(code_to_index6): Ditto.
(code_to_index8_12, code_to_index10): New functions.
* src/sfnt/ttload.c (TT_Load_Metrics_Header): Updated to new
structure.
(TT_Load_CMap): Ditto.

* src/sfnt/sfobjs.c (tt_encodings): Add MS UCS4 table (before MS
Unicode).


* src/type1/t1driver.c (t1_get_name_index): Fix compiler warning.
2001-08-13 11:44:29 +00:00
Tom Kacvinsky cfcec824eb Added function t1_get_name_index and changed Get_Interface to return
this function when the "name_index" function is requested.

Changed get_t1_glyph_name to t1_get_glyph_name for consistency.
2001-08-09 01:06:33 +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 4a2305cf0c formatting 2001-06-28 07:17:51 +00:00
David Turner dee781342b * include/freetype/ftconfig.h, src/*/*.c: changed the definition and
uses of the FT_CALLBACK_DEF macro in order to support 16-bit compilers
2001-06-27 09:26:46 +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 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
David Turner 09d55ceabf * src/cff/cffparse.c, src/cid/cidload.c, src/type1/t1load.c: fixed
the incorrect EM size computation
2001-05-11 18:08:58 +00:00
Tom Kacvinsky 9d770c90d1 Fix typos (entires -> entries). 2001-04-11 18:40:27 +00:00
Werner Lemberg ef6ebd6351 formatting 2001-04-11 18:09:49 +00:00
Tom Kacvinsky cad797e6f1 In function parse_charstrings, changed code for placing .notdef glyph
into slot 0 so that we no longer have a memory access violation.
2001-04-10 18:15:17 +00:00
Tom Kacvinsky 60ee2812b1 In structure T1_Loader, added swap_table (of type PS_Table) to
facilitate placing the .notdef glyph in slot 0.
2001-04-10 18:13:28 +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
Werner Lemberg 521a2d7a13 * builds/win32/detekt.mk: Fix .PHONY target for Intel compiler.
Renamed "ftnames.h" to "ftsnames.h", and FT_NAMES_H to
FT_SFNT_NAMES_H.
* docs/docmaker.py: Added generation of INDEX link in table of
contents.
* INSTALL, docs/BUILD: Updated documentation to indicate that the
compilation process has changed slightly (no more `src' required in
* 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 add its own directory to the include path at
compile time.  Modified all "rules.mk" and "descrip.mms"
accordingly.

* src/cid/cidobjs.c, src/cid/cidload.c, src/pcf/pcfread.c,
src/type1/t1load.c, src/type1/t1objs.c: Added a few casts to remove
compiler warnings in pedantic modes.
* include/config/ft2build.h, include/config/ftheader.h: The file
top-level <ft2build.h>.

* include/config/ftheader.h: Added new section describing the #include
macros.


the Type 2 glyph charstring (used by conversion programs).
* docs/docmaker.py: Added cross-references generation as well as


seac emulation provided by the Type 2 endchar operator.


* src/cid/cidafm.c, src/cid/cidafm.h: removed un-needed files,
Added support for clipped direct rendering in the smooth renderer.


* src/cff/t2objs.c (T2_Init_Face): For pure CFF fonts, set
2001-03-20 22:58:56 +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
Tom Kacvinsky f3dad68be8 In function parse_font_matrix(), make sure that the units per em value
is assigned an unsigned short value, first by shifting right 16 bits,
then by casting the results to FT_UShort.
2001-03-19 13:52:31 +00:00
David Turner 168e39a15b small update to remove compiler warnings 2001-03-17 23:25:34 +00:00
Tom Kacvinsky e5b8bbb892 In function T1_Init_Face, changed the assignment code for ascender,
descender, and max_advance_width.
2001-03-10 19:10:25 +00:00
Tom Kacvinsky 5d362b6b44 Changed parse_font_bbox to use FT_Fixed values for the bbox
assignment, and use rounded values instead.
2001-03-10 19:08:44 +00:00
Werner Lemberg 914b289f16 * src/*/*.c: Added many casts to make code more 64bit-safe. 2001-03-10 17:07:42 +00:00
Tom Kacvinsky bdcfd5246d Minor correction in T1_Init_Face: we must wait until parse_font_bbox
is changed before we use logical shift rights in the assignments of
`root->ascender', `root->descender', and `root->max_advance_width'.
2001-03-07 20:53:08 +00:00
Tom Kacvinsky 3f06635b12 2001-03-07 Tom Kacvinsky <tjk@ams.org>
* src/type1/t1objs.c (T1_Done_Face): Free `char_name' table to
	avoid a memory leak.
	Submitted by Sander van der Wal <svdwal@xs4all.nl>
2001-03-07 20:42:18 +00:00
Werner Lemberg e274cfd3ef * src/autohint/ahtypes.h (AH_Hinter): Add elements
`disable_horz_edges', `disable_vert_edges'.
* src/autohint/ahhint.c	(ah_hint_edges_3, ah_hinter_hint_edges): Use
them (and remove static variables with the same names).
* src/pcf/pcfutil.c (BitOrderInvert): Add `const'.
* docs/glnames.py: Updated to latest pstables.h changes.
* src/psnames/pstables.h: Add more `const'.
* src/pcf/pcfutil.c: Ditto.
* src/base/ftglyph.c (FT_Glyph_To_Bitmap): Fixing typo
(FT_Glyph_Done -> FT_Done_Glyph).
* include/freetype/ttnameid.h: Added some new Microsoft language
codes and LCIDs as found in Office Xp.

* builds/hurd/detect.mk: New file.  Added support to detect the GNU
Hurd operating system as Unix-like.  Fix submitted by Anthony Fok
<foka@debian.org>.

* src/type1/t1gload.c (T1_Load_Glyph): Set glyph control data to the
the Type 1 glyph charstring (used by conversion programs).
Submitted by Ha Shao <hashao@chinese.com>.


* src/base/ftgrays.c (grays_sweep): The function didn't exit
immediately if `num_cells' was 0 as it should.  Thanks to Boris for
finding this out.

* src/base/ftglyph.c (FT_Glyph_To_Bitmap): Fixed memory leak when
bitmap rendering fails (thanks to Graham Asher).

* docs/docmaker.py, include/freetype/*.h: Updated the DocMaker
script to support chapters and section block ordering.  Updated the
public header files accordingly.
* src/base/ftglyph.c (FT_Glyph_Copy): Advance width and glyph format
were not correctly copied.
2001-03-04 21:53:08 +00:00
David Turner 8a8d5c88b5 the Type 1 glyph loader now sets the glyph control data to the
T1 charstrings program.
2001-02-28 09:36:13 +00:00
Tom Kacvinsky 97094311aa In function is_alpha, make `-' a legal alphanumeric character. This
is so that font names with `-' are fully parsed, etc...
2001-02-07 03:45:49 +00:00
Tom Kacvinsky 7b91beadab In function T1_Init_Face, added code to get the units_per_EM from the
value assigned in parse_font_matrix, if available.  Default to 1000 if
not available.
2001-02-07 01:14:53 +00:00
Tom Kacvinsky b2d5fefea8 In function parse_font_matrix, added heuristic to get units_per_EM
from the font matrix.

In parse_dict, deleted test to see if the FontInfo keyword has been
seen.  Deletion of this test allows fonts without FontInfo
dictionaries to be parsed by the Type 1 driver.

In T1_Open_Face, deleted empty subroutines array test to make sure
fonts with no subroutines still are parsed.
2001-01-24 22:41:20 +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
David Turner efa80f2b43 fixed a few warnings with Borland C++ 2000-12-01 21:43:05 +00:00