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

using TTF with antialiased FreeType with 32bpp blitters will sometimes crash #2152

Closed
DorpsGek opened this issue Jul 20, 2008 · 4 comments
Closed
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

Tiberius opened the ticket and wrote:

(r13740)

FT_Render_Glyph with FT_RENDER_MODE_NORMAL will not always return a bitmap using FT_PIXEL_MODE_GRAY, since some TTF fonts have built-in mono bitmaps. Such fonts includes PMingLiU (新細明體) that bundled with Windows XP (Traditional Chinese version) at size 11, and AR PL New Sung (http://www.wazu.jp/gallery/views/View_ARPLNewSung.html) at size 11. Treat mono bitmaps with grayscale algorithm will produce garbage result, even crash OpenTTD.

The patch attached will check the pixel mode of rendered glyph, and correctly convert them into sprites.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/2152
@DorpsGek
Copy link
Member Author

peter1138 wrote:

Isn't the condition now reversed?

* aa is true when antialiased
* binary_bitmap is true when not-antialiased

Also this patch could be a one liner if you reused aa instead of changing aa to binary_bitmap.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2152#comment4485

@DorpsGek
Copy link
Member Author

Tiberius wrote:

Caveat is that binary_bitmap is not always false when anti-alias is enabled ...

i.e. freetype is possible to return non-antialiased glyph even if antialias is enabled, if the font have a built-in bitmap at the given size.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2152#comment4486

@DorpsGek
Copy link
Member Author

peter1138 wrote:

Huh?


This comment was imported from FlySpray: https://bugs.openttd.org/task/2152#comment4495

@DorpsGek
Copy link
Member Author

peter1138 closed the ticket.

Reason for closing: Fixed

In r13832


This comment was imported from FlySpray: https://bugs.openttd.org/task/2152

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant