Commit Graph

29 Commits

Author SHA1 Message Date
Moazin Khatti 67c108bc9c [svg] Fix some unused variable warnings. 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 3325b42e91 [base,ot-svg] Minor fixes.
* src/svg/ftsvg.c (ft_svg_transform) Bug fix. Warning fix.

* src/base/ftglyph.c (ft_svg_glyph_transform) Warning fix.
2019-08-26 01:17:15 +05:00
Moazin Khatti 7d6ebe3a81 [ot-svg] Makes `rsvg_port.c' a part of the single build. 2019-08-26 01:17:15 +05:00
Moazin Khatti 4d24f52ead [sfnt,svg] Fix includes to allow a `multi' build. 2019-08-26 01:17:15 +05:00
Moazin Khatti e54fbbf283 [ot-svg] Bug fix. 2019-08-26 01:17:15 +05:00
Moazin Khatti b6f04b03e4 [ot-svg] Free pixmap buffer if error occurs while rendering. 2019-08-26 01:17:15 +05:00
Moazin Khatti 836c94e8d2 [ot-svg] Don't accept the hooks if value has been passed from an
env variable.
2019-08-26 01:17:14 +05:00
Moazin Khatti c492bf3f0a Handle cascaded transformations correctly.
We use homogeneous coordinates to properly calculate an equivalent
transformation correctly.
2019-08-26 01:17:14 +05:00
Moazin Khatti 3f6f939378 Adds transform support for OT-SVG glyphs. 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 fdb7d53ebf Fixes code warnings. 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 bb1b25e560 Make `ft_svg_renderer_class' dumb if OT-SVG
support is disabled.
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 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 877736d057 Removes trailing white spaces. 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 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