Commit Graph

11 Commits

Author SHA1 Message Date
Moazin Khatti f40ef225a2 Instead of individual properties. Just use one that
takes pointer to the hooks structure.
2019-07-18 00:05:49 +05:00
Moazin Khatti d94f52b0c6 Use `FT_Property_Set' to set the hooks. One less API function. 2019-07-17 23:31:59 +05:00
Moazin Khatti 6e05128713 Better naming used. 2019-07-11 14:09:43 +05:00
Moazin Khatti 509ae10ca5 Memory allocation for `state' of renderer should be performed
on the SVG port side not the FT size. Minor doc fixes.
2019-07-11 14:09:43 +05:00
Moazin Khatti 2e9e84193d 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-07-11 14:09:43 +05:00
Moazin Khatti b85698d447 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-07-11 14:09:43 +05:00
Moazin Khatti f9b0bb6b95 Minor fixes. 2019-07-11 14:09:43 +05:00
Moazin Khatti a4f1da1572 Removes trailing white spaces. 2019-07-11 14:09:43 +05:00
Moazin Khatti 5381d51956 [ot-svg] Silly mistake fix.
Instead of an `FT_Library' instance, `FT_Module' is supposed
to be passed.
2019-07-11 14:09:43 +05:00
Moazin Khatti 8f256de2d8 [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-07-11 14:09:42 +05:00
Moazin Khatti 7915e5e102 Barebones of an SVG rendering module and making it part of the build system 2019-07-11 14:09:42 +05:00