Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to turn on freetype hinting & get best anti-aliasing
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
kerframil
l33t
l33t


Joined: 19 Apr 2002
Posts: 710
Location: London, UK

PostPosted: Fri May 10, 2002 3:35 pm    Post subject: How to turn on freetype hinting & get best anti-aliasing Reply with quote

Hi, I was wondering how I could enable full hinting in the freetype2 build as I live in the UK and I believe I'm not affected by Apple's patent issue (see www.freetype.org/patents.html). Also can anyone clarify the following notions I have:

1) ttmkfdir generates font scale files for TrueType fonts which assists in the rendering ..? Why does it depend on freetype v1 build?
2) By editing XftConfig file I can put in a directive not to antialias fonts unless they are within a certain point size range (9pt - 12pt for example)?
3) KDE will be affected by (2) because it uses Xft extension? At the moment it gratuitously anti-aliases pretty much everything, and it's generally agreed that fonts shouldn't be anti-aliased above or below a certain size. Konqueror fonts look much too fuzzy for example!
4) my XF86Config has the freetype module referenced, yet until recently I didn't have the freetype build installed ... shouldn't that have caused problems? Or is it a static lib?! Will I have to recompile X or change my USE flags?
5) Also, according to the XFree section of the FreeBSD handbook you can enable sub-pixel rendering, great for LCD screens (which Micro$oft call ClearType technology ... heheh). Has anyone tried this on Gentoo?

Hmm, I just found the XFree86 Font De-uglification HOWTO so I'll read that. Any contributions to this topic are still most welcome :)
Back to top
View user's profile Send private message
kerframil
l33t
l33t


Joined: 19 Apr 2002
Posts: 710
Location: London, UK

PostPosted: Fri May 10, 2002 6:34 pm    Post subject: KDE antialiasing Reply with quote

Hmm, just joined the mailing lists - seem to be a lot more answers going around. Someone found out how to control the antialising "ranges" in Konqueror (that is, the KHTML renderer), apparently in XftConfig you have to use "pixelsize" rather than "size" in the clause, eg:

match any pixelsize < 11 edit antialias = false;

One down anyway :) [/b]
Back to top
View user's profile Send private message
phaze3k
n00b
n00b


Joined: 24 Apr 2002
Posts: 36

PostPosted: Sat May 11, 2002 2:45 pm    Post subject: Reply with quote

Kool, any chance once you have a definative answer to your questions you could post them here? :)
I too live in the UK< and even if I didn't, patents are stupid and I will quite happily ignore them.
Back to top
View user's profile Send private message
kerframil
l33t
l33t


Joined: 19 Apr 2002
Posts: 710
Location: London, UK

PostPosted: Mon May 13, 2002 1:09 pm    Post subject: The saga continues ... Reply with quote

Well, after a bit of digging around it turns out that Gentoo turns on the TrueType bytecode interpreter anyway for freetype2 builds (the bit that is covered by Apple's patent) :D

The option is in include/freetype/config/ftoption.h within the freetype source tree and if you look at the ebuild file for freetype (/usr/portage/media-libs/freetype/fretype-2.0.9.ebuild is the current unmasked build), a simple sed command applies the alteration after the source has been unpacked. So:
Code:
#undef TT_CONFIG_OPTION_BYTECODE_INTERPRETER

is changed to:
Code:
#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER

thus enabling the macro to compile it in.

I was surprised to see that I had freetype v1 installed (don't ask), so I'm re-emerging freetype now. I still haven't got many answers for my other queries and in particular suspect that X won't be affected. I think now that the relevant library is called libXft.so, but I'm not sure how that gets compiled - whether I would have to change X build or what??? X is running now without freetype emerged ...

OK, what I have learnt is that by enabling this macro, autohinting is disabled. Hinting is important for rendering fonts, particularly at small sizes (the hints are contained within the font). When the bytecode interpreter is enabled, apparently a much better hinting method is used - I gather that autohinting is a workaround for the patent.

Note, that some assert that completely disabling hinting actually gets better results. To find out more, have a look at this thread on http://www.mandrakeforum.com/article.php?sid=1986&lang=en. Somebody hacked up libXft to disable hinting, but have a look at the 3rd reply where somebody points out that he thinks it is better to have the bytcode interpreter on.

All of this only affects truetype fonts. I was thinking about maybe nicking some quality Type1 fonts from Adobe's Acrobat reader and seeing how that changes things (apparently you can improve Ghostscript in this way too). Now to do some testing as I am absolutely fed up of appalling quality font rendering in X. It galls me every time I look at my XP machine on the same desk :x *BSD/Linux will never be ready for the desktop unless this is addressed. And the anti-aliasing is worse than not having it at all unless you crave eye-strain! I have a feeling too that a lot of editing of XFree86Config and XftConfig will be necessary. Proper documentation is required for these things - it get's tiresome digging around Google and forums/mailing lists to find out basic things. Don't get me wrong - I like solving problems and learning things but check out this: http://www.freebsd.org/handbook/x-fonts.html. Documentation of this quality is required and more of it, IMHO!! If I get to the bottom of this I'm writing my own documentation :lol: - shouldn't we all be doing a lot more for the *BSD/Linux world?

That reminds me, there are some mistakes in the man pages for Gentoo :roll: , time to go file a report ...
Back to top
View user's profile Send private message
kerframil
l33t
l33t


Joined: 19 Apr 2002
Posts: 710
Location: London, UK

PostPosted: Mon May 13, 2002 2:11 pm    Post subject: Whopeee! Getting there ... Reply with quote

Found an interesting link: http://www.xfree86.org/~keithp/render/. X is statically linked against the FreeType2 lib (and the 1.3.1 also for backward compatibility I think). Unpacked the source and moved to the extracted directory for X by doing:
Code:
cd /usr/portage/x11-base/xfree
ebuild xfree-4.2.0-r9.ebuild unpack
cd /var/tmp/portage/xfree-4.2.0-r9/work/xc


Had a little sniff around in there. The file of interest is config/cf/host.def. We can see #define BuildFreeType in there and it obviously compiles the freetype lib distributed as part of X (out of date - v2.0.6 :wink: ) which is in extras/freetype2. I looked at extras/freetype2/config/ftoption.h expecting the BYTECODE option to be off but it was on anyway! At least now I know how to compile a new libXft.so - I think :lol:

Anyway, on the page it says you can actually compile against your installed freetype rather than the one included with the X source by adding:
Code:
#define Freetype2Dir /path-prefix-for-freetype-goes-here

Granted, this hasn't got a whole lot to do with the AA topic but assuming X works OK with later builds of Freetype perhaps it would be nice for X to have freetype2 as a depedency in Portage and to use the very latest lib by adding in that line before compilation. Gotta try it I suppose ...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum