Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDI engine for font glyph rendering as a replacement for FreeType #6980

Closed
wants to merge 3 commits into from

Conversation

@michicc
Copy link
Member

michicc commented Nov 25, 2018

This is a semi-serious PR that supplies a native Windows GDI font rendering back-end. It drops FreeType as a required lib, OTOH it is one more code path to maintain while FreeType isn't really causing problems.

Building with FreeType is still possible and will take precedence over the GDI renderer, but
the project files don't include FreeType any more by default. Combining GDI rendering with ICU text layout is untested.

As this is partly a programming exercise, I'm not too invested in it to drop.

@michicc michicc added the Windows label Nov 25, 2018
@michicc michicc force-pushed the michicc:pr/gdi_font_render branch from 9d36a0a to 0b74559 Nov 25, 2018
@nielsmh

This comment has been minimized.

Copy link
Contributor

nielsmh commented Dec 1, 2018

In preliminary testing, this seems to work correctly. I haven't tested with non-English languages yet, and it's probably also worth doing some performance measurements.

@michicc

This comment has been minimized.

Copy link
Member Author

michicc commented Dec 1, 2018

I made some measurements with TIC/TOC.

It seems that the ::GetGlyphOutline function has more or less the same speed as FreeType. Unfortunately, it has a dumb API definition. Right now it is called twice, once to query the needed memory size, then to get the data. Both calls take the same time.

Working around that is more stupid than expected. Simply pre-allocating a guess for the memory works for most glyphs, except if it is something like space, where you have to pass 0 for the size. And of course the failed function call will not tell you the needed memory size so you end up calling the function thrice.

A possible (and ugly) optimization would be https://gist.github.com/michicc/924a562decf38829259e2860a869d2c3

@michicc michicc force-pushed the michicc:pr/gdi_font_render branch from 0b74559 to b1b8f79 Dec 9, 2018
@TrueBrain

This comment has been minimized.

Copy link
Member

TrueBrain commented Jan 5, 2019

We recently switched from Jenkins as CI to Azure Pipelines as CI. This means you need to rebase before this Pull Request will pass its checks. Sorry for the troubles!

@michicc michicc force-pushed the michicc:pr/gdi_font_render branch from b1b8f79 to 91fc02a Jan 17, 2019
@michicc

This comment has been minimized.

Copy link
Member Author

michicc commented Jan 17, 2019

This would be a fix for #7032, even if not intended that way.

@PeterN

This comment has been minimized.

Copy link
Member

PeterN commented Jan 20, 2019

#7032 is now fixed so this is again a bit less serious, I suppose.

Copy link
Member

LordAro left a comment

Requires conflict resolution

michicc added 3 commits Nov 25, 2018
… does not depend on Freetype and into one that does.

This makes it easier to add other TrueType font rendering engines.
… including FreeType.

Building with FreeType is still possible and will take precedence over the GDI renderer, but
the project files don't include FreeType anymore by default. Combining GDI rendering with ICU
text layout is untested.
… have one, instead of repeatedly guessing the font.
@michicc michicc force-pushed the michicc:pr/gdi_font_render branch from 91fc02a to 3b1ae12 Jan 21, 2019
@stale

This comment has been minimized.

Copy link

stale bot commented Feb 20, 2019

This pull request has been automatically marked as stale because it has not had any activity in the last month.
Please feel free to give a status update now, ping for review, or re-open when it's ready.
It will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.