Re: [GSOC 2022]: Integrate FreeType with alternative rendering engines

2022-04-12 Thread Bermler
rustType might be a good place to look at as well

https://github.com/redox-os/rusttype

On Tue, Apr 12, 2022 at 12:20 PM, Anurag Thakur 
 wrote:

> Hello everyone!
>
> I am Anurag Thakur, a first-year undergraduate student pursuing Computer 
> Science.
>
> I am interested in contributing to the project “Integrate FreeType with 
> alternative rendering engines” as part of GSOC 2022 and have been learning 
> about it for some time.
>
> Reading through the mailing list discussions and building on the work of 
> other contributors, I have been successful in creating prototype renderer 
> module for FreeType that
>
> is based on the font-rs rasteriser. The renderer module is written in C and 
> is very barebones at the moment, since I wanted to discuss with the community 
> and wait for an official approval for
>
> my proposal before investing too much effort in any particular direction.
>
> Since the parsing improvements of font-rs don’t completely apply to FreeType 
> due to the requirement of hinting etc., I have been focusing on the 
> rasteriser improvements, i.e., a dense data structure
>
> for storing the accumulation buffer, that is better suited for SIMD.
>
> Having briefly studied the renderers mentioned at FreeType’s GSOC page, I 
> believe the best course of action would be to first properly integrate a 
> font-rs based renderer in FreeType
>
> and then working on optimizing the implementation by studying the code of 
> font-go and fontdue.
>
> I am currently studying the code of Fontdue and since it started as a fork of 
> font-rs I hope integration will not be too tough.
>
> Pathfinder seems to be very different from the other renderers, I need to 
> study more about it, and will try to determine the best way to integrate it 
> with FreeType.
>
> I am also working on a way to properly benchmark the different 
> implementations and would appreciate any pointers regarding it.
>
> I would be grateful if the community could point me towards other 
> font-rendering implementations that could be of interest to FreeType. Any 
> research project or prototype that
>
> can bring performance improvements is welcome.
>
> Any other insights or guidance regarding this project would be greatly 
> appreciated.
>
> I have submitted my draft proposal to the GSOC website, and humbly request 
> the mentors to take a look at it and provide feedback.
>
> Regards
>
> Anurag

Re: GSoC 2022: Alternative Rendering Engines

2022-04-12 Thread Werner LEMBERG

Hello George,


> I am an individual who would be interested in the project "Integrate
> FreeType with alternative rendering engines" listed on FreeType's
> GSoC page.

Great to hear!

> There were multiple things in the blog post that the entry linked to
> that I found interesting/had questions about.
>
> The blog post mentions "a large constant factor because it’s doing
> complicated exact-area calculations for each pixel" as a performance
> impediment when drawing into the accumulation buffer.  If one were
> willing to settle for fewer gray levels in the resulting image,
> could something like multisampling be used to eliminate the need for
> these area calculations entirely, especially given that SIMD is
> already being used to exploit parallelism?  I'm sure there's a
> reason why this isn't done, but if someone could enlighten me as to
> exactly why I would highly appreciate it.

I think less than 256 levels of gray are a bad idea.  Regardless of
that, you have to compute the intersection of the glyph outline with
pixels.  Maybe there is a misunderstanding on my side, so please
elaborate.

> I would assume the parsing efficiency improvements mentioned in the
> blog post wouldn't really be applicable to FreeType, as parsing in
> such a way would inhibit more complex intermediate processes such as
> hinting that font-rs doesn't seem to do.  Please correct me if I am
> wrong here.

Fortunately, you are wrong :-) Hinting is always applied to the
outline before it gets rasterized.  In other words, font rendering is
not affected by hinting.

> Would use of SIMD entail an approach like that used by pixman, where
> hand-coded assembly is made for each SIMD instruction set
> extenstion?  If so, which extentions would be pursued.  I personally
> would love to try and learn to write optimized routines in assembly
> with less-used extensions like MMX or PowerPC AltiVec, but I was
> curious as to how relevant these platforms are viewed as.

Mhmm.  Having assembly code in FreeType doesn't enthuse me.  This
would be a last resort for hotspots if low-level C programming doesn't
give enough speed.  The more generic the code, the less hassle we have
to maintain it.

> I apologize for how behind I am in the proposal process. [...]

No problem :-)


Werner


Re: [GSOC 2022]: Integrate FreeType with alternative rendering engines

2022-04-12 Thread Werner LEMBERG

Hello Anurag,


> I am interested in contributing to the project “Integrate FreeType
> with alternative rendering engines” as part of GSOC 2022 and have
> been learning about it for some time.

Great!

> Reading through the mailing list discussions and building on the
> work of other contributors, I have been successful in creating
> prototype renderer module for FreeType that is based on the font-rs
> rasteriser.  The renderer module is written in C and is very
> barebones at the moment, since I wanted to discuss with the
> community and wait for an official approval for my proposal before
> investing too much effort in any particular direction.

OK.

> Having briefly studied the renderers mentioned at FreeType’s GSOC
> page, I believe the best course of action would be to first properly
> integrate a font-rs based renderer in FreeType and then working on
> optimizing the implementation by studying the code of font-go and
> fontdue.

Such an analysis would be part of the project.

> I am currently studying the code of Fontdue and since it started as
> a fork of font-rs I hope integration will not be too tough.
> Pathfinder seems to be very different from the other renderers, I
> need to study more about it, and will try to determine the best way
> to integrate it with FreeType.

Again, all those details should be part of the project.

> I am also working on a way to properly benchmark the different
> implementations and would appreciate any pointers regarding it.

I think the comparison diagrams in Raph Levien's blog entry on font-rs
page are quite a good start.

> I have submitted my draft proposal to the GSOC website, and humbly
> request the mentors to take a look at it and provide feedback.

Will do so soon.


Werner


[GSOC 2022]: Integrate FreeType with alternative rendering engines

2022-04-12 Thread Anurag Thakur
Hello everyone!

I am Anurag Thakur, a first-year undergraduate student pursuing Computer 
Science.
I am interested in contributing to the project "Integrate FreeType with 
alternative rendering engines" as part of GSOC 2022 and have been learning 
about it for some time.

Reading through the mailing list discussions and building on the work of other 
contributors, I have been successful in creating prototype renderer module for 
FreeType that
is based on the font-rs rasteriser. The renderer module is written in C and is 
very barebones at the moment, since I wanted to discuss with the community and 
wait for an official approval for
my proposal before investing too much effort in any particular direction.

Since the parsing improvements of font-rs don't completely apply to FreeType 
due to the requirement of hinting etc., I have been focusing on the rasteriser 
improvements, i.e., a dense data structure
for storing the accumulation buffer, that is better suited for SIMD.

Having briefly studied the renderers mentioned at FreeType's GSOC page, I 
believe the best course of action would be to first properly integrate a 
font-rs based renderer in FreeType
and then working on optimizing the implementation by studying the code of 
font-go and fontdue.

I am currently studying the code of Fontdue and since it started as a fork of 
font-rs I hope integration will not be too tough.
Pathfinder seems to be very different from the other renderers, I need to study 
more about it, and will try to determine the best way to integrate it with 
FreeType.

I am also working on a way to properly benchmark the different implementations 
and would appreciate any pointers regarding it.

I would be grateful if the community could point me towards other 
font-rendering implementations that could be of interest to FreeType. Any 
research project or prototype that
can bring performance improvements is welcome.
Any other insights or guidance regarding this project would be greatly 
appreciated.

I have submitted my draft proposal to the GSOC website, and humbly request the 
mentors to take a look at it and provide feedback.


Regards
Anurag




[GSOC 2022]: Integrate FreeType with alternative rendering engines

2022-04-12 Thread Anurag Thakur
Hello everyone!



I am Anurag Thakur, a first-year undergraduate student pursuing Computer 
Science.

I am interested in contributing to the project “Integrate FreeType with 
alternative rendering engines” as part of GSOC 2022 and have been learning 
about it for some time.



Reading through the mailing list discussions and building on the work of other 
contributors, I have been successful in creating prototype renderer module for 
FreeType that

is based on the font-rs rasteriser. The renderer module is written in C and is 
very barebones at the moment, since I wanted to discuss with the community and 
wait for an official approval for

my proposal before investing too much effort in any particular direction.



Since the parsing improvements of font-rs don’t completely apply to FreeType 
due to the requirement of hinting etc., I have been focusing on the rasteriser 
improvements, i.e., a dense data structure

for storing the accumulation buffer, that is better suited for SIMD.



Having briefly studied the renderers mentioned at FreeType’s GSOC page, I 
believe the best course of action would be to first properly integrate a 
font-rs based renderer in FreeType

and then working on optimizing the implementation by studying the code of 
font-go and fontdue.



I am currently studying the code of Fontdue and since it started as a fork of 
font-rs I hope integration will not be too tough.

Pathfinder seems to be very different from the other renderers, I need to study 
more about it, and will try to determine the best way to integrate it with 
FreeType.



I am also working on a way to properly benchmark the different implementations 
and would appreciate any pointers regarding it.



I would be grateful if the community could point me towards other 
font-rendering implementations that could be of interest to FreeType. Any 
research project or prototype that

can bring performance improvements is welcome.

Any other insights or guidance regarding this project would be greatly 
appreciated.



I have submitted my draft proposal to the GSOC website, and humbly request the 
mentors to take a look at it and provide feedback.


Regards

Anurag


GSoC 2022: Alternative Rendering Engines

2022-04-12 Thread Matsumura, George

Greetings,

I am an individual who would be interested in the project "Integrate 
FreeType with alternative rendering engines" listed on FreeType's GSoC 
page. There were multiple things in the blog post that the entry linked 
to that I found interesting/had questions about.


The blog post mentions "a large constant factor because it’s doing 
complicated exact-area calculations for each pixel" as a performance 
impediment when drawing into the accumulation buffer. If one were 
willing to settle for fewer gray levels in the resulting image, could 
something like multisampling be used to eliminate the need for these 
area calculations entirely, especially given that SIMD is already being 
used to exploit parallelism? I'm sure there's a reason why this isn't 
done, but if someone could enlighten me as to exactly why I would highly 
appreciate it.


I would assume the parsing efficiency improvements mentioned in the blog 
post wouldn't really be applicable to FreeType, as parsing in such a way 
would inhibit more complex intermediate processes such as hinting that 
font-rs doesn't seem to do. Please correct me if I am wrong here.


Would use of SIMD entail an approach like that used by pixman, where 
hand-coded assembly is made for each SIMD instruction set extenstion? If 
so, which extentions would be pursued. I personally would love to try 
and learn to write optimized routines in assembly with less-used 
extensions like MMX or PowerPC AltiVec, but I was curious as to how 
relevant these platforms are viewed as.


About me, I am an undergraduate physics/engineering student at a 
mid-size university in the United States. I have made contributions to 
the Cairo vector graphics library before, although the part I 
contributed to is not widely used. I am hoping that at least some of 
this knowledge will be applicable to the task at hand.


I apologize for how behind I am in the proposal process. If it is still 
workable for me to submit a proposal this late, I very much look forward 
to learning more about and working with FreeType and its community. In 
any case, I am grateful for the effort taken to present this wonderful 
opportunity.


Regards,
George