[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freetype-devel
Subject:    Re: [ft-devel] Accelerating freetype rendering with SSE/AVX
From:       Alexei Podtelezhnikov <apodtele () gmail ! com>
Date:       2018-03-23 14:17:52
Message-ID: CAJU=AjW4608x2Jfq7Z61+A1sajVNXm8dOttofxBD0xeyuNW48A () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Fri, Mar 23, 2018 at 8:48 AM, =D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=
 =D0=9B=D0=B5=D0=BE=D0=BD=D1=82=D1=8C=D0=B5=D0=B2 <dm.leontiev7@gmail.com>
wrote:
> I've developed an algorithm which can rasterize paths with SIMD
instructions. I believe this algorithm may be useful for freetype library.
It draws characters in 1-bit resolution(it can be useful for HiDPI
displays) but can be adapted to 256-color rendering by reducind hi-res
images down to 8bpp ones.

This sounds similar to font-rs
<https://medium.com/@raphlinus/inside-the-fastest-font-renderer-in-the-worl=
d-75ae5270c445>.
The efforts to port that to FreeType has fizzled.

> 1)what is the correct way to add my path rendering algorithm to freetype?
> I can redesign API in whatever way suitable to freetype, but I don't know
where to start.

It is possible to use external render with FreeType.
https://www.freetype.org/freetype2/docs/reference/ft2-raster.html
FreeType is modular. Your algorithm could be a separate module. FreeType
itself uses 2 completely separate rendering algorithms for 1bpp and 8bpp

> 2)my algorithm is best in rendering paths combines of lines. quadratic
curves are also ok, and the algorithm does not care about order of
primitives as long as they make a closed path. But I've no idea how to
handle cubic curves. Is there any built-in-freetype option to decompose
them before drawing?

The entire FreeType 8bpp algorithm is in one file
<http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/src/smooth/ft=
grays.c>.
Cubic and conic Bezier curves are approximated by a reasonable number of
straight segments

Good luck,
Alexei

[Attachment #5 (text/html)]

<div dir="ltr"><div><div><br><br>On Fri, Mar 23, 2018 at 8:48 AM, Дмитрий \
Леонтьев &lt;<a \
href="mailto:dm.leontiev7@gmail.com">dm.leontiev7@gmail.com</a>&gt; wrote:<br>&gt; \
I&#39;ve developed an algorithm which can rasterize paths with SIMD instructions. I \
believe this algorithm may be useful for freetype library. It draws characters in \
1-bit resolution(it can be useful for HiDPI displays) but can be adapted to 256-color \
rendering by reducind hi-res images down to 8bpp ones.<br><br>This sounds similar to \
<a href="https://medium.com/@raphlinus/inside-the-fastest-font-renderer-in-the-world-75ae5270c445">font-rs</a>. \
The efforts to port that to FreeType has fizzled.<br>  <br>&gt; 1)what is the correct \
way to add my path rendering algorithm to freetype?<br>&gt; I can redesign API in \
whatever way suitable to freetype, but I don&#39;t know where to start.<br><br>It is \
possible to use external render with FreeType. <a \
href="https://www.freetype.org/freetype2/docs/reference/ft2-raster.html">https://www.freetype.org/freetype2/docs/reference/ft2-raster.html</a><br>FreeType \
is modular. Your algorithm could be a separate module. FreeType itself uses 2 \
completely separate rendering algorithms for 1bpp and 8bpp <br><br>&gt; 2)my \
algorithm is best in rendering paths combines of lines. quadratic curves are also ok, \
and the algorithm does not care about order of primitives as long as they make a \
closed path. But I&#39;ve no idea how to handle cubic curves. Is there any \
built-in-freetype option to decompose them before drawing?<br><br>The entire FreeType \
8bpp algorithm is in <a \
href="http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/src/smooth/ftgrays.c">one \
file</a>. Cubic and conic Bezier curves are approximated by a reasonable number of \
straight segments<br><br></div>Good luck,<br></div>Alexei<br></div>



_______________________________________________
Freetype-devel mailing list
Freetype-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic