[SDL] LIGH

Vassilis Virvilis vasvir at iit.demokritos.gr
Sun Nov 4 08:30:00 PST 2007


Gregory Smith wrote:
> This patch allows setting the hinting style of each TTF_Font. The
> options are none, light, mono(chrome), and normal/default. This is
> useful because it allows access to FreeType's slight hinter, which IMO
> looks much better for in-game interfaces.
> 
> Any chance this can be added to SVN?
> 
> Gregory
> 

I am not a SDL developer but the patch looks alright to me.

One more nitpick though, is that I would prefer if you
used enums instead of defines. This way you can avoid
namespace pollution if you include SDL_ttf headers from
a C++ program.

So instead

+/* Set and retrieve FreeType hinter settings */
+#define TTF_HINTING_NORMAL    0
+#define TTF_HINTING_LIGHT     1
+#define TTF_HINTING_MONO      2
+#define TTF_HINTING_NONE      3

it would be nice to use
typedef enum {
	TTF_HINTING_NORMAL,
	TTF_HINTING_LIGHT,
	TTF_HINTING_MONO.
	TTF_HINTING_NONE
} ttf_hinting;

or something like this..

	.bill


More information about the SDL mailing list