PIL does not generate fonts evenly across machines

I wrote some code that spits out an image. The code running on my local machine gives this image:

local http://img32.yfrog.com/img32/9476/local.png

and on my web host it looks like this:

host http://img32.imageshack.us/img32/858/hoste.png

As you can see, they are different. The top is much nicer. Both use the same code and the same font file (VeraMoBd.ttf), the same PIL version (1.1.6) and the same Python version (2.6).

I've googled around and there doesn't seem to be any global settings related to how PIL renders fonts ... What could be causing the different results?

+2


source to share


1 answer


I would guess the top image was rendered with TrueType byte-byte-byte enabled, where at the bottom only FreeType auto-hint was used. (I personally prefer the bottom!)



There are unfortunately software issues that mean the hint bytecode feature is not available for all binaries. This is why it is not a simple runtime feature that you can enable and disable, but something that was decided at compile time. If you compile your own copy of FreeType, you can enable this feature #define

by specifying the TT_CONFIG_OPTION_BYTECODE_INTERPRETER flag in config/ftoption.h

- if your lawyer thinks it's a good idea.

+4


source







All Articles