Commit Graph

52 Commits

Author SHA1 Message Date
Moazin Khatti 0bf49bd229 Add 'svg' module for OT-SVG rendering.
* CMakeLists.txt (BASE_SRCS): Add svg module file.
* meson.build (ft2_public_headers): Add `otsvg.h`.

* modules.cfg (RASTER_MODULES): Add `svg` module.

* builds/meson/parse_modules_cfg.py: Add svg module.

* include/freetype/config/ftmodule.h: Add `ft_svg_renderer_class`.
* include/freetype/fterrdef.h: Add `Invalid_SVG_Document` and
`Missing_SVG_Hooks` error codes.
* include/freetype/internal/fttrace.h: Add tracing for `otsvg`.
* include/freetype/internal/svginterface.h: New file.  It adds an interface
to enable the presetting hook from the `base` module.
* include/freetype/otsvg.h (SVG_Lib_Init_Func, SVG_Lib_Free_Func,
SVG_Lib_Render_Func, SVG_Lib_Preset_Slot_Func): New hooks for SVG rendering.
(SVG_RendererHooks): New structure to access them.

* src/base/ftobjs.c: Include `svginterface.h`.
(ft_glyphslot_preset_bitmap): Add code for presetting the slot for SVG
glyphs.
(ft_add_renderer): Updated.

