Commit Graph

176 Commits

Author SHA1 Message Date
Werner Lemberg 4188deacf3 Comments. 2015-10-30 08:07:56 +01:00
Werner Lemberg 5179c89f61 Comments. 2015-10-19 08:49:25 +02:00
Werner Lemberg a451638ec5 Rename `svxf86nm.h' to `svfntfmt.h'; update related symbols.
* include/internal/ftserv.h (FT_SERVICE_XFREE86_NAME_H): Renamed
to...
(FT_SERVICE_FONT_FORMAT_H): This.

* include/internal/services/svfntfmt.h (FT_XF86_FORMAT_*): Renamed
to ...
(FT_FONT_FORMAT_*): This.

src/base/ftfntfmt.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/pfr/pfrdrivr.c,
src/truetype/ttdriver.c, src/type1/t1driver.c,
src/type42/t42drivr.c, src/winfonts/winfnt.c: Updated.
2015-03-11 08:55:12 +01:00
Werner Lemberg 851e815127 Various compiler warning fixes for `make multi'.
* src/autofit/afcjk.c (af_cjk_hints_compute_blue_edges),
src/autofit/aflatin.c (af_latin_hint_compute_blue_edges,
af_latin_hint_edges), src/autofit/aflatin2.c
(af_latin2_hints_compute_blue_edges, af_latin2_hint_edges): Declare
as `static'.

* src/cache/ftccmap.c (FTC_CMAP_QUERY_HASH, FTC_CMAP_NODE_HASH):
Removed.  Unused.
* src/cache/ftcimage.c: Include FT_INTERNAL_OBJECTS_H.
* src/cache/ftcmanag.c (FTC_LRU_GET_MANAGER): Removed.  Unused.

* src/cff/cf2intrp.c: Include `cf2intrp.h'.
* src/cff/cffdrivr.c (PAIR_TAG): Removed.  Unused.

* src/gzip/ftgzip.c (NO_DUMMY_DECL): Removed.  Unused.

* src/psaux/afmparse.c (afm_parser_read_int): Declare as `static'.

* src/pshinter/pshalgo.c (STRONGER, PSH_ZONE_MIN, PSH_ZONE_MAX):
Removed.  Unused.

* src/raster/ftraster.c (Render_Glyph): Declare as `static'.

* src/sfnt/ttpost.c (load_format_20): Fix signedness warning.

* src/truetype/ttdriver.c (PAIR_TAG): Removed.  Unused.
* src/truetype/ttsubpix.c (is_member_of_family_class,
is_member_of_style_class): Declare as `static'.

* src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Declare
as `static'.
* src/type1/t1load.c (mm_axis_unmap, mm_weights_unmap): Declare as
`static'.
(T1_FIELD_COUNT): Removed.  Unused.
* src/type1/t1parse.h (T1_Done_Table): Removed.  Unused.

* src/type42/t42parse.c (T1_Done_Table): Removed.  Unused.
2015-03-01 19:27:09 +01:00
Werner Lemberg f57fc59e01 Run `src/tools/update-copyright'. 2015-01-17 20:41:43 +01:00
Werner Lemberg 5018477f4e Minor. 2014-12-07 08:17:12 +01:00
Werner Lemberg 04edbbda3c */*: s/Invalid_Argument/Invalid_Face_Handle/ where appropriate. 2014-11-25 10:21:13 +01:00
Werner Lemberg b24e8ba28a [Savannah bug #43682] Add/remove `void' casts to some functions.
We use a cast to indicate that we intentionally ignore a function's
return value.  However, this doesn't apply to API functions where
errors can only happen for trivially invalid input.

