Commit Graph

217 Commits

Author SHA1 Message Date
suzuki toshiya 0729bc9f52 [Win64] Improve the computation of random seed from stack address. 2009-09-10 16:09:55 +09:00
Bram Tassyns 4694ea2b95 Improve vertical metrics calculation (Savannah bug #27364).
The calculation of `vertBearingX' is not defined in the OTF font
spec so FreeType does a `best effort' attempt.  However, this value
is defined in the PDF and PostScript specs, and that algorithm is
better than the one FreeType currently uses:

  FreeType: Use the middle of the bounding box as the X coordinate
            of the vertical origin.

  Adobe PDF spec: Use the middle of the horizontal advance vector as
                  the X coordinate of the vertical origin.

FreeType's algorithm goes wrong if you have a really small glyph
(like the full-width, circle-like dot at the end of the sentence, as
used in CJK scripts) with large bearings.  With the FreeType
algorithm this dot gets centered on the baseline; with the PDF
algorithm it gets the correct location (in the top right).  Note
that this is a serious issue, it's like printing the dot at the end
of a Roman sentence at the center of the textline instead of on the
baseline like it should. So i believe the PDF spec's algorithm
should be used in FreeType as well.

The `vertBearingY' value for such small glyphs is also very strange
if no `vmtx' information is present, since the height of the bbox is
not representable for the height of the glyph visually (the
whitespace up to the baseline is part of the glyph).  The fix also
includes some code for a better estimate of `vertBearingY'.

* src/base/ftobjs.c (ft_synthesize_vertical_metrics): `vertBearingX'
is now calculated as described by the Adobe PDF Spec.  Estimate for
`vertBearingY' now works better for small glyphs completely above or
below the baseline into account.

* src/cff/cffgload.c (cff_slot_load): `vertBearingX' is now
calculated as described by the Adobe PDF Spec.  Vertical metrics
information was always ignored when FT_CONFIG_OPTION_OLD_INTERNALS
was not defined.

* src/truetype/ttgload.c (compute_glyph_metrics): `vertBearingX' is
now calculated as described by the Adobe PDF Spec.
2009-09-02 13:06:33 +02:00
Werner Lemberg d77cd8ce7e Fix rendering of horizontally compressed CFFs.
Bug reported by Ivan Nincic <inincic@pdftron.com>.

* src/cff/cffgload.c (cff_slot_load): Thinko: Check `xx' element of
`font_matrix' also.

* docs/CHANGES: Updated.
2009-08-27 00:10:56 +02:00
suzuki toshiya 072e55233e cff: Cast the long variables to 32-bit for LP64 systems. 2009-08-01 00:30:23 +09:00
suzuki toshiya a813cf4801 cff: Fix some data types mismatching with their sources. 2009-08-01 00:30:15 +09:00
Werner Lemberg 24370d67f5 Uff, another thinko. 2009-06-28 02:11:51 +02:00
Werner Lemberg e7389a4405 [psaux, cff] Protect against nested `seac' calls.
* include/freetype/internal/psaux.h (T1_Decoder), src/cff/cffgload.h
(CFF_Decoder): Add `seac' boolean variable.

* src/cff/cffgload.c (cff_operator_seac,
cff_decoder_parse_charstrings), src/psaux/t1decode.c
(t1operator_seac, t1_decoder_parse_charstrings): Use it.
2009-06-28 01:25:55 +02:00
Werner Lemberg 858abbedc0 For warning messages, replace FT_ERROR with FT_TRACE0.
FT_ERROR is now used only if a function produces a non-zero `error'
value.

Formatting, improving and harmonizing debug strings.
2009-06-26 06:15:41 +02:00
Werner Lemberg 1f540eff0b Remove unused variables.
* include/freetype/internal/psaux.h (T1_BuilderRec),
src/cff/cffgload.h (CFF_Builder): Remove `last'.
Update all users.
2009-06-20 13:24:08 +02:00
Werner Lemberg 541ab5adda [cff] Revert last change.
* src/cff/cffgload.c (cff_decoder_parse_charstrings): Do it.
Next time, don't confuse Type 2 charstring opcodes with TOP DICT
values...
2009-06-20 07:31:44 +02:00
Werner Lemberg f1631f2db0 [cff] Fix handling of reserved byte 0xFF.
* src/cff/cffgload.c (cff_decoder_parse_charstrings): Abort if byte
0xFF is encountered.
2009-06-19 23:50:37 +02:00
Werner Lemberg fbdf127904 Ignore empty contours in CFF glyphs.
Problem reported by Albert Astals Cid <aacid@kde.org>.

* src/cff/cffgload.c (cff_builder_close_contour): Synchronize with
t1_builder_close_contour.
2009-04-01 08:03:37 +02:00
Werner Lemberg 86e041b5a8 Remove redundant header inclusions.
This covers many Ghostscript Coverity issues.

* src/*: Do it.
2009-03-21 08:51:44 +01:00
Werner Lemberg b66efefdcd Fix some FreeType Coverity issues as reported for Ghostscript.
* src/base/ftobjs.c (FT_New_Face, FT_New_Memory_Face): Initialize
`args.stream' (#3874, #3875).
(open_face_PS_from_sfnt_stream): Improve error management (#3786).
* src/base/ftmm.c (ft_face_get_mm_service): Fix check of `aservice'
(#3870).
* src/base/ftstroke.c (ft_stroke_border_get_counts): Remove dead
code (#3790).
* src/base/ftrfork.c (raccess_guess_apple_generic): Check error
value of `FT_Stream_Skip' (#3784).

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

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

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

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

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

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

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

* src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Properly ignore
seek error (#3781).
2009-03-12 08:07:49 +00:00
Werner Lemberg b17fb11f93 * src/cff/cffgload.c (cff_slot_load): Map CID 0 to GID 0. This
fixes Savannah bug #24430.
2008-10-02 10:17:32 +00:00
Werner Lemberg b4c810e2b4 * src/cff/cffgload.c (CFF_Operator, cff_argument_counts,
cff_decoder_parse_charstrings): Handle (invalid)
`callothersubr' and `pop' instructions.
2008-09-22 11:28:46 +00:00
Werner Lemberg 634df6e3ba * src/cff/cffgload.h, src/cff/cffgload.c
(cff_decoder_set_width_only): Eliminate function call.
2008-09-16 07:25:31 +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 da32d7054d Add one more example to the documentation of FT_Glyph_To_Bitmap. 2008-08-06 09:09:41 +00:00
Werner Lemberg 806f59341d * src/cff/cffgload.c (cff_decoder_parse_charstrings): No longer
assume that the first argument on the stack is the bottom-most
element.  Two reasons:

  o According to people from Adobe it is missing in the Type 2
    specification that pushing of additional, superfluous arguments
    on the stack is prohibited.

  o Acroread in general handles fonts differently, namely by popping
    the number of arguments needed for a particular operand (as a PS
    interpreter would do).  In case of buggy fonts this causes a
    different interpretation which of the elements on the stack are
    superfluous and which not.

Since there are CFF subfonts (embedded in PDFs) which rely on
Acroread's behaviour, FreeType now does the same.
2008-07-30 05:28:37 +00:00
Werner Lemberg bdcfddcd43 * src/cff/cffgload.c (cff_decoder_prepare,
cff_decoder_parse_charstrings): Improve debug output.
2008-07-26 21:22:20 +00:00
Werner Lemberg e6e6eade04 Finish fix of scaling bug of CID-keyed CFF subfonts.
* include/freetype/internal/ftcalc.h, src/base/ftcalc.c
(FT_Matrix_Multiply_Scaled, FT_Vector_Transform_Scaled): New
functions.

* src/cff/cffobjs.h (CFF_Internal): New struct.  It is used to
provide global hinting data for both the top-font and all subfonts
(with proper scaling).

* src/cff/cffobjs.c (cff_make_private_dict): New function, using
code from `cff_size_init'.
(cff_size_init, cff_size_done, cff_size_select, cff_size_request):
Use CFF_Internal and handle subfonts.
(cff_face_init): Handle top-dict and subfont matrices correctly;
apply some heuristic in case of unlikely matrix concatenation
results.  This has been discussed with people from Adobe (thanks
goes mainly to David Lemon) who confirm that the CFF specs are fuzzy
and not correct.

* src/cff/cffgload.h (cff_decoder_prepare): Add `size' argument.

* src/cff/cffgload.c (cff_builder_init): Updated.
(cff_decoder_prepare): Handle hints globals for subfonts.
Update all callers.
(cff_slot_load): Handling scaling of subfonts properly.

* src/cff/cffparse.c (cff_parse_fixed_dynamic): New function.
(cff_parse_font_matrix): Use it.

* src/cff/cfftypes.h (CFF_FontDictRec): Make `units_per_em'
FT_ULong.

* docs/CHANGES: Document it.
2008-05-14 23:05:38 +00:00
Werner Lemberg de9479a00d * include/freetype/internal/psaux.h (T1_BuilderRec): Mark `scale_x'
and `scale_y' as obsolete since they aren't used.
* src/psaux/psobjs.c (t1_builder_init): Updated.

* src/cff/cffgload.h (CFF_Builder): Mark `scale_x' and `scale_y' as
obsolete since they aren't used.
* src/cff/cffgload.c (cff_builder_init): Updated.
2008-04-26 12:52:57 +00:00
Werner Lemberg bd7e1c3ce0 Pass options from one configure script to another as-is (not
expanded).  This is needed for options like
--includedir='${prefix}/include'.

* builds/unix/detect.mk, configure: Prevent argument expansion in
call to the (real) `configure' script.



* src/truetype/ttgload.c (load_truetype_glyph): Fix compilation if
TT_USE_BYTECODE_INTERPRETER isn't defined.



There exist CFFs which contain opcodes for the Type 1 operators
`hsbw' and `closepath' which are both invalid in Type 2 charstrings.
However, it doesn't harm to support them.

* src/cff/cffgload.c (CFF_Operator): Add `cff_op_hsbw' and
`cff_op_closepath.'
(cff_argument_counts): Ditto.

(cff_decoder_parse_charstrings): Handle Type 1 opcodes 9 (closepath)
and 13 (hsbw) which are invalid in Type 2 charstrings.
2007-12-06 17:17:30 +00:00
Werner Lemberg 5b4d435a96 * src/cff/cffgload.c (cff_slot_load): Fix logic of 2007-05-28
change.
2007-06-20 07:07:55 +00:00
Werner Lemberg 95104a4d57 * src/cff/cffgload.c (cff_decoder_prepare): Fix change from
2007-06-06.
2007-06-18 07:33:10 +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 1053656d24 whitespace 2007-06-05 06:49:50 +00:00
Werner Lemberg 99e0c18ea1 Formatting, reformulations. 2007-05-29 07:00:23 +00:00
David Turner c510d5d837 remove compiler warning (unused variable) 2007-05-28 21:34:04 +00:00
David Turner 552a956247 optimize CFF glyph loader (avoid apply identity font transform) 2007-05-28 15:45:35 +00:00
Werner Lemberg 4b2e83d5b5 A new set of spelling fixes from Alexei.
Add some copyright messages.
2007-02-01 07:58:02 +00:00
David Turner a42567bf66 - same CFF loader fix (stricter checking though than Werner's version)
- document light auto-hinter improvements
2007-01-25 12:23:37 +00:00
Werner Lemberg f629439905 formatting, copyright years 2007-01-06 07:47:45 +00:00
David Turner 5dbdb6c3c4 * src/cff/cffload.c, src/cff/cffload.h, src/cff/cffgload.c,
src/cff/cfftypes.h: formatting + do not load the CFF index
	offsets into memory, since this wastes a *lot* of heap memory
	with large Asian CFF fonts. There is no significant performance
	loss
2007-01-05 13:14:08 +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 26377008e7 * src/cff/cfftypes.h (CFF_CharsetRec): Add `max_cid' member.
* src/cff/cffload.c (cff_charset_load): Set `charset->max_cid'.

* src/cff/cffgload.c (cff_slot_load): Change type of third parameter
to `FT_UInt'.
Check range of `glyph_index'.
* src/cff/cffgload.h: Updated.
2006-03-21 18:41:40 +00:00
Wu, Chia-I (吳佳一) f5aa47beb0 Clean up the SFNT_Interface. Table loading functions are now named
after the tables' tags;  `hdmx' is TrueType-specific and thus the code
is moved to the truetype module; `get_metrics' is moved here from the
truetype module so that the code can be shared with the cff module.

This pass involves no real changes.  That is, the code is moved
verbatim mostly.  The only exception is the return value of
`tt_face_get_metrics'.

* include/freetype/internal/sfnt.h, src/sfnt/rules.mk,
src/sfnt/sfdriver.c, src/sfnt/sfnt.c, src/sfnt/sfobjs.c,
src/sfnt/ttload.c, src/sfnt/ttload.h, src/sfnt/ttsbit.c,
src/sfnt/ttsbit.h, src/sfnt/ttsbit0.c: Clean up the SFNT_Interface.

* src/sfnt/ttmtx.c, src/sfnt/ttmtx.h: Metrics-related tables' loading
and parsing code is moved here.
Move `tt_face_get_metrics' here from the truetype module.  The return
value is changed from `void' to `FT_Error'.

* include/freetype/internal/fttrace.h: New trace: ttmtx.

* src/truetype/ttpload.c, src/truetype/ttpload.h: `hdmx' loading and
parsing code is moved here.
New function `tt_face_load_prep' splitted from `tt_face_load_fpgm'.
`tt_face_load_fpgm' returns `FT_Err_Ok' if `fpgm' doesn't exist.

* src/cff/cffgload.c, src/cff/cffobjs.c: Update.

* src/truetype/ttgload.c, src/truetype/ttobjs.c: Update.
2006-02-14 06:40:10 +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 (吳佳一) 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
Werner Lemberg 1723dcc261 Formatting, minor clean-ups. 2006-01-15 07:30:32 +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 cfc0cf2e78 Add vertical metrics support to OpenType CFF outlines. Based on a
patch from Mike Moening <MikeM@RetekSolutions.com>

* src/cff/cffgload.c (cff_face_get_vertical_metrics): New function.
(cff_slot_load): Use cff_face_get_vertical_metrics.

* docs/CHANGES: Updated.
2005-11-17 08:12:00 +00:00
David Turner 9fbd2ab884 - various performance enhancements
- fixing apinames.c, adding support for Watcom and Borland compilers
- adding generation of exported symbols list to the build system, including the Unix one !!

sorry Werner, I have no time to document this in ChangeLog at the moment
2005-10-28 16:14:14 +00:00
Werner Lemberg da245ee30a Forgot to check in last change. 2005-08-18 07:40:32 +00:00
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 b01676b223 * src/cff/cffobjs.c (cff_face_init): Set default upem value in top
font dict also.
Handle font matrix settings in subfonts.

* src/cff/cffgload.c (cff_slot_load): Use the correct font matrix
for CID-keyed fonts with subfonts.

* docs/formats.txt: Updated.
2005-04-18 07:13:07 +00:00
Werner Lemberg f258627e83 * src/cff/cffgload.h (CFF_Builder): Remove `error'
* src/cff/cffgload.c (cff_decoder_parse_charstrings): Replace
`Memory_Error' with `Fail' und update all users.
2004-05-13 21:59:17 +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 ba80d61c7a * builds/unix/ftconfig.in, builds/vms/ftconfig.h: Define
FT_CHAR_BIT.

* src/base/ftobjs.c (FT_Load_Glyph): Don't apply autohinting if
glyph is vertically distorted or mirrored.

* src/cff/cffgload.c (cff_slot_load): Handle zero `size' properly
for embedded bitmaps.

* docs/CHANGES: Updated.
2004-04-16 09:56:30 +00:00
Werner Lemberg bfb712fb36 Add embedded bitmap support to CFF driver.
* src/cff/cffobjs.h (CFF_SizeRec): New structure.

* src/cff/cffgload.c (cff_builder_init): Updated.
(cff_slot_load): Updated.
[TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Load sbit.

* src/cff/cffobjs.c (sbit_size_reset)
[TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: New function.
(cff_size_get_globals_funcs, cff_size_done, cff_size_init): Updated.
(cff_size_reset): Updated.
[TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Call sbit_size_reset.

* src/cff/cffdrivr.c (Load_Glyph): Updated.
(cff_driver_class): Use CFF_SizeRec.

* docs/CHANGES: Updated.
2004-03-03 08:21:12 +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 916838ca68 * src/cff/cffgload.c (cff_decoder_parse_charstrings)
<cff_op_endchar>: Preserve glyph width before calling
cff_operator_seac.

* src/cff/cffgload.c (cff_decoder_parse_charstrings): Handle special
first argument for `hintmask' and `cntrmask' operators also.
2004-02-10 16:02:20 +00:00
Werner Lemberg 5972e9abf8 * src/cff/cffgload.c (cff_operator_seac): Fix magnitude of
accent offset.
Update code similarly to the seac support for Type 1 fonts.
(cff_decoder_parse_charstrings) <cff_op_endchar>: Fix magnitude
of accent offset.
Don't hint glyphs twice if seac is emulated.
<cff_op_flex>: Assign correct point tags.
* docs/CHANGES: Updated.

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

* src/type1/t1load.c (parse_subrs): Assign number of subrs only
in first run.
(parse_charstrings): Parse /CharStrings in second run without
assigning values.
(parse_dict): Skip all /CharStrings arrays but the first.  We need
this for non-standard fonts like `Optima' which have different
outlines depending on the resolution.  Note that there is no
guarantee that we get fitting /Subrs and /CharStrings arrays; this
can only be done by a real PS interpreter.
2004-02-01 00:49:56 +00:00
Werner Lemberg 84c60bba18 * src/cff/cffgload.c (cff_decoder_parse_charstrings)
[FT_DEBUG_LEVEL_TRACE]: Use `%ld' in FT_TRACE4.
<cff_op_flex1>: Change type of dx and dy to FT_Pos and remove
cast for accessing arguments.
2004-01-01 08:21:30 +00:00
Werner Lemberg 6fd9512aff * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Handle `repeated
flags set' correctly.

* src/cff/cffobjs.c (cff_face_init): Fix memory leak by deallocating
`full' and `weight' properly.
* src/cff/cffgload.c (cff_decoder_parse_charstrings)
<cff_op_hintmask> [FT_DEBUG_LEVEL_TRACE]: Use `0x' as prefix for
tracing output.
2003-12-31 07:51:30 +00:00
Werner Lemberg 328abf3094 * src/cff/cffgload.c (cff_lookup_glyph_by_stdcharcode): Handle
CID-keyed fonts.

Remove MS-DOS line endings.

Minor formatting issues.
2003-12-24 13:37:58 +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 83da52b4cd * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 32. For
example, the Japanese Hiragino font already contains 15 subfonts.

* src/cff/cffload.c (cff_font_load): Deallocate `sids' array for
CID-keyed fonts.
2003-12-20 07:30:05 +00:00
Werner Lemberg a9cd856ee2 * src/cff/cfftypes.h (CFF_FontRecDictRec): Change type of
`cid_count' to `FT_ULong'.

* src/cff/cffgload.c (cff_slot_load): Take care of empty `cids'
array.

* src/cff/cffload.c (cff_charset_done): Free `cids' array.
(cff_font_load): Create cids array only for CID-keyed fonts which
are subsetted.

* src/cff/cffobjs.c (cff_face_init): Check the availability of
the PSNames modules for non-pure CFFs also.
Set FT_FACE_FLAG_GLYPH_NAMES for a non-pure CFF also if it isn't
CID-keyed.

* src/cff/rules.mk (CFF_DRV_H): Add cfftypes.h.
2003-12-18 08:18:37 +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 9b067facf1 Use implementation specific SID value 0xFFFF to indicate that
a dictionary element is missing.

* src/cff/cffload.c (cff_subfont_load): Initialize all fields
which hold SIDs to 0xFFFF.
(cff_index_get_sid_string): Handle SID value 0xFFFF.
Handle case where `psnames' is zero.
(cff_font_load): Updated.
Don't load encoding for CID-keyed CFFs.

* src/cff/cffobjs.c (cff_face_init): Updated.
Don't check for PSNames module if font is CID-keyed.
Compute style name properly (using the same algorithm as in the
CID driver).
Fix computation of style flags.

* src/cff/cfftoken.h: Comment out handling of base_font_name.
Rename `postscript' field to `embedded_postscript'
* src/cff/cfftypes.h (CFF_FontRecDictRec): Remove `base_font_name'
and `postscript'.
2003-12-11 17:55:58 +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 43ba0842af * src/tools/glnames.py: Updated to AGL 2.0.
* src/psnames/pstables.h: Regenerated.


* include/freetype/cache/ftcglyph.h, include/freetype/ttnameid.h,
src/base/ftcalc.c, src/base/fttrigon.c, src/cff/cffgload.c,
src/otlayout/otlgsub.c, src/pshinter/pshrec.c,
src/psnames/psmodule.c, src/sfnt/sfobjs.c, src/truetype/ttdriver.c:
Decorate constants with `U' and `L' if appropriate.

* include/freetype/ftmoderr.h: Updated to include recent module
additions.

* src/pshinter/pshnterr.h (FT_ERR_BASE): Define as
`FT_Mod_Err_PShinter'.
* src/type42/t42error.h (FT_ERR_BASE): Define as
`FT_Mod_Err_Type42'.

* src/pshinter/pshrec.h (PS_HINTS_MAGIC): Removed.  Not used.


* include/freetype/config/ftconfig.h [__MWERKS__]: Define FT_LONG64
and FT_INT64.
2003-06-23 19:26:53 +00:00
Werner Lemberg 8b88466061 * src/autohint/ahhint.c (ah_hinter_hint_edges): Removed. Just a
wrapper for ah_hint_edges.
(ah_hint_edges): Renamed to...
(ah_hinter_hint_edges): This.

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

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

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

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

* src/sfnt/sfobjs.c (sfnt_load_face): Commented out code which
increased root->height by 15% if the line gap was zero.  There exist
fonts (containing e.g. form drawing characters) which intentionally
have a zero line gap value.
2003-06-03 11:51:43 +00:00
Werner Lemberg 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 2acb963baf Cleanups. 2003-04-23 06:47:12 +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
Werner Lemberg 68e9f92710 * src/sfnt/ttpost.c (load_post_names, tt_face_free_ps_names,
tt_face_get_ps_name): Replace switch statement with if clauses to
make it more portable.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* builds/amiga/include/freetype/config/ftmodule.h: Updated.
2002-09-27 11:09:23 +00:00
Werner Lemberg 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
Graham Asher 9eefed125a Simplified the incremental loading system for CFF fonts and fixed
a problem with the handling of the deprecated version of the Type 2
endchar command, that emulates Type 1 'seac'.
This version now works with the GhostScript-to-FreeType bridge
currently under development.
2002-08-23 10:08:38 +00:00
Werner Lemberg f25ce9d0b3 * src/cff/cffgload.c (cff_free_glyph_data),
src/cff/cffload.c (cff_font_load): Use FT_UNUSED.

* src/base/ftglyph.c (FT_Glyph_To_Bitmap): Initialize `error'.
* src/sfnt/sfobjs.c (SFNT_Load_Face): Fix compiler warning.
2002-08-15 23:07:18 +00:00
Graham Asher 824daa5881 Fixed compiler warnings about unreferenced formal parameters when
FT_CONFIG_OPTION_INCREMENTAL is not defined.
2002-08-15 12:58:21 +00:00
Graham Asher 3fd12f1478 Implemented incremental loading for the CFF driver. 2002-08-15 12:10:48 +00:00
Werner Lemberg b3d5e9cf03 s/ft_memset/FT_MEM_SET/.
s/FT_MEM_SET/FT_MEM_ZERO/ where appropriate.
2002-07-28 05:05:24 +00:00
Werner Lemberg 7f74a52a21 Fixing ChangeLog entries.
Some formatting.

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

* src/autohint/ahhint.c (ah_hint_edges_3): Fix compiler warning.
* src/cff/cffload.c (cff_encoding_load): Remove `memory' variable.
* src/cff/cffcmap.c (cff_cmap_encoding_init): Remove `psnames'
variable.
* src/truetype/ttgload.c (load_truetype_glyph): Remove statement
without effect.
* src/truetype/ttdriver (Get_Char_Index, Get_Next_Char): Removed.
2002-07-26 09:09:10 +00:00
David Turner b9b2cac634 * src/cff/cffcmap.c, src/cff/cffcmap.h, Jamfile, rules.mk: new files added
to support charmaps for CFF fonts

    * src/cff/cffload.c, src/cff/cffload.h, src/cff/cffobjs.c,
    src/cff/cffobjs.h, src/cff/cffparse.c, src/cffparse.h, src/cff/cffgload.c,
    src/cff/cffgload.h: adding support for CFF charmaps, reformatting the
    sources, and removing some bugs in the Encoding and Charset loaders
2002-07-10 16:52:06 +00:00
David Turner 27c322e983 * include/freetype/freetype.h, src/base/ftobjs.h,
freetype/internal/ftobjs.h, freetype/internal/psaux.h,
    freetype/internal/pshints.h, src/psaux/t1decode.c, src/cff/cffgload.h,
    src/cff/cffgload.c, src/pshinter/pshalgo1.h, src/pshinter/pshalgo1.c,
    src/pshinter/pshalgo2.h, src/pshinter/pshalgo2.c, src/pshinter/pshalgo3.h,
    src/pshinter/pshalgo3.c: Adding support for hinter-specific bit flags,
    and the new FT_Set_Hint_Flags high-level API
2002-07-08 22:26:11 +00:00
Werner Lemberg 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
Werner Lemberg 48c984b5bb * src/cff/cffdrivr.c (cff_get_glyph_name): Fix debug message.
* src/cff/cffobjs.c (CFF_Driver_Init, CFF_Driver_Done)
[TT_CONFIG_OPTION_EXTEND_ENGINE]: Removed.
* src/cff/sfobjs.c (SFNT_Load_Face)
[TT_CONFIG_OPTION_EXTEND_ENGINE]: Ditto.
* src/truetype/ttobjs.c (TT_Init_Driver, TT_Done_Driver)
[TT_CONFIG_OPTION_EXTEND_ENGINE]: Ditto.

* src/truetype/ttdriver.c, src/truetype/ttobjs.c,
src/truetype/ttobjs.h: Renaming driver functions to the
FT_<Subject>_<Action> scheme:

  TT_Init_Driver => TT_Driver_Init
  TT_Done_Driver => TT_Driver_Done
  TT_Init_Face   => TT_Face_Init
  TT_Done_Face   => TT_Face_Done
  TT_Init_Size   => TT_Size_Init
  TT_Done_Size   => TT_Size_Done
  TT_Reset_Size  => TT_Size_Reset
2002-03-30 16:41:09 +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 eba5ad4b37 no message 2002-03-14 12:56:35 +00:00
David Turner ab4fc4da58 * include/freetype/internal/cfftypes.h, src/cff/*.c: updating the
type definitions of the CFF font driver

        (i.e. CFF_Font  => CFF_FontRec
              CFF_Font* => CFF_Font, etc...)
2002-03-14 08:57:10 +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 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 4d57024d1c * moving all code related to glyph loaders to "internal/ftgloadr.h"
and "src/base/ftgloadr.c".

        Note also that the type "FT_GlyphLoader" is now a pointer to the
        structure "FT_GlyphLoaderRec"..
2002-02-24 02:59:24 +00:00
Werner Lemberg af594e606a * builds/amiga/*: Adaptations to latest changes.
Support added for MorphOS.

* src/pshinter/pshrec.c (FT_COMPONENT): Redefine to `trace_pshrec'.
(ps_mask_table_merge, ps_hints_open, ps_hints_stem,
ps_hints_t1stem3, ps_hints_t2mask, ps_hints_t2counter): Fix
FT_ERROR messages.
* src/pshinter/pshalgo1.c (FT_COMPONENT): Define as
`trace_pshalgo1'.
* src/pshinter/pshalgo2.c (FT_COMPONENT): Define as
`trace_pshalgo2'.
* include/freetype/internal/ftdebug.h (FT_Trace): Updated.

* docs/modules.txt: New file.
2001-12-22 14:38:40 +00:00
David Turner b5c7de5b37 * src/cff/cffgload.c: added a comment regarding "cntrmask" operator
* src/pshinter/pshrec.c: now ignores invalid "hintmask" and "cntrmask"
        operators (instead of returning an error). Glyph 2028 of the CFF font
        "MSung-Light-Acro" couldn't be rendered otherwise (it seems its
        charstring is buggy, though this requires more analysis)..
2001-12-21 21:21:13 +00:00
David Turner 7c0d20814a * src/cff/cffgload.c, src/psaux/t1decode.c, src/pshinter/pshrec.c,
src/pshinter/ahalgo2.c, src/pshinter/pshglob.h: fixed a bug where
        the X and Y axis where inversed in the postscript hinter. this
        caused problem when displaying on non-square surfaces..
2001-12-21 15:59:43 +00:00
Werner Lemberg f41e71a199 * src/base/ftobjs.c (FT_Done_Library): Remove compiler warning.
Formatting.
2001-12-20 21:22:02 +00:00
David Turner c8087481df * docs/TODO: added "stem3 and counter hints support" to the TODO list
for the Postscript hinter

        * docs/BUGS: closed the AUTOHINT-NO-SBITS bug.

        * src/pshinter/pshrec.c (t2_hint_stems), src/cff/cffobjs.h,
        src/cff/cffobjs.c, src/cff/cffload.c, src/cff/cffload.h,
        src/cff/cffgload.c, src/cff/cffgload.h, src/cff/cffdriver.c,
        include/freetype/internal/cfftypes.h: added Postscript hinter support
        to the CFF driver

        * src/base/ftobjs.c (FT_Done_Library): fixed a stupid bug that crashed
        the library on exit
2001-12-20 13:14:18 +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
David Turner 2b30c17fd3 * src/pshint/pshglob.c: adding correct BlueScale/BlueShift support,
plus family blues processing

    * src/cff/cffgload.c: started adding support for the Postscript hinter
2001-12-12 16:07:29 +00:00
Werner Lemberg 415235df1b finishing function header formatting
updating copyrights
2001-06-28 17:49:10 +00:00
Werner Lemberg 93616ecb66 next round in function header formatting 2001-06-27 19:46:12 +00:00
Werner Lemberg 8eb0353fec Formatting. 2001-06-19 23:03:41 +00:00
David Turner 8edbcabce1 - updated doc for FT_New_Memory_Face
- removed lots of compiler warnings in lint-style
  warning modes (/W4 with Visual C++)
2001-06-19 08:28:24 +00:00
Werner Lemberg cf24d51531 Minor cleanups to remove compiler warnings.
* include/freetype/cache/ftcmanag.h (FTC_MAX_BYTES_DEFAULT): Use
`L' for constant.
* include/freetype/config/ftoption.h (FT_RENDER_POOL_SIZE): Ditto.
* src/base/ftcalc.c (FT_MulDiv): Use `L' for constant.
* src/base/ftglyph.c (FT_Glyph_Get_CBox): Remove `error' variable.
* src/base/fttrigon.c (ft_trig_arctan_table): Use `L' for constants.
* src/base/ftobjs.c (FT_Done_Size): Fix return value.
(FT_Set_Char_Size, FT_Set_Pixel_Sizes, FT_Get_Kerning): Remove
unused `memory' variable.
* src/autohint/ahglyph.c (ah_get_orientation): Use `L' for constant.
* src/autohint/ahhint.c (ah_hint_edges_3,
ah_hinter_align_edge_points): Remove unused `before' and `after'
variables.
(ah_hinter_align_weak_points): Remove unused `edge_limit' variable.
(ah_hinter_load): Remove unused `new_advance', `start_contour',
and `metrics' variables.
* src/cff/cffload.c (CFF_Load_Encoding): Remove dead code to avoid
compiler warning.
* src/cff/cffobjs.c (CFF_Init_Face): Remove unused `base_offset'
variable.
* src/cff/cffgload.c (CFF_Parse_CharStrings): Remove unused
`outline' variable.
(cff_compute_bias): Use `U' for constant.
* src/cid/cidload.c (cid_decrypt): Ditto.
* src/psaux/psobjs.c (T1_Decrypt): Ditto.
* src/psaux/t1decode.c (T1_Decoder_Parse_CharStrings): Ditto.
* src/sfnt/ttload.c (TT_Load_Kern): Remove unused `version'
variable.
* src/sfnt/ttsbit.c (TT_Load_SBit_Image): Remove unused `top'
variable.
* src/truetype/ttgload.c (load_truetype_glyph): Remove unused
`num_contours' and `ins_offset' variables.
(compute_glyph_metrics): Remove unused `Top' and `x_scale'
variables.
(TT_Load_Glyph): Remove unused `memory' variable.
* src/smooth/ftgrays.c (grays_raster_render): Use `L' for constants.
2001-06-18 14:23:45 +00:00
Werner Lemberg 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 6d4fbec1b8 * ftconfig.h, ftoption.h: updated "ftconfig.h" to detect 64-bit int
types on platforms where Autoconf is not available). Also removed
	FTCALC_USE_LONG_LONG and replaced it with FT_CONFIG_OPTION_FORCE_INT64

	* builds/win32/freetype.dsp: updated the Visual C++ project file. Doesn't
	create a DLL yet..

	* cffgload.c: removed a compilation warning
2001-04-20 08:50:36 +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 8316bc596d In function CFF_Parse_CharStrings(), added support for deprecated
operator "dotsection".

Submitted by Sander van der Wal <svdwal@xs4all.nl>
2001-03-16 13:35:56 +00:00
Werner Lemberg 2e35c9b406 formatting 2001-03-06 13:56:42 +00:00
Tom Kacvinsky e20035ae3c 2001-03-05 Tom Kacvinsky <tjk@ams.org>
* src/cff/cffgload.c (CFF_Load_Glyph): Set glyph control data to the
	the Type 2 glyph charstring (used by conversion programs).
	Submitted by Ha Shao <hashao@chinese.com>.
2001-03-05 16:22:25 +00:00
Werner Lemberg d573c7e76b formatting 2001-01-03 07:14:12 +00:00
Tom Kacvinsky cd92b11dc6 This file was previously known as t2gload.c. 2001-01-03 00:15:00 +00:00