Commit Graph

1783 Commits

Author SHA1 Message Date
Moazin Khatti f943af6490 Document `svg_hooks` property. 2019-08-26 01:17:15 +05:00
Moazin Khatti eb9a614011 Improve ot-svg callback hooks documentation 2019-08-26 01:17:15 +05:00
Moazin Khatti b84ae3420a Minor doc and styling improvements. 2019-08-26 01:17:15 +05:00
Moazin Khatti cb2e775408 Adds `ttsvg' for tracing in ttsvg.c 2019-08-26 01:17:15 +05:00
Moazin Khatti 3f6f939378 Adds transform support for OT-SVG glyphs. 2019-08-26 01:17:14 +05:00
Moazin Khatti cff4467f25 Minor doc improvement. 2019-08-26 01:17:14 +05:00
Moazin Khatti 22d7c8578f Minor name change.
`svgrender.h' -> `otsvg.h'
`FT_SVG_RENDER_H' -> `FT_OTSVG_H'
Since `svgrender.h' contains just the hooks and the SVG document
structure it's probably just better to name it something general
like `otsvg.h'.
2019-08-26 01:17:14 +05:00
Moazin Khatti b122db0953 Fix TODOs. 2019-08-26 01:17:14 +05:00
Moazin Khatti a227395912 Remove the dependence on outlines. No longer needed. 2019-08-26 01:17:14 +05:00
Moazin Khatti dbcc809e7c relying on cairo recording surface for extents and preset bitmap at load time, work in progress 2019-08-26 01:17:14 +05:00
Moazin Khatti d7f6f8b16d Tracing implemented for OT-SVG code. 2019-08-26 01:17:14 +05:00
Moazin Khatti 3479e03cdb Added a new error `Invalid_SVG_Document'. 2019-08-26 01:17:14 +05:00
Moazin Khatti f86fe242d4 Improve `--with-svg' in the build system.
Added a `no-default' option that compiles SVG support
but keeps no default rendering port. Thus, the client
application must inject its own hooks.

* builds/unix/configure.raw: Changes in the build
system to support `no-default'.

* builds/unix/unix-cc.in: Add `COMPILE_SVG_PORT' var
to ultimately let the `rules.mk' in `svg' folder know
whether to build the port files or not.

* include/freetype/config/ftoption.h: Change the flag
`FT_CONFIG_OPTION_SVG_DEFAULT' to `*_DEFAULT_SVG' as
`sed' and `ftoption_set' has a problem with the older
version.

* src/svg/ftsvg.c: Ditto.

* src/svg/rules.mk: Compile the port only if
`COMPILE_SVG_PORT' is set.
2019-08-26 01:17:14 +05:00
Moazin Khatti 4025f1213e Add a `hooks_set' flag.
A flag is to be used to indicate whether hooks
have been set or not. In case the hooks haven't
been set, a `Missing_SVG_Hooks' error will be
thrown.
2019-08-26 01:17:14 +05:00
Moazin Khatti 246ac684e4 Plug in a default library. `librsvg' for now. 2019-08-26 01:17:14 +05:00
Moazin Khatti d86de4e9d4 Instead of individual properties. Just use one that
takes pointer to the hooks structure.
2019-08-26 01:17:14 +05:00
Moazin Khatti 1541091e76 Use `FT_Property_Set' to set the hooks. One less API function. 2019-08-26 01:17:14 +05:00
Moazin Khatti b6f2303338 Public interface should remain same whether
`FT_CONFIG_OPTION_SVG' is set or not.
2019-08-26 01:17:14 +05:00
Moazin Khatti 3b62e9dc9d Added `FT_CONFIG_OPTION_SVG'. 2019-08-26 01:17:07 +05:00
Moazin Khatti c25304fa34 Documentation formatting improvement. 2019-08-17 20:36:05 +05:00
Moazin Khatti c6a6859ad9 Better naming used. 2019-08-17 20:36:05 +05:00
Moazin Khatti fbdd9f9ba3 Memory allocation for `state' of renderer should be performed
on the SVG port side not the FT size. Minor doc fixes.
2019-08-17 20:36:05 +05:00
Moazin Khatti 1f74524929 Let FT handle the memory management for rendering port's state
and the image buffer.

State has been moved inside the library structure. A new hook
function has been added to query the size needed for the state
structure and this allocation is performed by FT. Memory alloc.
for the image buffer is also being done by FT so that it can later
free it easily.

* include/freetype/svgrenderer.h: Small doc fixes. Addition of two
new hooks. `SVG_Lib_Get_State_Size' and `SVG_Lib_Get_Buffer_Size'.

* src/base/ftglyph.c (FT_Glyph_To_Bitmap): Small bug fix. Memory
was being initialized before library.

* src/base/ftobjs.c (FT_Set_Svg_Hooks): Adjust the code for new
hook functions.

* src/svg/ftsvg.c: Adjust the code for new hook functions. Perform
all memory allocations needed by the rendering port from FreeType
side.