* src/svg/*: New files.
2022-01-20 16:45:18 +00:00
Moazin Khatti f93a897afe Add code to load OT-SVG glyph documents.
* include/freetype/config/ftheader.h (FT_OTSVG_H): New macro.
* include/freetype/freetype.h (FT_FACE_FLAG_SVG, FT_HAS_SVG): New macros.
(FT_LOAD_SVG_ONLY): New internal macro.
* include/freetype/ftimage.h (FT_Glyph_Format): New enumeration value
`FT_GLYPH_FORMAT_SVG`.
* include/freetype/internal/ftobjs.h (FT_GLYPH_OWN_GZIP_SVG): New macro.
* include/freetype/internal/fttrace.h: Add `ttsvg` for `ttsvg.c`.
* include/freetype/internal/sfnt.h(load_svg, free_svg, load_svg_doc): New
functions.
* include/freetype/internal/tttypes.h (TT_FaceRec): Add `svg` for
the SVG table.
* include/freetype/otsvg.h (FT_SVG_DocumentRec): New structure to hold the
SVG document and other necessary information of an OT-SVG glyph in a glyph
slot.
* include/freetype/tttags.h (TTAG_SVG): New macro.

* src/base/ftobjs.c: Include `otsvg.h`.
(ft_glyphslot_init): Allocate `FT_SVG_DocumentRec` in `slot->other`
if the SVG table exists.
(ft_glyphslot_clear): Free it upon clean-up if it is a GZIP compressed
glyph.
(ft_glyphslot_done): Free the document data if it is a GZIP compressed
glyph.
(FT_Load_Glyph): Don't auto-hint SVG documents.

* src/cache/ftcbasic.c (ftc_basic_family_load_glyph): Add support for
FT_GLYPH_FORMAT_SVG.

* src/sfnt/rules.mk (SFNT_DRV_SRC): Add `ttsvg.c`.
* src/sfnt/sfdriver.c: Include `ttsvg.h`.
(sfnt_interface): Add `tt_face_load_svg`, `tt_face_free_svg` and
`tt_face_load_svg_doc`.
* src/sfnt/sfnt.c: Include `ttsvg.c`.
* src/sfnt/sfobjs.c (sfnt_load_face, sfnt_done_face): Add code to load and
free data of the the SVG table.
* src/sfnt/ttsvg.c: New file, implementing `tt_face_load_svg`,
`tt_face_free_svg` and `tt_face_load_svg_doc`.
* src/sfnt/ttsvg.h: Declarations of the SVG functions in
`ttsvg.c`.
2022-01-20 16:45:18 +00:00
Werner Lemberg d0cfb4e1b2 Update all copyright notices. 2022-01-11 10:54:10 +01:00
Werner Lemberg 205d1ae43e Small clean-ups for the last few commits.
* include/freetype/fttrace.h (afwarp): Removed.
2021-07-12 22:03:25 +02:00
David Turner 15e889800a Remove experimental "Latin2" writing system (FT_OPTION_AUTOFIT2)
This code has always been experimental and was never compiled
anyway (FT_OPTION_AUTOFIT2 does not appear in ftoption.h or even
any of our build files).
2021-07-12 09:25:07 +02:00
Werner Lemberg ff40776591 [base] Add trace level to logging output.
Some practical debugging work has shown that displaying level X of
an `FT_TRACEX` macro in the output of `FT2_DEBUG="...  -v"` would be
very helpful to find out which trace level should be selected.  As
an example, we now get output like

```
[ttobjs:2]    TTF driver
[ttobjs:2]      SFNT driver
[sfobjs:2]      not a font using the SFNT container format
[t1objs:2]    Type 1 driver
[stream:7]    FT_Stream_EnterFrame: 14 bytes
```

* include/freetype/internal/ftdebug.h (FT_LOGGING_TAGX): New macro.
(FT_LOG): Use it to add the trace level to the logging tag.

* include/freetype/internal/fttrace.h (FT_MAX_TRACE_LEVEL_LENGTH):
Adjust.

* docs/DEBUG: Updated.
2021-06-25 09:24:07 +02:00
Werner Lemberg 0d1c306e51 [psaux] Guard and trace AFM kern data allocation.
Reported as

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

* include/freetype/internal/fttrace.h: Add 'afmparse' trace
component.

* src/psaux/afmparse.c (FT_COMPONENT): Define.
(afm_parse_track_kern, afm_parse_kern_pairs): Protect against
allocations bombs.
Add tracing.
(afm_parse_kern_data): Don't allow multiple kern data sections.
2021-05-25 11:27:56 +02:00
Werner Lemberg b6e8a71266 Update all copyright notices. 2021-01-17 07:18:48 +01:00
Werner Lemberg aa1b5362d3 [sdf] Fix tracing.
* include/freetype/internal.fttrace.h: Add 'bsdf' component.

* src/sdf/ftbsdf.c, src/sdf/ftsdf.c (FT_COMPONENT): Define.
2020-12-24 08:32:04 +01:00
Anuj Verma 879ca87f0b [sdf] Add build infrastructure.
* src/sdf/module.mk, src/sfd/rules.mk: New files.

* src/sdf/ftsdf.h (ft_sdf_raster): New forward declaration.

* include/freetype/ftmoderr.h (FT_MODERRDEF): Add error definition
for the 'sdf' module.

* include/freetype/internal/fttrace.h (FT_TRACE_DEF): Add trace
definition for the `sdf' module.

* modules.cfg (RASTER_MODULES): Add the `sdf' module to the list of
rasterizers.
2020-12-24 07:23:48 +01:00
Werner Lemberg ce43d808dc [base] Implement vertical alignment of log printing.
Based on a patch by Priyesh.

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

* src/base/ftdebug.c, builds/windows/ftdebug.c (ft_log_handler):
Print logs after a fixed width to handle different lengths of
`FT_COMPONENT` entries.
Use `ft_strrchr` to check for final newline character.
2020-12-04 16:19:42 +01:00
Werner Lemberg e5038be704 Update all copyright notices. 2020-01-19 17:05:19 +01:00
Nikhil Ramakrishnan 2fa573c1b0 [sfnt] Read WOFF 2 header.
Check for WOFF2 tag, call `woff2_open_font', and implement it to read
header according to specification.

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

* src/sfnt/rules.mk (SFNT_DRV_SRC): Add `sfwoff2.c'.

* src/sfnt/sfnt.c: Include `sfwoff2.c'.

* src/sfnt/sfobjs.c (sfnt_open_font): Check for `wOF2' tag and call
`woff2_open_font'.

* src/sfnt/sfwoff2.c, src/sfnt/sfwoff2.h: New files.
2019-08-27 08:53:51 +02:00
Nikhil Ramakrishnan 7b275a5af1 [sfnt] Separate WOFF sources and headers.
Move WOFF sources and headers to separate files.

* include/freetype/internal/wofftypes.h, src/sfnt/sfwoff.c,
src/sfnt/sfwoff.h: New files.

* include/freetype/internal/fttrace.h: Register `sfwoff.c'.

* include/freetype/internal/internal.h: Define
FT_INTERNAL_WOFF_TYPES_H.

* include/freetype/internal/sfnt.h: Include FT_INTERNAL_WOFF_TYPES_H.

* include/freetype/internal/tttypes.h: Move out WOFF structures.

* src/sfnt/rules.mk: Add `sfwoff.c'.

* src/sfnt/sfnt.c: Include `sfwoff.c'.

* src/sfnt/sfobjs.c: Include `sfwoff.h', move out WOFF sources.
2019-05-30 23:57:34 +05:30
Werner Lemberg 7585997024 Update all copyright notices. 2019-02-23 10:07:09 +01:00
Werner Lemberg f686ad46a3 Update copyright years. 2019-01-22 20:31:44 +01:00
Werner Lemberg da84691914 [base] Add tracing for `FT_Bitmap_Blend'.
* include/freetype/internal/fttrace.h (trace_bitmap): New
enumeration.

* src/base/ftbitmap.c (FT_COMPONENT): Define.
(FT_Bitmap_Blend): Add `FT_TRACE5' calls.
2018-06-17 09:30:05 +02:00
Werner Lemberg e361cc6a75 s/trace_bitmap/trace_checksum/.
* include/freetype/internal/fttrace.h: s/bitmap/checksum/.

* src/base/ftobjs.c (FT_COMPONENT): s/trace_bitmap/trace_checksum/.
Adjust code.
2018-06-17 09:13:37 +02:00
Werner Lemberg a44e20879c [sfnt] Move `CPAL' stuff into separate files.
* src/sfnt/sfdriver.c: Include `ttcpal.h'.
* src/sfnt/sfnt.c: Include `ttcpal.c'.

* src/sfnt/ttcolr.c, src/sfnt/ttcolr.h: Move CPAL stuff to ...
* src/sfnt/ttcpal.c, src/sfnt/ttcpal.c: ... these new files.

* src/sfnt/Jamfile (_sources), src/sfnt/rules.mk (SFNT_DRV_SRC):
Updated.

* include/freetype/internal/fttrace.h: Add support for `colr' and
`cpal'.
Sort entries.
2018-06-14 11:32:47 +02:00
Werner Lemberg f999375a9a [GSoC] include/*.*, devel/*.*: Convert block comments to `light' style.
This second and final monster commit was created by applying Nikhil's
scripts `docconverter.py' and `markify.py' to all C header and source files,
followed up by minor manual clean-up.

No change in functionality, of course.

I used commit f7419907bc6044b9b7057f9789866426c804ba82 from
https://github.com/nikramakrishnan/freetype-docs.git.
2018-06-03 22:00:42 +02:00
Werner Lemberg 0a0c22569d Update copyright year. 2018-01-02 09:33:57 +01:00
Werner Lemberg 3cc88e2e44 Fixes for `make multi'.
* include/freetype/internal/ftpsprop.h: Use `FT_BASE_CALLBACK'.
(ps_property_get): Harmonize declaration with corresponding
function typedef.

* include/freety[e/internal/fttrace.h: Add `trace_psprops'.

* src/base/ftpsprop.c: Include necessary header files.
(FT_COMPONENT): Define.
(ps_property_set): Tag with `FT_BASE_CALLBACK_DEF'.
(ps_property_get): Tag with `FT_BASE_CALLBACK_DEF'.
Harmonize declaration with corresponding function typedef.
2017-12-27 08:19:09 +01:00
Werner Lemberg 63b91548e0 Fix `make multi'.
* include/freetype/internal/fttrace.h: Remove unused tracing macros.
s/pshalgo2/pshalgo/.
Add `trace_cffdecode'.
* src/pshinter/pshalgo.c (FT_COMPONENT): Updated.

* src/cff/cffload.c: Include FT_INTERNAL_POSTSCRIPT_AUX_H.
* src/cff/cffobjs.c: Include FT_SERVICE_METRICS_VARIATIONS_H and
FT_SERVICE_CFF_TABLE_LOAD_H.

* src/cid/cidriver.c: Include FT_INTERNAL_POSTSCRIPT_AUX_H.

* src/psaux/cffdecode.c: Include FT_FREETYPE_H and
FT_INTERNAL_DEBUG_H.
(FT_COMPONENT): Define.
* src/psaux/cffdecode.h: Include FT_INTERNAL_POSTSCRIPT_AUX_H.
* src/psaux/psauxmod.h: Include FT_INTERNAL_POSTSCRIPT_AUX_H.
Declare `cff_builder_funcs' and `ps_builder_funcs'.
* src/psaux/psft.c: Include `psobjs.h' and `cffdecode.h'.
* src/psaux/psobjs.c : Include `psauxmod.h'.
2017-12-07 14:33:44 +01:00
Werner Lemberg 563ae78022 Update copyright year. 2017-01-04 20:16:34 +01:00
Werner Lemberg 9adeab6452 Update copyright year. 2016-01-13 11:54:10 +01:00
Werner Lemberg 24aa9c665e [autofit] Rewrite HarfBuzz interface to support character clusters.
Scripts like Khmer have blue zones that can't be directly
represented by Unicode characters.  Instead, it is necessary to let
HarfBuzz convert character clusters into proper glyph representation
forms, then deriving the blue zone information from the resulting
glyphs.

* src/autofit/hbshim.c, src/autofit/hbshim.h: Replaced by...
* src/autofit/afshaper.c, src/autofit/afshaper.h: ... these two new
files, providing a new API to access HarfBuzz.

The new API manages a HarfBuzz buffer with `af_shaper_buf_create'
and `af_shaper_buf_destroy'.  The buffer receives a UTF8 encoded
string with function `af_shaper_get_cluster', and the resulting
glyph data (indices, advance widths, vertical offsets) can be
iteratively accessed with function `af_shaper_get_elem'.

* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
af_cjk_metrics_init_blues, af_cjk_metrics_check_digits): Updated.

* src/autofit/aflatin.c (af_latin_metrics_init_widths,
af_latin_metrics_init_blues, af_latin_metrics_check_digits):
Updated.

* include/freetype/internal/fttrace.h: s/afharfbuzz/afshaper/.

* src/autofit/afglobal.c: s/hbshim.h/afshaper.h/.
(af_face_globals_compute_style_coverage): Updated.

* src/autofit/afglocal.h: s/hbshim.h/afshaper.h/.

* src/autofit/autofit.c: s/hbshim.c/afshaper.c/.

* src/autofit/Jamfile, src/autofit/rules.mk (AUTOF_DRV_SRC):
Updated.
2015-12-06 18:52:41 +01:00
Werner Lemberg 392cf22f8a Another adjustment to header locations.
This change is a result of a discussion thread on freetype-devel

  http://lists.nongnu.org/archive/html/freetype-devel/2015-06/msg00041.html

Re-introduce the `freetype2' subdirectory for all FreeType header
files after installation, and rename the `freetype2' subdirectory in
the git repository to `freetype'.

* include/freetype2: Renamed to...
* include/freetype: This.

* CMakeLists.txt (PUBLIC_HEADERS, PUBLIC_CONFIG_HEADERS,
PRIVATE_HEADERS): Updated.
Update creation of `ftconfig.h'.
Install generated `ftconfig.h'.

* Jamfile (HDRMACRO, RefDoc), autogen.sh: Updated.

* builds/amiga/include/config/ftconfig.h, builds/freetype.mk
(PUBLIC_DIR), builds/symbian/bld.inf, builds/toplevel.mk (work),
builds/unix/freetype2.in: Updated.

* builds/unix/freetype-config.in: Updated.
* builds/unix/configure.raw: Don't check for `rmdir'.
* builds/unix/unix-def.in (DELDIR): Use `rm -rf', which is portable
according to the autoconf info manual.
* builds/unix/install.mk (install, uninstall,
distclean_project_unix): Update and simplify.

* builds/wince/*, builds/windows/*: Updated.

* devel/ft2build.h, include/ft2build.h: Updated.

* include/freetype2/config/ftheader.h,
include/freetype2/internal/ftserv.h,
include/freetype2/internal/internal.h: Update all header file
macros.

* src/tools/chktrcmp.py (TRACE_DEF_FILES): Updated.

* docs/*: Updated.
2015-06-26 06:48:00 +02:00
Werner Lemberg fae3820764 Simplify header file hierarchy.
This large patch changes the header file directory layout from
`include/freetype/...' to `include/...', effectively removing one
level.  Since the file `ft2build.h' is also located in `include'
(and it stays there even after installation), all FreeType header
files are now in a single directory.

Applications that use (a) `freetype-config' or FreeType's
`pkg-config' file to get the include directory for the compiler, and
(b) the documented way for header inclusion like

  #include <ft2build.h>
  #include FT_FREETYPE_H
  ...

don't need any change to the source code.

* include/freetype/*: Move up to...
* include/*: ... this directory.

* builds/amiga/include/freetype/*: Move up to...
* builds/amiga/include/*: ... this directory.

*/*: Essentially do `s@/freetype/@/@' where appropriate.

* CMakeList.txt: Simplify.
* builds/unix/freetype-config.in, builds/unix/freetype2.in: For
`--cflags', return a single directory.
* builds/unix/install.mk (install): No longer try to remove `cache'
and `internal' subdirectories; instead, remove the `freetype'
subdirectory.
2013-11-13 08:55:46 +01:00
Werner Lemberg 06474c3e5b [cff] Add a new Type 2 interpreter and hinter.
This work, written by Dave Arnold <darnold@adobe.com> and fully
integrated into FreeType by me, is a donation by Adobe in
collaboration with Google.  It is vastly superior to the old CFF
engine, and it will replace it soon.  Right now, it is still off by
default, and you have to explicitly select it using the new
`hinting-engine' property of the cff driver.

For convenience, (most of) the new files are committed separately.

* include/freetype/config/ftheader.h (FT_CFF_DRIVER_H): New macro.
* include/freetype/ftcffdrv.h: New file to access CFF driver
properties.
* include/freetype/fterrdef.h (FT_Err_Glyph_Too_Big): New error
code.
* include/freetype/internal/fttrace.h: Add `cf2blues', `cf2hints',
and `cf2interp'.

* src/cff/cffgload.h (CFF_SubFont): New member `current_subfont'.
* src/cff/cffobjs.h (CFF_DriverRec): New members `hinting_engine'
and `no_stem_darkening'.
* src/cff/cfftypes.h (CFF_FontRec): New member `cf2_instance'.

* src/cff/cff.c: Include new files.
* src/cff/cffdrivr.c (cff_property_set, cff_property_get): Handle
`hinting-engine' and `no-stem-darkening' properties (only the Adobe
engine listens to them).
* src/cff/cffgload.c: Include `cf2ft.h'.
(cff_decoder_prepare): Initialize `current_subfont'.
(cff_build_add_point): Handle Adobe engine which uses 16.16
coordinates.
(cff_slot_load): Handle FT_LOAD_NO_SCALE and FT_LOAD_NO_HINTING
separately.
Choose rendering engine based on `hinting_engine' property.
* src/cff/cffload.c (cff_font_done): Call finalizer of the Adobe
engine.
* src/cff/cffobjs.c: Include FT_CFF_DRIVER_H.
(cff_driver_init): Set default property values.

* src/cff/rules.mk (CFF_DRV_SRC, CFF_DRV_H): Add new files.

* src/cff/cf2*.*: New files, containing the Adobe engine.
2013-04-13 18:53:28 +02:00
Werner Lemberg 2dc2662125 Add output bitmap checksums.
Use `FT2_DEBUG=bitmap:3' for tracing.

* src/base/md5.c, src/base/md5.h: New files, taken from

  http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5

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

* src/base/ftobjs.c [FT_DEBUG_LEVEL_TRACE]: Include `md5.c'

(FT_Render_Glyph_Internal) [FT_DEBUG_LEVEL_TRACE]: For tracing,
convert resulting bitmap to a uniform format and compute a checksum.
Use `bitmap' category for the tracing message.

* src/base/rules.mk (BASE_H): Updated.

* docs/LICENSE.TXT: Updated.
2013-04-12 20:11:38 +02:00
Werner Lemberg eaf0afb4c7 [psaux] Fix some value overflows and improve tracing.
* src/psaux/psconv.c: Include FT_INTERNAL_DEBUG_H.
(FT_COMPONENT): Define.
(PS_Conv_Strtol): Return FT_Long.
Handle bad data and overflow.
Emit some tracing messages in case of error.
(PS_Conv_ToInt): Return FT_Long.
(PS_Conv_ToFixed): Updated.
* src/psaux/psconv.h: Updated.

* include/freetype/internal/fttrace.h: Add `psconv'.
2012-10-20 11:27:25 +02:00
Werner Lemberg 6d29c5cbe3 [autofit] Fix `make multi'.
* include/freetype/internal/fttrace.h: Add `afmodule'.
* src/autofit/afmodule.c: Include FT_INTERNAL_DEBUG_H.
(FT_COMPONENT): Define.
2012-09-14 11:57:36 +02:00
Werner Lemberg b6978dd0c9 [autofit] Do some code cleanup.
* src/autofit/afglobal.c (af_face_globals_new): Simplify.

* src/autofit/afhints.c: Use `FT_TRACE7' instead of `printf'
everywhere.
(FT_COMPONENT): New macro.
(af_glyph_hints_done): Simplify.

* include/freetype/internal/fttrace.h: Updated.
2012-07-06 19:38:44 +02:00
suzuki toshiya 084abf0469 [autofit] Add bluezones for CJK Ideographs.
To remove extremas of vertical strokes of CJK Ideographs at
low resolution and make the top and bottom horizontal stems
aligned, bluezones for CJK Ideographs are calculated from
sample glyphs.  At present, vertical bluezones (bluezones
to align vertical stems) are disabled by default.  For detail, see
http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html
http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html
http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html

* include/freetype/internal/fttrace.h: New trace component `afcjk'.
* src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version
for AF_Latin{Blue,Axis,Metric}Rec.
(af_cjk_metrics_check_digits): Ditto, shared with Indic module.
(af_cjk_metrics_init_widths): Ditto.
(af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric.
(af_cjk_metrics_scale): Ditto (declaration).
(af_cjk_hints_init): Ditto (declaration).
(af_cjk_hints_apply): Ditto (declaration).
* src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body).
(af_cjk_hints_init): Ditto (body).
(af_cjk_hints_apply): Ditto (body).
(af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths.
(af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits.
(af_cjk_metrics_init): Call CJK bluezone initializer.
(af_cjk_metrics_scale_dim): Add code to scale bluezones.
(af_cjk_hints_compute_blue_edges): New function, CJK version of
af_latin_hints_compute_blue_edges.
(af_cjk_metrics_init_blues): New function, CJK version of
af_latin_metrics_init_blues.
(af_cjk_hints_edges): Add code to align the edge stems to blue zones.

* src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric
instead of AF_LatinMetric, and initialize as af_cjk_metrics_init.
However bluezones are not initialized.
(af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric.
(af_indic_hints_init): Ditto.
(af_indic_hints_apply): Ditto.

* docs/CHANGES: Note about CJK bluezone support.
2011-05-08 19:22:32 +09:00
Werner Lemberg d503b1bce2 Integrate autofitter debugging stuff.
* devel/ftoption.h, include/freetype/config/ftoption.h
(FT_DEBUG_AUTOFIT): New macro.

* include/freetype/internal/fttrace.h: Add trace components for
autofitter.

* src/autofit/aftypes.h (AF_LOG): Removed.
(_af_debug): Removed.

* src/autofit/*: s/AF_DEBUG/FT_DEBUG_AUTOFIT/.
s/AF_LOG/FT_TRACE5/.
Define FT_COMPONENT where necessary.
2011-04-18 19:05:28 +02:00
suzuki toshiya 61adbe980a sfnt: Ignore invalid GIDs in glyph name lookup. 2009-08-01 00:32:24 +09:00
suzuki toshiya e866cf3f55 Improve bitmap size or pixel variables for 16-bit systems. 2009-08-01 00:32:06 +09:00
suzuki toshiya e05861b9da Register 2 missing trace components, t1afm and ttbdf. 2009-07-09 14:43:57 +09:00
suzuki toshiya a6990d0612 Register a trace component for ftgloadr.c. 2009-07-09 12:48:23 +09:00
Werner Lemberg d76fe5a1af * src/otvalid/otvbase.c, src/otvalid/otvcommn.c,
src/otvalid/otvgdef.c, src/otvalid/otvgpos.c, src/otvalid/otvgsub.c,
src/otvalid/otvjstf.c: s/FT_INVALID_DATA/FT_INVALID_FORMAT/ where
appropriate.  Reported by George.

* include/freetype/internal/fttrace.h: Define `trace_otvmath'.

* src/otvalid/rules.mk (OTV_DRV_SRC): Add otvmath.c.

* docs/CHANGES: Updated.


Add `MATH' validating support to otvalid module.

* include/freetype/tttags.h (TTAG_MATH): New macro.
* include/freetype/ftotval.h (FT_VALIDATE_MATH): New macro.
(FT_VALIDATE_OT): Updated.

* src/otvalid/otmath.c: New file.

* src/otvalid/otvalid.c: Include otvmath.c.
* src/otvalid/otvmod.c (otv_validate): Handle `MATH' table.
2007-08-08 06:38:06 +00:00
Werner Lemberg 5225402a52 * include/freetype/ftoutln.h (FT_Outline_Embolden): Mention in
documentation that negative strength values are possible.
Give an example call.

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

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

* src/autofit/afcjk.c: Include aftypes.h and aflatin.h.
2006-02-15 06:05:52 +00:00
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
Suzuki, Toshiya (鈴木俊哉) a438621451 Add gxvalid module to validate TrueType GX/AAT tables.
Modifications on existing files:

	* Jamfile: Register gxvalid module.
	* src/base/Jamfile: Register ftgxval.c.
	* src/base/rule.mk: Register ftgxval.c.
	* docs/INSTALL.ANY: Register gxvalid/gxvalid.c.

	* include/freetype/config/ftheader.h: Add macro to include gxvalid
	header file, FT_GX_VALIDATE_H.
	* include/freetype/config/ftmodule.h: Register gxv_module_class.

	* include/freetype/ftchapters.h: Add comment about gx_validation.
	* include/freetype/ftotval.h: Change keyword FT_VALIDATE_XXX
	to FT_VALIDATE_OTXXX to co-exist gxvalid.
	* include/freetype/tttags.h: Add tag for TrueType GX/AAT tables.

	* include/freetype/internal/ftserv.h: Add macro to use gxvalid
	service, FT_SERVICE_GX_VALIDATE_H
	* include/freetype/internal/fttrace.h: Add trace facilities
	for gxvalid.

	New files on existing directories:

	* include/freetype/internal/services/svgxval.h: Registration of
	validation service for TrueType GX/AAT and classic kern table.
	* include/freetype/ftgxval.h: Public API definition to use gxvalid.
	* src/base/ftgxval.c: Public API of gxvalid.

	New files under src/gxvalid/:

	* src/gxvalid/Jamfile src/gxvalid/README src/gxvalid/module.mk
	src/gxvalid/rules.mk src/gxvalid/gxvalid.c src/gxvalid/gxvalid.h
	src/gxvalid/gxvbsln.c src/gxvalid/gxvcommn.c src/gxvalid/gxvcommn.h
	src/gxvalid/gxverror.h src/gxvalid/gxvfeat.c src/gxvalid/gxvfgen.c
	src/gxvalid/gxvjust.c src/gxvalid/gxvkern.c src/gxvalid/gxvlcar.c
	src/gxvalid/gxvmod.c src/gxvalid/gxvmod.h src/gxvalid/gxvmort.c
	src/gxvalid/gxvmort.h src/gxvalid/gxvmort0.c src/gxvalid/gxvmort1.c
	src/gxvalid/gxvmort2.c src/gxvalid/gxvmort4.c src/gxvalid/gxvmort5.c
	src/gxvalid/gxvmorx.c src/gxvalid/gxvmorx.h src/gxvalid/gxvmorx0.c
	src/gxvalid/gxvmorx1.c src/gxvalid/gxvmorx2.c src/gxvalid/gxvmorx4.c
	src/gxvalid/gxvmorx5.c src/gxvalid/gxvopbd.c src/gxvalid/gxvprop.c
	src/gxvalid/gxvtrak.c: New files, gxvalid body.
2005-08-24 04:31:31 +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
Werner Lemberg ee95b6f0d4 Adding OpenType validation module. The code is based on the
(unfinished) `otlayout' module but has been heavily modified to make
it much more compact.

* src/otvalid/*: New module.

* include/freetype/ftotval.h, src/base/ftotval.c,
include/freetype/internal/services/svotval.h: New files.

* include/freetype/config/ftmodule.h: Add otv_module_class.
* include/freetype/config/ftheader.h (FT_OPENTYPE_VALIDATE_H): New
macro.
* include/freetype/internal/ftserv.h
(FT_SERVICE_OPENTYPE_VALIDATE_H): New macro.
* include/freetype/internal/fttrace.h (otvmodule, otvcommon,
otvbase, otvgdef, otvgpos, otvgsub, otvjstf): New trace components.

* include/freetype/ftchapters.h: Updated.

* src/base/Jamfile (Library), src/base/descrip.mms (OBJS),
src/base/rules.mk (BASE_EXT_SRC): Updated.

* docs/CHANGES: Updated.
2004-09-10 14:39:00 +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 754353343e Provide generic access to MacOS resource forks.
* src/base/ftrfork.c, include/freetype/internal/ftrfork.h: New
files.

* src/base/ftobjs.c: Include FT_INTERNAL_RFORK_H.
(Mac_Read_POST_Resource, Mac_Read_sfnt_Resource): Remove arguments
`resource_listoffset' and `resource_data' and adapt code
accordingly.  These values are calculated outside of the function
now.
Add new argument `offsets'.
(IsMacResource): Use `FT_Raccess_Get_HeaderInfo' and
`FT_Raccess_Get_DataOffsets'.
(load_face_in_embedded_rfork): New function.
(load_mac_face): Use load_face_in_embedded_rfork.
(ft_input_stream_new): Renamed to...
(FT_Stream_New): This.  Use FT_BASE_DEF.  Updated all callers.
(ft_input_stream_free): Renamed to...
(FT_Stream_Free): This.  Use FT_BASE_DEF.  Updated all callers.

* src/base/ftbase.c: Include ftrfork.c.

* src/base/rules.mk (BASE_SRC), src/base/Jamfile: Updated.

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

* include/freetype/internal/fttrace.h: Added `rfork' as a new
trace definition.

* include/freetype/internal/ftstream.h: Declare FT_Stream_New and
FT_Stream_Free.

* include/freetype/config/ftoption.h, devel/ftoption.h
(FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK): New option.

* include/freetype/config/ftstdlib.h (ft_strrchr): New macro.
2004-02-25 12:58:54 +00:00
Werner Lemberg 7cf4d377f4 * src/type42/t42drivr.c: s/T42_ENCODING_TYPE_/T1_ENCODING_TYPE_/.
(parse_font_matrix): Remove unnecessary code.
(parse_sfnts): Initialize some variables.
(t42_driver_class) [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Use
ft_module_driver_has_hinter conditionally.
Moved some type 42 specific structure definitions to...
* include/freetype/internal/t42types.h: New file.
* include/freetype/internal/internal.h (FT_INTERNAL_T42_TYPES_H):
New macro.

* include/freetype/cache/ftcsbits.h (FTC_SBit): Added a new field
`num_grays' for specifying the number of used gray levels.
* src/cache/ftcsbits.c (ftc_sbit_node_load): Initialize it.

Adding a driver for BDF fonts written by Francesco Zappa Nardelli
<Francesco.Zappa.Nardelli@ens.fr>.  Heavily modified by me to
better adapt it to FreeType, removing unneeded stuff.  Additionally,
it now supports Mark Leisher's BDF extension for anti-aliased
bitmap glyphs with 2 and 4 bpp.

* src/bdf/*: New driver.
* include/freetype/internal/bdftypes.h: New file.
* include/freetype/internal/fttrace.h: Added BDF driver components.
* include/freetype/fterrdef.h: Added error codes for BDF driver.
* include/freetype/config/ftmodule.h, src/Jamfile: Updated.
* include/freetype/internal/internal.h (FT_INTERNAL_BDF_TYPES_H):
New macro.

* include/freetype/config/ftstdlib.h (ft_sprintf): New alias for
sprintf.

* include/freetype/internal/fttrace.h: Added Type 42 driver
component.
* src/type42/t42drivr.c: Use it.

* include/freetype/internal/internal.h (FT_INTERNAL_PCF_TYPES_H):
New macro.
2002-05-21 14:13:01 +00:00
David Turner 993a8d0445 adding BDF driver 2002-05-18 12:03:43 +00:00
David Turner 609e28c3be * src/type1/t1gload.h, src/type1/t1gload.c: fixed incorrect
parameter sign-ness in callback function

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

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


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

        * include/freetype/internal/ftstream.h: adding the FT_NEXT_OFF3,
          FT_NEXT_UOFF3, FT_NEXT_OFF3_LE and FT_NEXT_UOFF3_LE to parse
          in-memory 24-bit integers.
2002-04-19 15:13:47 +00:00