* src/base/ftstroke.c (FT_Glyph_Stroke, FT_Glyph_StrokeBorder),
src/base/ftsynth.c (FT_GlyphSlot_Embolden), src/cff/cffgload.c
(cff_slot_load), src/pfr/pfrdrivr.c (pfr_get_kerning),
src/type1/t1load.c (parse_encoding), src/type42/t42parse.c
(t42_parse_encoding): Do it.
2014-11-25 08:30:49 +01:00
Werner Lemberg 7e4b0fbfdd [truetype] Improve emulation of vertical metrics.
This commit also improves the start values of vertical phantom
points.  Kudos to Greg Hitchcock for help.

* src/truetype/ttgload.c (TT_Get_VMetrics): Add parameter to pass
`yMax' value.  Replace code with fixed Microsoft definition.
(tt_get_metrics): Updated.
(TT_LOADER_SET_PP): Add explanation how to initialize phantom
points, taken from both the OpenType specification and private
communication with Greg (which will eventually be added to the
standard).
Fix horizontal position of `pp3' and `pp4'.

* src/truetype/ttgload.h: Updated.

* src/truetype/ttdriver.c (tt_get_advances): Updated.

* docs/CHANGES: Updated.
2013-11-06 07:14:49 +01:00
Werner Lemberg f04951af8d [truetype] Add `interpreter-version' property.
This makes the option TT_CONFIG_OPTION_SUBPIXEL_HINTING controllable
at runtime.

* src/truetype/ttdriver.c: Include FT_TRUETYPE_DRIVER_H.
(tt_property_set, tt_property_get): Fill templates.

* src/truetype/ttobjs.h (TT_DriverRec): Add `interpreter_version'
member.
Remove unused `extension_component' member.

* src/truetype/ttgload.c: Include FT_TRUETYPE_DRIVER_H.
(tt_get_metrics, TT_Hint_Glyph, TT_Process_Simple_Glyph,
compute_glyph_metrics, tt_loader_init): Use `interpreter_version'.

* src/truetype/ttinterp.c: Include FT_TRUETYPE_DRIVER_H.
(SUBPIXEL_HINTING): New macro to check `interpreter_version' flag.
Update all affected functions to use it.
Use TT_INTERPRETER_VERSION_XXX where appropriate.

* src/truetype/ttobjs.c: Include FT_TRUETYPE_DRIVER_H.
(tt_driver_init): Initialize `interpreter_version'.

* src/truetype/ttsubpix.c: Include FT_TRUETYPE_DRIVER_H.
Use TT_INTERPRETER_VERSION_XXX where appropriate.
2013-05-17 13:51:07 +02:00
Werner Lemberg cd888753c8 [truetype] Add framework for TrueType properties.
* src/truetype/ttdrivr.c: Include FT_SERVICE_PROPERTIES_H.
(tt_property_set, tt_property_get): New functions, still empty.
Define `tt_service_properties' service.
Update `tt_services'.

* src/truetype/ttpic.h: Include FT_SERVICE_PROPERTIES_H.
(TT_SERVICE_PROPERTIES_GET): New macro.
(TTModulePIC): Add `tt_service_properties'.
2013-05-12 15:08:57 +02:00
Werner Lemberg f6aa089f12 */* [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove macro and guarded code. 2013-05-10 07:58:47 +02:00
Werner Lemberg e3c9301581 */*: Use FT_Err_Ok only.
This is a purely mechanical conversion.
2013-03-14 11:21:17 +01:00
Werner Lemberg 059bc335ce */*: Use `FT_THROW'.
This is essentially a mechanical conversion, adding inclusion of
`FT_INTERNAL_DEBUG_H' where necessary, and providing the macros for
stand-alone compiling modes of the rasterizer modules.

To convert the remaining occurrences of FT_Err_XXX and friends it is
necessary to rewrite the code.  Note, however, that it doesn't harm
if some cases are not handled since FT_THROW is a no-op.
2013-03-14 10:27:35 +01:00
Werner Lemberg 0c633e3fcd [sfnt, truetype] More renamings for orthogonality.
* src/sfnt/sfdriver.c, src/sfnt/sfntpic.h, src/sfnt/ttcmap.c,
src/truetype/ttdriver.c, src/truetype/ttpic.h: s/FT_SFNT_/SFNT_/,
s/FT_TT_/TT_/, s/GET_CMAP_INFO_GET/CMAP_INFO_GET/.
2012-08-27 07:43:28 +02:00
Werner Lemberg 5987445073 Formatting, comment fixes. 2012-07-29 13:15:53 +02:00
Werner Lemberg 6b5b6f39e7 Prepare source code for amalgamation (6/6).
* src/cff/cffdrivr.c: s/Load_Glyph/cff_glyph_load/.

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

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

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

* src/type1/t1load.c: s/parse_font_matrix/t1_parse_font_matrix/.
2012-02-24 12:26:25 +01:00
suzuki toshiya 226f361975 Fix PIC build broken by d9145241fe.
Under PIC configuration, FT_{CFF,PSCMAPS,SFNT,TT}_SERVICES_GET
take no arguments but derefer the variable named `library'
internally.

* src/cff/cffdrivr.c (cff_get_interface): Declare `library' and
set it if non-NULL driver is passed.
* src/truetype/ttdriver.c (tt_get_interface): Ditto.

* src/sfnt/sfdriver.c (sfnt_get_interface): Declare `library'
under PIC configuration, and set it if non-NULL module is given.
* src/psnames/psmodule.c (psnames_get_interface): Ditto.
2012-01-14 06:40:03 +09:00
Werner Lemberg c52f44d4fd Whitespace. 2011-11-30 10:46:53 +01:00
Steven Chu b0962ac34e [truetype] Fix metrics on size request for scalable fonts.
* src/truetype/ttdriver.c (tt_size_request): Fix copying metrics
from TT_Size to FT_Size if scalable font.
2011-07-16 09:12:42 +02:00
Behdad Esfahbod 8c82ec5b17 Always ignore global advance.
This makes FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH redundant,
deprecated, and ignored.  The new behavior is what every major user
of FreeType has been requesting.  Global advance is broken in many
CJK fonts.  Just ignoring it by default makes most sense.

* src/truetype/ttdriver.c (tt_get_advances),
src/truetype/ttgload.c (TT_Get_HMetrics, TT_Get_VMetrics,
tt_get_metrics, compute_glyph_metrics, TT_Load_Glyph),
src/truetype/ttgload.h: Implement it.

* docs/CHANGES: Updated.
2011-04-21 08:21:37 +02:00
suzuki toshiya d9145241fe Prevent NULL pointer dereference passed to FT_Module_Requester. 2010-02-05 02:58:24 +09:00
Werner Lemberg 2a33275e3a Fix Savannah bug #28395.
* src/truetype/ttdriver.c (Load_Glyph), src/type1/t1gload.c
(T1_Loada_Glyph): Don't check `num_glyphs' if incremental interface
is used.
2010-01-05 10:27:15 +01:00
Oran Agra 2e7a4e9b7f Position Independent Code (PIC) support in truetype driver.
* include/freetype/internal/services/svmm.h add macros to init
instances of FT_Service_MultiMastersRec.
* include/freetype/internal/services/svttglyf.h add macros to init
instances of FT_Service_TTGlyfRec.

* src/truetype/ttdriver.h declare tt_driver_class using macros from
ftdriver.h, when FT_CONFIG_OPTION_PIC is defined create and destroy
functions will be declared.
* src/truetype/ttdriver.c when FT_CONFIG_OPTION_PIC is defined
the following structs:
tt_service_gx_multi_masters, tt_service_truetype_glyf, tt_driver_class
and tt_services array,
will have functions to init or create and destroy them
instead of being allocated in the global scope.
And macros will be used from ttpic.h in order to access them
from the pic_container.
* src/truetype/ttobjs.c change trick_names array to be
PIC-compatible by being a two dimentional array rather than array
of pointers.

New Files:
* src/truetype/ttpic.h declare struct to hold PIC globals for truetype
driver and macros to access them.
* src/truetype/ttpic.c implement functions to allocate, destroy and
initialize PIC globals for truetype driver.

