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

Rework text rendering #76

Merged
merged 1 commit into from
Feb 25, 2021
Merged

Rework text rendering #76

merged 1 commit into from
Feb 25, 2021

Conversation

jwiggins
Copy link
Member

Hot on the heels of #74, I'm stirring up text rendering yet again.

Namely, I've removed FontCacheType entirely. It was something of an implementation detail that had poked its head out and now it's gone. Font objects are really just basic descriptions of a font to be loaded when rendering text; they aren't concerned with how they're cached now.

FontCacheType was up until now the way to control if text was rendered in raster mode or vector mode. That decision is now captured by the TextDrawingMode.TextDrawRaster enumeration value which is also the default value for GraphicsState.text_drawing_mode. TextDrawRaster is the only text drawing mode which uses the raster rendering path; all other modes use the slower [but much more powerful] vector rendering path.

Another breaking change is that the canvas draw_text method now uses the fill paint instead of the stroke paint when drawing in raster mode. If all of your colored text turns black after this change, that's the reason.

@jwiggins jwiggins merged commit 82724b2 into main Feb 25, 2021
@jwiggins jwiggins deleted the refactor/flexible-text-rendering branch February 25, 2021 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant