[links-list] I'm in DirectFB-enhanced Links 2.1pre4 now... at last

aludal aludal at softhome.net
Fri Nov 1 16:24:44 PST 2002

I did it.
To achieve this, it took a somewhat non-trivial hack, and full two nights long 
examining my logs.

1. Appending lilo.conf by "video:matrox:[bla-bla-bla]" to invoke framebuffer 
driver may be needed only for testing fb video modes available to a 
particular videocard+monitor combination. To apply the max resolution  
possible though, one needs to 
like once, just to check whether it works at all (fb "modelines are WAY 
different from usual X modelines... I couldn't find a reliable (online) fb 
timing calculator, to extend beyond crappy VESA 2.0 standards, but I 
certainly did incremental something with this "max" approach.)
When you have your fb-enabled Linux booting, you can find that a workable fb 
driver displays messages (non-workable won't... you can observe this one by 
the smoke from your monitor. But if the monitor is protected from the 
terribly stupid internal fb modes calculator, then it's OK, and Linux must 
boot into X (provided that init 5 was ordered). Otherwise, a workable fb 
timing set could be discovered by issueing a command fbset -i, then the 
/etc/fb.modes must be prepended with exactly what fbset -i says.
Now, you can get rid of that invoking fb at the boot time altogether, it won't 
be needed.

2. An ordinary GPM library was needed for Links' mouse to function 
properly.... Not anymore, as DFB-enhanced Links segfaults, when two mouse 
drivers clash in their fight over VT. So, I went and killed gpm ("gpm stop" 
just didn't work for that hardy bastard).

3. Re-compiling a (distro's stock) kernel leaves a lot of symlinks broken, 
whatever you do or don't do to preserve or update System.map and initrd.img.
Besides, it took me to recompile DirectFB on top of fb-enabled box, and even 
then previously dfb-patched links didn't work. So, I repatched a fresh links 
pre4 distribution, replaced the stock fonts with my (Cyr) hand-tooled 
outlines,  did ./gen there, and did ./rebuild reconf && make && make install.
It should show "X FB DIRECTFB" as graphics drivers as config options for Links 
now, and it did.

4. Before starting playing with your new toy, go to your console and start 
some mc, or mutt, or whatever which had gpm support lately. Play with your 
mouse inside that console, and check for possible gpm revival. Kill it, more 
harshly this time!

5. links -g -driver directfb starts the whole bloody thing on full screen. 
Nice 3D-shaded cursor, though. And rejoice ye linksinners, Shift key is 
working again!!! (Who broke that, anyway? Deny him his regular Pilsner for 
the weekend) Otherwise, no sweat:
a) where's the windowing thing, I don't need it on full screen?
b) how do I change keyboard layout to what I use: Ctrl-Shift to switch to 
c) where's that alpha-blending toy? Wish I knew what I need that one for, 
though..., But what I really need is this:  stock Links has a nasty dark-grey 
background for Web pages that just don't care about backgrounds (like 
www.mozilla.org, for example). How do I change that very bad behavior once 
and for all? I need white there, as my hand-tooled fonts lose all of their 
charm when their subpixel antialiasing goes literally into the drain of 
eqally grey background.

The subtotal of all this reconfiguring orgy is, basically, a nice 3D pointer 
so far.

Now my questions are:
1) If there's possibility to implement clipboard (text/image) 
mouse-Select-Copy-Paste in DFB-enhanced Links, then it needs to be done above 
2) Links badly needs an alternative freetype2 font layout engine as an option 
(present png font sets may stay for non-X, or as a fallback). I'd prefer 
Mozilla's here, and I've heard somewhere that it's something called 
OpenSource, for anyone to grab a good engine whose metrics handling was 
licked for 9 years now. So grab it, for Christ sake!

2) Full-fledged (3D) navigation buttons must be implemented, as well as 
falldown-menues, and a (bookmark-list) sidebar. Well, as soon as DirectFB 
gets a more sensible windowing manager I suppose.

There's more feature requests, but they possibly don't have anything to do 
with DirectFB (projected) enhancements.

P.S. As for Mozilla's recent freetype2/Xft2 fonts rendering/layout 
enhancement, I published a mini-howto called FONT DEMOZILLAFYING HOWTO in my 
Silicon Valley LUG couple days ago. Somebody not so links-centric in this 
mailinglist may find it useful, so here it goes:

> I installed TrueType.... RedHat 7.2.... Arial still looks horrible in
> Mozilla 1.2. ...Ximian...

>...tips or tricks?

Well, I could offer both tips & tricks not covered in many recent "Font 
de-uglification" HOWTOs. So, here comes

Copyleft 2002 Alexander Udalov
aludal at softhome.net

1. First of all, make sure you've achieved the absolute ceiling of screen 
resolution that your videocard+monitor could manage. It should be at least 
120dpi, otherwise throw away your card+monitor, there's nothing you can 
deuglify for them. Don't listen to the Palm-holding blokes telling that at 
1600x1280 or more fonts would look too small, they don't know what they're 
talking about. There's virtually no excuse of using lesser 
resolutions/colordepths than your card+monitor are capable without blurring. 
My working resolution is 2048x1536 on a 21" screen, and it 
gives me real-world pointsizes with the addition of this in X86Config-4's 
(Section "Monitor"):

        DisplaySize             400 300

(visible raster hsize vsize in millimeters; have a European tape measure 
ready). So, apart from dpi, my screen 10 pointsize letter looks exactly like a 
paper-printed 10 pointsize letter.
In raising your (X or framebuffer, or even DirectFB I'm playing with now) 
screen resolution, you'd need your card+monitor detailed specs handy, plus 
some (online) modeline calculator, so go google them out.

2. You'd need to update your XFree86 to 4.2.0+freetype2 v. 2.1.2, as the 
least. RedHat's stock freetype rpm wouldn't challenge Apple patents, so you'd 
better take (European) freetype latest sources and build it yourself, with 
bytecode interpreter turned ON this time (don't tell Apple... or Adobe, hehe. 
Don't use it on production machines, only for home eye candy). While building 
and installing your fresh freetype2 do NOT forget to clean XFree86 of old 
libfreetype chunks, like what its Readme-Unix says.

3. Go to your /etc/X11/fs/config and edit it (this time patents are mine:)

# 100 x 100 and 75 x 75
default-resolutions = 75,75,100,100

must look like:

#100 x 100 and 75 x 75
default-resolutions = 130,130,100,100

Naturally, substitute "130" with whatever you've got (proud owners of Dell 
Inspiron 8x00's or Emperor Penguin's UXGA screens can put "158" there.... oh 
boy, anyone give me that toy for xmas!). Then, while still in this config 
file, re-shuffle your fonts order in catalog (patent is not mine anymore):
a) first goes your collection with Arial (it better be MS webfonts, Arial 
Unicode, or Arial Narrow with nicer outlines, as these are treated better by 
otherwise very dumb freetype2.)
b) then you re-arrange the rest with "100dpi" and "unscaled" go before "75dpi" 
and (scaled), Type1, Speedo and other legacy crap

4. Go to your XftConfig, add and alias whatever Arial you want to NOT be 
substituted by stock Helvetica, or (Type 1 Adobe's old glyphs) Arial. There's 
loads of howtos and real-life XftConfig specimens out there in the Google, 
have a look.

5. Now you are ready to de-mozillafy your Mozilla 1.2.
a) Go to Mozilla menu's Edit->Preferences->Appearance->Fonts->check that 
Display resolution has 'System setting', or better have your millimeter type 
measure ready, again, to calibrate.
b) Go to your /usr/local(or is it lib with 
you?)/mozilla/defaults/pref/unix.js, find the followinf section and edit it 
like this:

// TrueType
pref("font.FreeType2.enable", true);
pref("font.freetype2.shared-library", "libfreetype.so.6");
// "if libfreetype was built without hinting compiled in" <-- you didn't do
// very stupid thing, did you?
// "it is best to leave hinting off" <-- maybe.... or maybe not. See below.
pref("font.FreeType2.autohinted", true);
pref("font.FreeType2.unhinted", true);

(As they say, actually Mozilla was prepared to use autohints since v. 1.0.1, 
but freetype2 was a disaster then. From the Mozilla point of view, it mostly 
remains that way as per October 31, 2002, so this hack is still a hack, and 
not an official feature. Anyway, you are free to play with two last "true", 
like changing them into "false"one by one, and carefully examining your 
results in 6 to 36 pointsizes)

c) Your Arial should look smooth and tender like a baby ass now, but there's 
lots more to tweak. For me, Arial/Helvetica/Espy Sans and all other (obsolete 
up to the giveaway value, designed and hinted @75-96dpi) computer sanserifs 
are a poor man's solution to bad screens' readability, or legibility 
problems. The true grandeur of watching the Web pages comes only with 
addition of professional, hand-crafted, delta-hinted (at least at 120dpi, or 
higher) serifs by major type foundries like Bitstream, Lynotype. Well, by 
Adobe and Monotype, too.  But even the latest freetype-2.1.3rc2 is still too 
stupid to handle something like charming Cheltenham collection. Or Apple 
Garamond, or Titus Cyberbit Unicode Basic (the latter is free-downloadable, 
for good-mannered linguists, like you and me.) Here comes a very nice "Xft 


The name is obsolete now, as the hack was applied to freetype2, and you'd need 
to download only ft-slight-2002xxxx.tar.gz from there, to replace your 
libfreetype.so.6.3.2 with it.

When adding new, and much nicer than Arial TrueType fonts, beware of present 
mkttfdir completely and hopelessly broken. Its replacement ttmkfdir segfaults 
easily too. You may end up with manual tooling your fonts.dir, fonts.scale -- 
it's straightforward. Mozilla doesn't use this legacy crap though, you just 
need to declare your shiny new fonts to it if there's a separate/unusual 
directory made for them.

That's it. If you're dissatisfied still, or wouldn't go higher than your 
present measly 1280x960, discard mozilla altogether and go for graphic Links
by Czech Twibright Labs:

http://atrey.karlin.mff.cuni.cz/~clock/twibright/links/download.html (better 
use version 2.1pre3, as pre4 is pretty buggy)

This mozilla/opera/phoenix killer browser sports hardwired pseudo-Unicode 
pre-hinted png fonts (I handtooled the Cyrillic part for them... don't shoot 
me), and it would look just fine on your 320x200 Redhatted "machine". 
Besides, Links is lightning fast.

Have fun!

--- Say NYET to the .NET! Say NYET to Osama Bill Gates! -

Unsubscribe: send email to links-list-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message

More information about the links-list mailing list