Skip to content
New issue

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

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

Already on GitHub? # to your account

Add functions to use FreeType ClearType-style LCD rendering #138

Merged
merged 2 commits into from
May 8, 2022

Conversation

1bsyl
Copy link
Contributor

@1bsyl 1bsyl commented Jul 5, 2021

As proposed in issue #131, add functions to use FreeType ClearType-style LCD rendering

@1bsyl
Copy link
Contributor Author

1bsyl commented Jul 5, 2021

We may want to define "FT_CONFIG_OPTION_SUBPIXEL_RENDERING"
external/freetype-2.10.4/include/freetype/config/ftoption.h

    * Uncomment the line below if you want to activate LCD rendering
    * technology similar to ClearType in this build of the library.  This
    * technology triples the resolution in the direction color subpixels.  To
    * mitigate color fringes inherent to this technology, you also need to
    * explicitly set up LCD filtering.
    *
    * When this macro is not defined, FreeType offers alternative LCD
    * rendering technology that produces excellent output.

@adamharrison
Copy link

Just wanted to say, this is great. I'd love to use this when it gets merged!

@1bsyl 1bsyl mentioned this pull request Jan 2, 2022
@manuel-fischer
Copy link
Contributor

It might be useful if there would be transparency support.
But for correct LCD rendering with transparency support, SDL itself should add support for separate alpha channels for red, green and blue, which might not be supported with hardware acceleration.

It might also be useful, if the direction of the subpixels can be configured.

SDL_ttf.c Show resolved Hide resolved
@slouken slouken merged commit f26fa4c into libsdl-org:main May 8, 2022
slouken pushed a commit that referenced this pull request May 9, 2022
This catches up with commits 09a2294 "Fixed bug #187 - Arbitrary memory
overwrite occurs when loading glyphs and rendering text with a
malformed TTF" and db1b41a "More integer overflow (see bug #187)"
in code that was written before those fixes, but merged after them.

Fixes: f26fa4c "Add functions to use FreeType ClearType-style LCD rendering (#138)"
Signed-off-by: Simon McVittie <smcv@collabora.com>
slouken pushed a commit that referenced this pull request May 9, 2022
This catches up with commit 6095925 "replace size_t casts on pointers
with uintptr_t" in code that was written before that commit, but merged
after it. This makes all the code paths that call
SDL_CreateRGBSurfaceWithFormatFrom() consistent with each other.

Fixes: f26fa4c "Add functions to use FreeType ClearType-style LCD rendering (#138)"
Signed-off-by: Simon McVittie <smcv@collabora.com>
@1bsyl 1bsyl deleted the br_lcd_rendering branch February 6, 2023 10:52
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants