Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Per-Font selection of FreeType render mode (monochrome glyph to bitmap)  (Read 3738 times)

0 Members and 1 Guest are viewing this topic.

nitram_cero

  • Full Member
  • ***
  • Posts: 166
    • View Profile
The change (at Font.cpp):
FT_Glyph_To_Bitmap(&glyphDesc, FT_RENDER_MODE_NORMAL, 0, 1);
to
FT_Glyph_To_Bitmap(&glyphDesc, FT_RENDER_MODE_MONO, 0, 1);
(with a way to toggle it that fits with the rest of the Font interface)

The reason:
I'm into retro-looking games with big pixels and low color count palettes. I like using SFML2 because it has a really confortable interface, has window init, scaling, rotation, fonts, network, almost everything I need already handled.

Except for antialiasing of fonts. I managed to just change the libraries code but that's no solution and I think it's a missing feature.
Analogously it would be a pain if "setSmooth()" wasn't there to toggle textures anti-aliasing from nearest neighbour (off) to bilinear.

I've attached an image explaining it better (direct link, make sure it's unzoomed/1:1 pixel ratio)...
For both FreeType render modes, there are both No-zoom version and a render-to-texture (RTT) version where my problem is more evident.

Hope you give it a thought
Best regards

-Martín

[attachment deleted by admin]
« Last Edit: July 13, 2012, 12:20:04 pm by nitram_cero »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Wow ;D

http://en.sfml-dev.org/forums/index.php?topic=8523.0
https://github.com/SFML/SFML/issues/254
These are from... earlier today.

But anyway, you didn't search before posting (unless you searched a few days ago and posted only now) >:(
Laurent Gomila - SFML developer

nitram_cero

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Yes, sorry, I haven't searched again. I was getting the gfx ready for the example.
Even so, that's weird... what a coincidence!

Actually, I requested this exact same thing 3 years ago but then totally forgot about it, hehehe.

(Completly off-topic but I like to mention that is good you updated the network UDP code to use the protocol packet size instead of redundantly sending, and in a different packet, the size... which it wasn't working for non-blocking UDP sockets in SFML1.6)
« Last Edit: July 14, 2012, 12:43:42 am by nitram_cero »

 

anything