* src/svg/svgtypes.c: Add the new hooks in the hook structure.
2019-08-17 20:36:05 +05:00
Moazin Khatti de44a3fda8 Store the rendering port's state in library.
Before this commit, the state of a rendering port was being
held globally. Now, it'll be stored in library->svg_renderer_state.
2019-08-17 20:36:05 +05:00
Moazin Khatti e028be97b8 Minor fixes. 2019-08-17 20:36:05 +05:00
Moazin Khatti d8202166c0 Add `start_glyph_id' and `end_glyph_id'.
These two fields are added to `FT_SvgGlyphRec' and
`FT_SVG_DocumentRec'. This is to allow the rendering port to create
a caching mechanism.
2019-08-17 20:36:05 +05:00
Moazin Khatti e48cf716f8 Add a `units_per_EM' field.
A field `units_per_EM' is added to `FT_SVG_DocumentRec' and
`FT_SvgGlyphRec'. This is needed because the renderer needs this
info to properly scale the SVGs if the viewbox width and height
differ from `face->units_per_EM'. Face object can't be accessed
because of the restrictions put by `FT_Glyph_To_Bitmap' thus this
has to be provided separately just like `metrics'.
2019-08-17 20:36:05 +05:00
Moazin Khatti 7275d6562f Do proper memory freeing to prevent leaks.
* include/freetype/internal/ftobjs.h: Create a new flag named
`FT_GLYPH_OWN_GZIP_SVG' to indicate that `svg_document' in
`slot->other' is GZIP compressed and has to be freed later.

* src/base/ftglyph.c: Minor styling.

* src/base/ftobjs.c: Add code to free memory that was previously
allocated for storing GZIP compressed SVG documents.

* src/sfnt/ttsvg.c: Set the `FT_GLYPH_OWN_GZIP_SVG' flag if the
document is GZIP compressed.
2019-08-17 20:36:05 +05:00
Moazin Khatti 22988063b0 Minor. Add documentation. 2019-08-17 20:36:05 +05:00
Moazin Khatti 6a39dd0b16 Properly free memory of SVG document referenced in `slot->other'.
* include/freetype/freetype.h: Add `FT_FACE_FLAG_SVG' to indicate
the presence of an SVG table in the face.

* src/base/ftobjs.c (ft_glyphslot_init): Allocate memory for
`FT_SVG_Document' in `slot->other' if an SVG table exists in the
face.
(ft_glyphslot_clear): Clear `slot->other' only if the font doesn't
have an SVG table.
(ft_glyphslot_done): Free the memory at `slot->other' if the face
has an SVG table.

* src/base/ttsvg.c (tt_face_load_svg): Set `FT_FACE_FLAG_SVG'.
(tt_face_load_svg_doc): Don't allocate the memory.
2019-08-17 20:36:05 +05:00
Moazin Khatti 1e6cfffcb2 Enable FreeType memory debugger. 2019-08-17 20:36:05 +05:00
Moazin Khatti 6bf9ade45c Adds support for SVG glyphs to Glyph Management API. 2019-08-17 20:36:05 +05:00
Moazin Khatti 61b1f0b73c Make sure `FT_Set_Svg_Hooks' is exported properly. 2019-08-17 20:36:05 +05:00
Moazin Khatti 294a7ebee2 Adds size information to `FT_SVG_DocumentRec'.
This is necessary because the document itself contains no
sizing information. Outline glyphs encapsulate the sizing
information in the outlines by scaling them. That is not
possible here. One could access them from the face object
reference inside a glyph slot, but when the function
`FT_Glyph_To_Bitmap' creates a dummy slot it can not put
a face object reference in it. Thus, it's better to store
the size information here.
2019-08-17 20:36:05 +05:00
Moazin Khatti 0bf6444911 [ot-svg] Create an SVG Document structure for use in `other' field
of `FT_GlyphSlot'.
2019-08-17 20:36:05 +05:00
Moazin Khatti 877736d057 Removes trailing white spaces. 2019-08-17 20:36:05 +05:00
Moazin Khatti f8eae8a824 Reverts the changes made in the structure of `TT_GlyphSlot' 2019-08-17 20:36:05 +05:00
Moazin Khatti 479c76c867 [ot-svg] Silly mistake fix.
Instead of an `FT_Library' instance, `FT_Module' is supposed
to be passed.
2019-08-17 20:36:05 +05:00
Moazin Khatti 9a55001454 Minor. Better documentation. Adds TODOs for letter. 2019-08-17 20:36:05 +05:00
Moazin Khatti 4d59b8535e [ot-svg] Creates hooks mechanism in SVG Renderer.
* include/freetype/config/ftheader.h: New macro `FT_SVG_RENDERER_H'
for `freetype/svgrenderer.h'.

* include/freetype/svgrenderer.h: New file to store SVG specific
function types, SVG interface and `FT_Set_Svg_Hooks'.

* src/base/ftobjs.c: Adds implementation of `FT_Set_Svg_Hooks'.

* src/svg/ftsvg.c: Creates `svg_renderer_interface'.

* src/svg/svgtypes.c: Moves hook function types to
`FT_SVG_RENDERER_H'. Adds a hook for svg rendering. Temporary.
2019-08-17 20:36:05 +05:00
Moazin Khatti f1db18a464 Barebones of an SVG rendering module and making it part of the build system 2019-08-17 20:36:05 +05:00
Moazin Khatti db972c0568 Support OT-SVG fonts with CFF outlines 2019-08-17 20:36:05 +05:00
Moazin Khatti b9734fd870 Very crude way to handle SVG data with only TTF outlined OT fonts. Gonna revert soon. 2019-08-17 20:36:05 +05:00
Moazin Khatti 82f8102da6 Added FT_GLYPH_FORMAT_SVG 2019-08-17 20:36:05 +05:00
Moazin Khatti 9b7c3d1df9 Created Svg type and the load/free funcs inside sfnt interface 2019-08-17 20:36:05 +05:00
Moazin Khatti 0729a65165 Added the SVG tag 2019-08-17 20:36:05 +05:00
Moazin Khatti 311a253d4b turned on trace mode and added tags file in gitignore 2019-08-17 20:36:05 +05:00
Werner Lemberg 734d60f63c Another minor documentation improvement. 2019-08-06 20:38:17 +02:00
Werner Lemberg ad3443c931 Minor documentation improvement. 2019-08-05 10:00:41 +02: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