* src/truetype/truetype.c add new file to build: ttpic.c.
* src/truetype/jamfile add new files to FT2_MULTI build: ttpic.c.
2009-04-05 18:03:02 +03:00
Werner Lemberg 86e041b5a8 Remove redundant header inclusions.
This covers many Ghostscript Coverity issues.

* src/*: Do it.
2009-03-21 08:51:44 +01:00
Suzuki, Toshiya (鈴木俊哉) 759c07d149 load_flags of FT_Get_Advance(), FT_Get_Advances() and backends are declared as FT_Int32 to match the flags of FT_Load_Glyph() 2009-01-09 11:11:53 +00:00
Suzuki, Toshiya (鈴木俊哉) a7c00b79e0 load_flags of FT_Get_Advance(), FT_Get_Advances() and backends are declared as FT_UInt32 for 16-bit platforms 2009-01-09 07:21:16 +00:00
Werner Lemberg b972a2a294 Generalize the concept of `tricky' fonts by introducing
FT_FACE_FLAG_TRICKY to indicate that the font format's hinting
engine is necessary for correct rendering.

At the same time, slightly modify the behaviour of tricky fonts:
FT_LOAD_NO_HINTING is now ignored.  To really force raw loading
of tricky fonts (without hinting), both FT_LOAD_NO_HINTING and
FT_LOAD_NO_AUTOHINT must be used.

Finally, tricky TrueType fonts always use the bytecode interpreter
even if the patented code is used.

* include/freetype/freetype.h (FT_FACE_FLAG_TRICKY, FT_IS_TRICKY):
New macros.

* src/truetype/ttdriver.c (Load_Glyph): Handle new load flags
semantics as described above.

* src/truetype/ttobjs.c (tt_check_trickyness): New function, using
code of ...
(tt_face_init): This function, now simplified and updated to new
semantics.

* src/base/ftobjs.c (FT_Load_Glyph): Don't use autohinter for tricky
fonts.

* docs/CHANGES: Document it.
2008-12-11 08:55:48 +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 f6c120f826 * docs/CHANGES: Document FT_Face_CheckTrueTypePatents).
Formatting, reformulations.
2007-06-11 04:55:58 +00:00
David Turner 84c6f88117 * include/freetype/config/ftoption.h: clarify documentation regarding
unpatented hinting

	* include/freetype/freetype.h, src/base/ftpatent.c, src/truetype/ttdriver.c,
	include/freetype/internal/services/svttglyf.h, modules.cfg,:
	include/freetype/internal/ftserv.h,:
	Fonts without a cmap must be handled correctly by FreeType (anything
	Adding the FT_Face_CheckTrueTypePatents API to FT_FREETYPE_H, it is
	implemented by the optional src/base/ftpatent.c
2007-06-10 20:51:04 +00:00
Werner Lemberg 8c4120d0a3 Fix various compiler warnings.
* src/truetype/ttdriver.c (tt_size_select), src/cff/cffobjs.h,
src/cff/cffobjs.c (cff_size_request), src/type42/t42objs.h:
s/index/strike_index/.
* src/base/ftobjs.c (FT_Match_Size): s/index/size_index/.

* src/gxvalid/gxvmorx5.c
(gxv_morx_subtable_type5_InsertList_validate): s/index/table_index/.

* src/truetype/ttinterp.c (Compute_Point_Displacement),
src/pcf/pcfread.c (pcf_seek_to_table_type): Avoid possibly
uninitialized variables.
2007-01-15 06:42:40 +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
David Turner 6aa260ce61 support for "automatic unpatented hinting" added
we still need to determine the list of "trick" CJK fonts
that are going to toggle the bytecode interpreter instead
of the auto-hinter
2006-08-25 22:45:13 +00:00
David Turner 6c71c6b968 * include/freetype/config/ftoption.h, src/autofit/afcjk.c,
src/base/ftobjs.c, src/base/ftutil.c, src/cff/cffobjs.c,
    src/psaux/afmparse.c, src/sfnt/ttbdf.c, src/tools/apinames.c,
    src/truetype/ttdriver.c:

       solved compiler warnings as well as C++ compilation problems
2006-02-25 12:49:40 +00:00
Werner Lemberg 5edafed12a Clean-ups, copyright years, formatting. 2006-02-22 08:23:35 +00:00
David Turner 0b5dc4df88 * include/freetype/ftmodapi.h, include/internal/ftserv.h,
include/internal/services/svtteng.h, src/base/ftobjs.c,
    src/truetype/ttdriver.c:

    adding a new API named FT_Get_TrueType_Engine_Type to determine
    wether we have a patented, unpatented or unimplemented TrueType
    bytecode interpreter.

    the FT_Get_Module_Flags API was removed consequently.
2006-02-21 22:36:23 +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 9cc4aed879 Formatting. 2006-01-26 21:03:58 +00:00
Wu, Chia-I (吳佳一) bcc438b15e * include/freetype/freetype.h (FT_Select_Size): Rename the second
argument from `idx' to `strike_index'.
(FT_Size_Request_Type): Add FT_SIZE_REQUEST_TYPE_MAX to the end of
this enum.

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

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

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

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

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

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

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

* src/sfnt/ttsbit.c (tt_face_load_sbit_strikes,
tt_face_load_strike_metrics), src/sfnt/ttsbit0.c
(tt_face_load_sbit_strikes, tt_face_load_strike_metrics): The
advertised metrics in `available_sizes' are different from those
actually used.
2006-01-23 14:12:40 +00:00
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 (吳佳一) 15c1f5d36f * src/truetype/ttdriver.c (Load_Glyph): Don't check the validity of
ttmetrics here.  TrueType fonts with only sbits always have
ttmetrics.valid set to false.

* src/truetype/ttgload.c (TT_Load_Glyph): Check that ttmetrics is
valid before loading outline glyph.

* src/cache/ftcimage.c (FTC_INode_New): Fix a memory leak.
2005-08-20 08:17:44 +00:00
Wu, Chia-I (吳佳一) 0142e6aff1 * src/truetype/ttinterp.c, src/truetype/ttinterp.h: Remove original
TT_Done_Context and rename TT_Destroy_Context to TT_Done_Context with
slight changes.

* src/truetype/ttobjs.h (tt_slot_init): New function.

* src/truetype/ttobjs.c (tt_driver_init): Initialize execution context
here.
(tt_slot_init): New function to create extra points for the internal
glyph loader. We then use it directly, instead of face's glyph loader,
when loading glyph.

* src/truetype/ttdriver.c: Use tt_slot_init for glyph slot
initialization.
(TT_Load_Glyph): Load flag dependencies are handled here.
Return error if size is NULL.

* src/truetype/ttgload.c: Heavy cleanup and refactor.
(TT_Hint_Glyph): New funcion to hint a zone, prepared by caller.
(TT_Process_Simple_Glyph): Use loader->pp's instead of recalculating.
Use TT_Hint_Glyph.
No need to save/restore loader->stream before/after
TT_Vary_Get_Glyph_Deltas now.
(TT_LOADER_SET_PP): New macro to calculate and set the four phantom points.
(TT_Process_Composite_Component, TT_Process_Composite_Glyph,
load_truetype_glyph): Refactor load_truetype_glyph into these three functions.
Never set exec->glyphSize to 0. (close #13107)
Forget glyph frame before calling TT_Process_Simple_Glyph.
(TT_Load_Glyph, load_sbit_image, tt_loader_init): Refactor TT_Load_Glyph into
these three functions.
Set various fields of `glyph' here, instead of in load_truetype_glyph
and compute_glyph_metrics.
2005-08-16 01:54:59 +00:00
Werner Lemberg 8e3fc5ea0c * src/otvalid/otvcommn.h: Remove dead code.
Formatting.
2005-08-03 21:17:53 +00:00
Wu, Chia-I (吳佳一) 2a41ab9e88 * src/truetype/ttdriver.c (Set_Char_Sizes): Avoid unnecessary
computations and clean up.

* src/truetype/ttobjs.h (struct TT_SizeRec_): Comment on the
internal copy of metrics.
2005-07-26 08:14:03 +00:00
Werner Lemberg e793092d0a Formatting.
* src/truetype/ttpload.c (tt_face_load_loca): Fix typo.

* src/sfnt/ttkern.c: Include `ttkern.h'.
(FT_COMPONENT): Updated.

* include/freetype/internal/fttrace.h: Add entry for `ttkern'.

* src/sfnt/ttsbit0.c: s/FT_Err_/SFNT_Err_/.
Decorate constants with `U' and `L' where necessary.

* src/sfnt/ttcmap.c (tt_cmap4_next): Remove unused variable.
2005-03-01 02:13:50 +00:00
David Turner e5680279b2 * many, many files: several memory optimizations were implemented to
drastically reduce the heap usage of FreeType, especially in the case
  of memory-mapped files. The idea is to avoid loading and decoding tables
  in the heap, and instead access the raw data whenever possible (i.e.
  when it doesn't compromise performance).

  This had several impacts: first, opening vera.ttf uses a ridiculous amount
  of memory (when the FT_Library footprint is accounted for), until you start
  loading glyphs. Even then, you'll save at least 20 Kb compared to the non
  optimized case. performance of various operations, including open/close
  has also been dramatically improved.

  More optimisations to come. The auto-hinter eats memory like crazy? This
  must be stopped...
2005-02-26 00:12:04 +00:00
Werner Lemberg 3bcad43998 * src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.

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

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

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

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

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

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

* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 11:48:35 +00:00
Werner Lemberg 86ae11cf87 * src/truetype/ttobjs.h, src/truetype/ttobjs.c (tt_face_init,
tt_face_done, tt_size_init, tt_size_done, tt_driver_init,
tt_driver_done): Don't use TT_XXX but FT_XXX arguments which are
typecast to the proper TT_XXX within the function.
Update code accordingly.

* src/truetype/ttdriver.c (Get_Kerning, Set_Char_Sizes,
Set_Pixel_Sizes, Load_Glyph, tt_get_interface): Don't use TT_XXX but
FT_XXX arguments which are typecast to the proper TT_XXX within the
function.
Update code accordingly.
(tt_driver_class): Remove casts.
2004-05-04 16:53:45 +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 c3dc56b85c * src/truetype/ttgload.c, src/truetype/ttgload.h (TT_Load_Glyph),
src/ttdriver.c (Load_Glyph): Change type of `glyph_index' to
FT_UInt.  From Lex Warners.


* src/sfnt/ttload.c (tt_face_load_sfnt_header): Really fix change
from 2004-03-19.

* src/bdf/bdfdrivr.c (BDF_Face_Init): Use `ft_strlen'.

* src/pcf/pcfutil.c, src/pcf/pcfutil.h: Decorate functions with
`static.'.
Remove unused function `RepadBitmap'.
* src/pcf/pcfdrivr.c: Don't include pcfutil.h.
2004-04-19 06:13:50 +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 1c0b8e9d72 Only whitespace changes. 2003-10-23 04:54:14 +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
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 779afe4b91 * src/winfonts/winfnt.c (FNT_Load_Glyph): Use first_char in
computation of glyph_index.
(FNT_Size_Set_Pixels): To find a strike, first check pixel_height
only, then try to find a better hit by comparing pixel_width also.
Without this fix it isn't possible to access all strikes.
Also compute metrics.max_advance to be in sync with other bitmap
drivers.

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


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

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

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

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

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


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

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

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

* src/pcf/pcfdrivr.c (pcf_driver_class), src/winfonts/winfnt.c
(winfnt_driver_class), src/bdf/bdfdrivr.c (bdf_driver_class): Add
the FT_MODULE_DRIVER_NO_OUTLINES flag.
2003-06-17 10:42:27 +00:00
Werner Lemberg 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 b442ca1713 Cleanups. 2003-04-23 15:50:27 +00:00
David Turner 1c044d7d29 * src/truetyoe/ttdriver.c (Set_Char_Sizes): fixed a small rounding bug.
Actually, it seems that previous versions of FreeType didn't perform
    TrueType rounding exactly as appropriate.
2003-03-15 13:29:49 +00:00
David Turner 562731d487 trying to fix TrueType rendering glitches 2003-03-14 07:31:35 +00:00
David Turner ae26c684db * src/cache/ftccmap.c: the cmap cache now supports UCS-4 charmaps
when available in Asian fonts

    * src/sfnt/ttload.c, src/base/ftobjs.c: changed "asian" to "Asian" in
    comments

    * src/truetype/ttdriver.c (Set_Char_Sizes): fixed a rounding bug when
    computing the scale factors for a given character size in points with
    resolution.
2003-02-25 20:37:50 +00:00
David Turner ba4511b807 * src/truetype/ttdriver.c, src/truetype/ttobjs.h, src/truetype/ttobjs.c,
src/truetype/ttinterp.c, src/base/ftobjs.c: fixing the slight distortion
    problem that occured due to the latest auto-hinter changes
2003-02-18 22:25:22 +00:00
David Turner 4bdf4350f2 various improvements for 2.1.4. see ChangeLog, I've got problems with
copy & paste on my desktop !!
2003-01-30 23:24:18 +00:00
Werner Lemberg e59dc91ff4 * src/truetype/ttdriver.c (Load_Glyph): Fourth parameter must be
FT_Int32.
* src/truetype/ttgload.c, src/truetype/ttgload.h (TT_Load_Glyph):
Ditto.
2002-09-21 18:43:10 +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 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 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
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 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
Werner Lemberg 91db04cb9c * src/truetype/ttgload.c: 16bit fixes.
(TT_Load_Simple_Glyph): Improve debug messages.
(load_truetype_glyph): Remove dead code.
* src/truetype/ttinterp.c: 16bit fixes.
* src/truetype/ttobjs.c: Ditto.

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

formatting, copyright updates.
2002-04-01 14:25:28 +00:00
Werner Lemberg 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 b5713c54c3 * include/freetype/internal/psglobals.h (removed),
include/freetype/internal/pshints.h,
          src/pshinter/pshglob.h: removing obsolete file

        * include/freetype/internal/tttypes.h,
          include/freetype/internal/sfnt.h,
          src/base/ftnames.c, src/cff/cffdrivr.c,
          src/sfnt/*.c, src/truetype/*.c: updated SFNT/TrueType type
          definitions
2002-03-14 11:26:29 +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
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
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
David Turner c55099de40 changing pixel size computations for better accuracy (experimental) 2001-10-18 11:57:52 +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
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 6ce03efb12 * include/freetype/config/ftheader.h, include/freetype/ftsnames.h:
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
2001-03-20 14:50:04 +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
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 cc069beb2d cleanups 2000-12-08 16:17:16 +00:00
David Turner 19ed8afe60 - updated all source files to adhere to the new inclusion scheme
- the CFF loader now loads the encodings and charset tables
  though doesn't use them for now
2000-12-08 02:42:29 +00:00
Werner Lemberg f1ca234473 * src/sfnt/sfdriver.c: Include ttsbit.h and ttpost.h only
conditionally.

* src/truetype/ttdriver.c (Set_Char_Sizes, Set_Pixel_Sizes): Set
`size->strike_index' only conditionally.

* src/type1/t1driver.c, src/type1/t1objs.c: Include t1afm.h only
conditionally.

* src/winfonts/winfnt.h: Move all type definitions to...
* src/include/freetype/internal/fnttypes.h: New file.
* src/winfonts/winfnt.c: Use it.


* include/freetype/internal/ftdebug.h: Replaced FT_CAT and FT_XCAT
with a direct solution (which also satifies picky compilers).
2000-11-29 15:18:54 +00:00
David Turner f96594faf0 integrated Yamano-Uchi changes to the base source code. However,
I've made a few modifications:

  - there is no new field named "driver" in "FT_SizeRec"

  - the new fields in "TT_SizeRec" are:

       strike_index   :: value 0xFFFF means "no sbit strike selected"
       strike_metrics :: the FT_Size_Metrics structure corresponding to
                         the currently selected strike

  - the code in "ttload.c" has been somewhat cleaned up too

thanks a lot, Y-U !!

- David
2000-11-06 23:07:51 +00:00
David Turner 76a5f62323 major reformatting of the sources:
FT_EXPORT_DEF    => FT_EXPORT
  FT_EXPORT_FUNC => FT_EXPORT_DEF
  BASE_DEF               => FT_BASE
  BASE_FUNC            => FT_BASE_DEF
  LOCAL_DEF             => FT_LOCAL
  LOCAL_FUNC          => FT_LOCAL_DEF
  LOCAL_FUNC_X     => FT_CALLBACK_DEF
  LOCAL_DEF_X       => FT_CALLBACK_TABLE
  FT_CPLUSPLUS     => FT_CALLBACK_TABLE_DEF
2000-11-04 01:55:49 +00:00
Werner Lemberg ab8552321c Fixing include header for a `make multi' build.
Finishing formatting of cache stuff.

Fixed getDriverClass stuff -- added it to winfnt.c also.  Note that this
still has to be documented.
2000-10-31 22:13:54 +00:00
Werner Lemberg e4b32a5dc5 Removing trailing whitespace. 2000-10-31 20:42:18 +00:00
Werner Lemberg 29a90e2610 Updating unix/ftconfig.in to recent config/ftconfig.h changes.
More C++ fixes: Introducing LOCAL_FUNC_X for local functions used in
function pointers (there are no local anonymous functions in C++) and
FT_CPLUSPLUS (instead of FT_EXPORT_VAR) to define linkage of structures
which contain function pointers.
2000-08-03 00:03:08 +00:00
Werner Lemberg 3a89c2a4ac Removing FT_MAKE_OPTION_SINGLE_LIBRARY_OBJECT. It has never worked.
Instead, define BASE_DEF() and BASE_FUNC() similarly to FT_EXPORT_DEF() and
FT_EXPORT_FUNC(), respectively, allowing the programmer to define proper
types and/or export lists for multiple DLLs if necessary (e.g. ftbase.dll --
standalone, fttype1.dll -- needs ftbase.dll, etc.).

The library is finally compiling and linking natively with a C++ compiler!
2000-08-01 17:05:20 +00:00
David Turner 5fe4c00ed2 - fixed the incorrect SO extension for Visual C++
- disabled the TrueType interpreter by default
- disabled the "type1" driver, "type1z" is now used
  by default (the internal driver name is "type1" now !!)
2000-07-26 19:04:08 +00:00
Werner Lemberg b48a6094b2 Formatting.
Moving some internal structures and constants from freetype.h to ftobjs.h.

Finally removing FT_LOAD_ANTI_ALIAS.

Cleaning up all error codes.  Only the used ones have survived :-)

Removed unused FT_MAX_GLYPH_FORMATS constant.

T2 error codes are now in the range 0x500-0x5FF (instead of `TrueDoc').

Some minor improvements of error return values.

Finally fixing error code values in ftraster and ftgrays to be compliant
with all other FT error codes.
2000-07-09 19:15:30 +00:00
Werner Lemberg 7fa51b5535 Formatting.
Adding some trivial error checking.

Adding/Fixing tracing levels.
2000-07-08 19:51:42 +00:00