[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [E-devel] font hinting

On Mon, 13 Mar 2006 09:02:39 +0900
Carsten Haitzler (The Rasterman) <raster@rasterman.com> wrote:

> On Sun, 12 Mar 2006 21:19:44 +0000 Aleksej Struk <astruk@gmail.com>
> babbled:
> > Hi all,
> > 
> > I a little bit confused with the last cvs. Before I sync my tree, I
> > have font hinting working fine. I had all the 3 options : a) byte
> > code b) automatic c) no hinting. After sync to the cvs, a cannot
> > selectt option a) anymore.
> > 
> > However, after taking a look into code, I notice, that
> > evas_font_hinting_can_hint(.., EVAS_FONG_HINTING_BYTECODE) returns 0
> > instead of 1. So, for me it seams, that basically evas cannot do
> > this type of hinting on my machine? right ?
> > 
> > So, can somebody explain, why it is so ?
> freetype may be compiled with different hinting code. bytecode
> hinting is patented by apple and some distributions simply refuse to
> enable it in freetype2. by default it is not enabled in ft2. the
> ftoption.h file that gets installed SHOULD list what hinters are
> available via defines (no hinting is always available, then there's
> BYTECODE and UNPATENTED (auto hinting) hinting defines). the code in
> evas simply checks these values at compile time and then returns if
> its possible or not based on  these being defined or not. so far 1
> distribution already installs an ftoption.h that doesn't match the
> capabilities in the freetype2 that is installed. so it is possible
> that evas will get it wrong - but this is due to the headers
> installed at compile time. i know of no way to query RUNTIME what the
> features are so this is a bit of a bad api from ft2 in that ft2 could
> change  its build options without evas being recompiled against it
> and thus evas getting its capability checking wrong.

Gentoo has this problem because the freetype build just adds
building rather than editing header files. To detect if the bytecode
interpreter had been enabled, the freetype ebuild runs grep
on the binary for a string:

# Just a check to see if the Bytecode Interpreter was enabled ...
if [ -z "`grep TT_Goto_CodeRange ${S}/objs/.libs/libfreetype.so`" ]
    ewarn "Bytecode Interpreter is disabled."

This will fail if the binary has been stripped though, so that's
probably not much better of a solution.

I'm checking out right now if uncommenting the #define in ftoption.h
will fix the hinting issues with evas... I assume it should though.