Commit Graph

1740 Commits

Author SHA1 Message Date
Moazin Khatti 503977f55c Adds transformation support for OT-SVG glyphs.
* include/freetype/ftglyph.h: Adds `transform' and `delta' fields
to `FT_SvgGlyphRed'.

* include/freetype/otsvg.h: Adds `transform' and `delta' fields to
`FT_SVG_Document'.

* src/base/ftglyph.c: Creates method `ft_svg_glyph_transform' and
modifies existing functions for the new fields.

* src/sfnt/ttsvg.c: (tt_face_load_svg_doc) Set `transform' to unity
and `delta' to zero by default.

* src/svg/ftsvg.c: Adds `ft_svg_transform'.
2019-08-17 23:42:27 +05:00
Moazin Khatti 9df8c7dd27 Adds OT-SVG glyph support to FT Glyph Management API.
* include/freetype/ftglyph.h: Adds `FT_SvgGlyph' and
`FT_SvgGlyphRec'.

* src/base/ftglyph.c: Adds glyph class `ft_svg_glyph_class' and its
methods. (FT_New_Glyph) Adds code to set the class of OT-SVG
glyphs. (FT_Glyph_To_Bitmap) Adds code to free memory allocated for
`FT_SVG_Document' in `dummy.other'.
2019-08-17 22:47:37 +05:00
Moazin Khatti 865bba38d2 [svg] Creates new module for rendering OT-SVG glyphs.
For rendering OT-SVG glyphs, a new renderer module `ot-svg' is
created. The module holds hooks to an external library which are
used for rendering. The hooks can be set via module properties.
Also enabled bitmap presetting of OT-SVG glyphs at loading stage.

* include/freetype/fterrdef.h: Adds two errors, namely,
`Missing_SVG_Hooks' and `Invalid_SVG_Document'.

* include/freetype/internal/ftobjs.h: Adds `svg_renderer_state' to
`FT_LibraryRec' to let external libraries store state.

* include/freetype/internal/fttrace.h: Adds entry for `ot-svg'.

* modules.cfg: Ditto.

* include/freetype/internal/internal.h: Adds
`FT_INTERNAL_SVG_INTERFACE_H' for `svginterface.h'.

* include/freetype/internal/svginterface.h: Internal header file
to contain the interface of `ot-svg' module. Just exposes the
preset function.

* include/freetype/otsvg.h: Adds functypes for the four hooks and
a structure to hold them.

* src/base/ftobjs.c: (ft_glyphslot_preset_bitmap) Enable proper
presetting of OT-SVG glyphs by using `ot-svg' renderer.
(ft_add_renderer) Set `renderer->render' for `ot-svg' module.

* src/svg/ftsvg.h: Declaration for `ot-svg' module.

* src/svg/ftsvg.c: Module definition of `ot-svg' and its functions.

* src/svg/svg.c: Single source file of `ot-svg' module.

* src/svg/svgtypes.c: Defines `SVG_Renderer'.

* src/svg/rules.mk: Compilation rules for `ot-svg' module.

* src/svg/module.mk: Module definition of `ot-svg'.
2019-08-10 19:11:37 +05:00
Moazin Khatti ce64d9cbf1 Adds the functionality to load SVG documents.
SVG document corresponding to a glyphID is fetched and stored
in an `FT_SVG_Document' structure which is referenced in the
glyphslot.

* include/freetype/config/ftheader.h: Adds `FT_OTSVG_H'.

* include/freetype/ftimage.h: Adds `FT_GLYPH_FORMAT_SVG'.

* include/freetype/internal/ftobjs.h: Adds `FT_GLYPH_OWN_GZIP_SVG'.

* include/freetype/internal/sfnt.h: Adds `load_svg_doc' and its
function type `TT_Load_Svg_Doc_Func'.

* include/freetype/otsvg.h: Adds `FT_SVG_Document' and its struct.

* src/base/ftobjs.c: Adds code to allocate and free memory for
`FT_SVG_Document' in `slot->other'.

* src/cff/cffgload.c: Adds code to load SVG glyph if it's present.

* src/truetype/ttgload.c: Ditto.

* src/sfnt/sfdriver.c: Adds `tt_face_load_svg_doc'.

* src/sfnt/ttsvg.h: Ditto.

* src/sfnt/ttsvg.c: Adds implementation of `tt_face_load_svg_doc'
and its helper functions.
2019-08-10 16:11:07 +05:00
Moazin Khatti 92eeba75c4 [sfnt] Adds the functionality to load `SVG' table.
Adds code to load the SVG table data into an `svg'
structure and set the flag `FT_FACE_FLAG_SVG'.

* include/freetype/freetype.h: Adds `FT_FACE_FLAG_SVG'.

* include/freetype/internal/sfnt.h: Adds the fields
`load_svg' and `free_svg' to `SFNT_Interface'.

* include/freetype/internal/tttypes.h: Adds a void
pointer field `svg' to hold info from `SVG' table.

* include/freetype/internal/tttags.h: Adds the tag
`TTAG_SVG'.

* src/sfnt/ttsvg.c: Writes the functions
`tt_face_load_svg' and `tt_face_free_svg'

* src/sfnt/ttsvg.h: Writes header declarations for
`tt_face_load_svg' and `tt_face_free_svg'.

* src/sfnt/sfdriver.c: Adds the functions
`tt_face_load_svg' and `tt_face_free_svg' to
`sfnt_interface'.

* src/sfnt/sfnt.c: Includes `ttsvg.c'.

* src/sfnt/sfobjs.c: (sfnt_load_face) Adds code to
load `svg' table struct. (sfnt_done_face) Adds code
to free `svg' table struct.
2019-08-05 22:48:16 +05:00
Moazin Khatti 91e6a7b65f Adds `FT_CONFIG_OPTION_SVG' to allow toggling of OT-SVG support. 2019-08-05 16:12:17 +05:00
Werner Lemberg 8cf046c38d * Version 2.10.1 released.
==========================

Tag sources with `VER-2-10-1'.

* docs/VERSION.TXT: Add entry for version 2.10.1.

* README, Jamfile (RefDoc), src/base/ftver.rc,
builds/windows/vc2010/freetype.vcxproj,
builds/windows/vc2010/index.html,
builds/windows/visualc/freetype.dsp,
builds/windows/visualc/freetype.vcproj,
builds/windows/visualc/index.html,
builds/windows/visualce/freetype.dsp,
builds/windows/visualce/freetype.vcproj,
builds/windows/visualce/index.html,
builds/wince/vc2005-ce/freetype.vcproj,
builds/wince/vc2005-ce/index.html,
builds/wince/vc2008-ce/freetype.vcproj,
builds/wince/vc2008-ce/index.html: s/2.10.0/2.10.1/, s/2100/2101/.

* include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.

* builds/unix/configure.raw (version_info): Set to 23:1:17.
* CMakeLists.txt (VERSION_PATCH): Set to 1.

* include/freetype/fterrors.h (FT_Error_String): Fix C++ compilation.
2019-07-01 15:56:34 +02:00
Alexei Podtelezhnikov 81445c034a Doc polishing. 2019-06-22 22:54:57 -04:00
Alexei Podtelezhnikov a41e560b21 Minor. 2019-06-19 22:29:55 -04:00
Werner Lemberg 8acd9800ed Add memory access macro summary. 2019-06-13 11:12:26 +02:00
Alexei Podtelezhnikov 59e0c6f92e * include/freetype/ftmodapi.h (FT_DebugHook_Func): Return error.
Fix a warning by adding a return value as in `TT_RunIns',
which should not be a compatibility issue.
2019-06-12 22:30:21 -04:00
Alexei Podtelezhnikov 78c02bc110 [type1,type42] Use `const' for string literals.
* include/freetype/internal/psaux.h (PS_Table_FuncsRec): Updated.
* include/freetype/internal/t1types.h (T1_EncodingRec): Updated.
* src/psaux/psobjs.[ch] (ps_table_add): Updated.
* src/type1/t1load.c (T1_Open_Face, parse_encoding): Updated.
* src/type42/t42objs.c (T42_Open_Face): Updated.
* src/type42/t42parse.c (t42_parse_encoding): Updated.

* src/cff/cffobjs.c (cff_face_init): Minor.
2019-06-10 23:09:49 -04:00
Alexei Podtelezhnikov e13c1f46dc Solidify VC2005 builds.
* include/freetype/internal/ftcalc.h (FT_MSB) [_MSC_VER]: Explicitly
declare `_BitScanReverse' intrinsic.
* builds/windows/visualc/freetype.vcproj [Debug]: Disable intrinsics.
2019-05-31 22:31:47 -04: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 37580053b4 [truetype] Use 26.6 format for storing unscaled CVT values.
If `CVAR' data is applied to variation fonts, fractional values are
possible.

* include/freetype/internal/tttypes.h (TT_FaceRec): Change type of
`cvt' from `FT_Short' to `FT_Int32'.

* src/truetype/ttgxvar.c (FT_fdot6ToFixed): New macro.
(tt_face_vary_cvt): Use it to update code to 26.6 format.

* src/truetype/ttobjs.c (tt_size_run_prep): Update code to 26.6
format.

* src/truetype/ttpload.c (tt_face_load_cvt): Stora data in 26.6
format.
2019-05-16 12:15:54 +02:00
Werner Lemberg 1178227b39 [truetype] Increase precision of font variation (#54371).
This patch make FreeType use font units in 26.6 format internally
instead of integers.

* src/truetype/ttgxvar.c (FT_fixedToFdot6): New macro.
(TT_Vary_Apply_Glyph_Deltas): Add argument to output unrounded font
coordinates.
* src/truetype/ttgxvar.h: Updated.

* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Use
`extra_points2' array to temporarily hold unrounded point
coordinates; use them to compute scaled coordinates and linear
advance width and height.
(load_truetype_code): Adjust similarly.
2019-05-11 10:01:57 +02:00
Alexei Podtelezhnikov 65f9516bc7 Tweak LCD filtering.
* src/base/ftlcdfil.c (ft_lcd_filter_fir, _ft_lcd_filter_legacy):
Choose direction from bitmap's pixel_mode.
* include/freetype/internal/ftobjs.c (FT_Bitmap_LcdFilterFunc):
Updated.
* src/smooth/ftsmooth.c (ft_smooth_render_generic): Updated.
2019-05-02 23:06:55 -04:00
Alexei Podtelezhnikov 432bb50ff5 Clarify docs. 2019-04-23 21:51:42 -04:00
Werner Lemberg 01aed76c68 Minor. 2019-04-14 09:39:28 +02:00
Antony Lee 3ad1c93ac1 Make `glyph_name' parameter to `FT_Get_Name_Index' a `const'.
* include/freetype/freetype.h (FT_Get_Name_Index),
include/freetype/internal/ftobjs.h (FT_Face_GetGlyphNameIndexFunc),
include/freetype/internal/services/svgldict.h
(FT_GlyphDict_NameIndexFunc), src/base/ftobjs.c (FT_Get_Name_Index),
src/cff/cffdrivr.c (cff_get_name_index), src/sfnt/sfdriver.c
(sfnt_get_name_index), src/type1/t1driver.c (t1_get_name_index),
src/type42/t42drivr.c (t42_get_name_index): Add `const' to second
argument.
2019-04-06 06:38:16 +02:00
Werner Lemberg fdb10e8b50 Improve link. 2019-03-21 13:53:43 +01:00
Werner Lemberg fbbcf50367 * Version 2.10.0 released.
==========================

Tag sources with `VER-2-10-0'.

* docs/VERSION.TXT: Add entry for version 2.10.0.
* docs/CHANGES: Updated.

* README, Jamfile (RefDoc), src/base/ftver.rc,
builds/windows/vc2010/freetype.vcxproj,
builds/windows/vc2010/index.html,
builds/windows/visualc/freetype.dsp,
builds/windows/visualc/freetype.vcproj,
builds/windows/visualc/index.html,
builds/windows/visualce/freetype.dsp,
builds/windows/visualce/freetype.vcproj,
builds/windows/visualce/index.html,
builds/wince/vc2005-ce/freetype.vcproj,
builds/wince/vc2005-ce/index.html,
builds/wince/vc2008-ce/freetype.vcproj,
builds/wince/vc2008-ce/index.html: s/2.9.1/2.10.0/, s/291/2100/.

* include/freetype/freetype.h (FREETYPE_MINOR): Set to 10.
(FREETYPE_PATCH): Set to 0.

* builds/unix/configure.raw (version_info): Set to 23:0:17.
* CMakeLists.txt (VERSION_MINOR): Set to 10.
(VERSION_PATCH): Set to 0.

* builds/toplevel.mk (version, winversion): Since the minor version
number has two digits now, never omit the patch number.  We would
get ambiguous zip file names otherwise.
(dist): Remove remnants of `docmaker' tool.
(do-dist): Remove unused intermediate files.

* src/cff/cffparse.c (destrict_c2s_item): Guard function with
CFF_CONFIG_OPTION_OLD_ENGINE macro.
2019-03-15 07:56:49 +01:00
Andrei Alexeyev 2f4b740ce4 Fix invalid function pointer casts.
This change should allow Freetype to work on WASM/Emscripten without
needing `-s EMULATE_FUNCTION_POINTER_CASTS=1'.

* src/autofit/afdummy.c (af_dummy_hints_apply): Fix signature.

* src/cid/cidload.c (cid_parse_font_matrix, parse_fd_array,
parse_expansion_factor, parse_font_name): Return `void', not
`FT_Error'.

* include/freetype/internal/ftobjs.h (FT_CMap_CharVarIsDefaultFunc):
Fix signature.
2019-03-07 09:43:05 +01:00
Nikhil Ramakrishnan 6d65c60fca Minor formatting. 2019-03-02 16:05:51 +05:30
Werner Lemberg bf04c59249 Minor doc fixes. 2019-02-25 06:32:26 +01:00
Werner Lemberg 4d51f78de9 More documentation updates.
In particular, mark the new behaviour of `FT_LOAD_COLOR' as experimental.
2019-02-23 11:21:48 +01:00
Werner Lemberg 6ab36880ce * src/base/ftbitmap.c (FT_Bitmap_Blend): No fractional offsets.
The function only provided a framework without an actual
implementation, which this commits removes.
2019-02-23 11:18:39 +01:00
Werner Lemberg 7585997024 Update all copyright notices. 2019-02-23 10:07:09 +01:00
Werner Lemberg a346abc093 s/`....`/'....'/ for SFNT table tags in documentation. 2019-02-21 09:19:47 +01:00
Werner Lemberg 8de11f3def s/NULL/`NULL`/ in documentation. 2019-02-20 16:19:19 +01:00
Werner Lemberg f92fa39341 Minor documentation fixes. 2019-02-20 16:04:48 +01:00
Werner Lemberg f686ad46a3 Update copyright years. 2019-01-22 20:31:44 +01:00
Nikhil Ramakrishnan 2875ada197 Minor documentation fix. 2018-12-30 20:02:08 +05:30
Werner Lemberg afa043de9c Fix links (mostly http -> https). 2018-12-25 22:44:05 +01:00
Werner Lemberg e8bbef85c0 Fix documentation of TrueType bytecode interpreter debug hook. 2018-12-12 14:05:47 +01:00
Werner Lemberg 0c83ba6d61 Minor documentation updates and fixes. 2018-12-10 12:14:13 +01:00
Alexei Podtelezhnikov d01e28f41f Important doc fix. 2018-12-06 08:12:27 -05:00
Nikhil Ramakrishnan c1e58b4d93 * include/freetype/ftmm.h: Minor. 2018-11-29 12:57:35 +05:30
Chris Liddell 78a1e69517 [type1,cff] Add FT_{Set,Get}_MM_WeightVector API calls.
For multiple master fonts, common usage (in Postscript) is to modify
the WeightVector of an existing font instance, this addition
supports that use.

* include/freetype/ftmm.h, src/base/ftmm.c (FT_Set_MM_WeightVector,
FT_Get_MM_WeightVector): New API functions.

* include/freetype/internalservices/svmm.h
(FT_Set_MM_WeightVector_Func, FT_Get_MM_WeightVector_Func): New
function types.
(MultiMasters): Add `set_mm_weightvector' and `get_mm_weightvector'
members.
(FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated.

* src/cffcffdrivr.c (cff_set_mm_weightvector,
cff_get_mm_weightvector): New functions.
(cff_service_multi_masters): Register them.

* src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated.
This driver doesn't use the new interface.

* src/type1/t1load.c (T1_Set_MM_WeightVector,
T1_Get_MM_WeightVector): New functions.
* src/type1/t1driver.c (t1_service_multi_masters): Register them.
* src/type1/t1load.h: Updated.
2018-11-27 22:24:06 +01:00
Alexei Podtelezhnikov 8d517e679b Clarification. 2018-11-10 15:47:48 -05:00
Alexei Podtelezhnikov acb19ed4e9 Comment on timestamp storage. 2018-10-28 14:19:33 -04:00
Alexei Podtelezhnikov 3e8ec291ff [sfnt] Make `head' timestamps unsigned.
It's been more than 2^31 seconds since 1904.

* include/freetype/tttables.h (TT_Header): Change field types.
* src/sfnt/ttload.c (tt_face_load_generic_header): Updated.
2018-10-26 23:23:48 -04:00
Alexei Podtelezhnikov d71f2bc159 Revert "Align FreeType with standard C memory management."
This reverts commit 877aa1b2cc.
2018-10-26 22:52:25 -04:00
Werner Lemberg 428854931e Minor. 2018-10-10 12:21:10 +02:00
Alexei Podtelezhnikov 877aa1b2cc Align FreeType with standard C memory management.
* include/freetype/ftsystem.h: Include FT_TYPES_H.
(*FT_Alloc_Func, *FT_Realloc_Func): Use size_t for the size arguments.
* src/raster/ftmisc.h: Ditto.

* builds/amiga/src/base/ftsystem.c, builds/unix/ftsystem.c,
* builds/vms/ftsystem.c, src/base/ftsystem.c (ft_alloc, ft_realloc):
Use size_t for the size arguments.

* src/base/ftdbgmem.c (ft_mem_debug_alloc, ft_mem_debug_realloc): Use
FT_Offset, aka size_t, for the size arguments.
2018-09-27 21:17:36 -04:00
Werner Lemberg a9af691481 Fix handing of `FT_Bool'.
Before this commit we had code like

  (FT_Bool)( globals->glyph_styles[gindex] & 0x8000)

Since `FT_Bool' is defined to be an `unsigned char', the code
evaluated to something like

  (unsigned char)( 0x8532 & 0x8000)

which in turn expanded to

  (unsigned char)( 0x8000)

and finally yielded 0x00 – i.e., false – not as expected.

Problem reported and analyzed by Tony Smith <tony.smith@macro4.com>.

* include/freetype/fttypes.h (FT_BOOL): Add a comparison against
zero so that we always have a Boolean expression.

*/*: Replace castings to `FT_Bool' with calls to `FT_BOOL' where
possible.
2018-09-25 09:10:09 +02:00
Werner Lemberg abd997aa7c Improve documentation of `FT_LOAD_NO_RECURSE'. 2018-09-21 12:50:32 +02:00
Werner Lemberg 8e95068053 [base] Remove unused function `FT_GlyphLoader_CopyPoints'.
* include/freetype/internal/ftgloadr.h, src/base/ftgloadr.c
(FT_GlyphLoader_CopyPoints): Do it.
2018-09-20 06:26:34 +02:00
Werner Lemberg b8dd404d13 freetype.h: Add warning w.r.t. B/W hinting and rendering (#54589). 2018-09-16 07:22:23 +02:00
Werner Lemberg 97c7944f9e Synchronize `ftconfig' files. 2018-09-05 11:45:05 +02:00