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 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 OS: Windows This issue is related to a MS Windows problem label Nov 25, 2018
@nielsmh
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
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

@TrueBrain
Copy link
Member

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
Copy link
Member Author

michicc commented Jan 17, 2019

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

@PeterN
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 LordAro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires conflict resolution

… 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.
@stale
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
Labels
OS: Windows This issue is related to a MS Windows problem stale Stale issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants