Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 17 Sep 2014, 05:34
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Hacking Puppy's Fonts
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [8 Posts]  
Author Message
jackpipe

Joined: 23 Aug 2005
Posts: 5

PostPosted: Tue 23 Aug 2005, 18:43    Post subject:  Hacking Puppy's Fonts  

Hi,
Well, I'm a newbie to puppy, though I've been using and sometimes tweaking linux since the early days. I have to say puppy seems to hit a real sweet spot of simplicity, size and utility. Well done !

One thing that still isn't fixed in Linux, and in other unices, are fonts.
The first problem I find, is that compared to windows and mac, they just look horrible. Puppy is no exception, I'm afraid - the antialiasing just doesn't cut it at smaller font sizes, and even the glyph placement seems to go wrong with some faces.
As a quick hack, all I've done today is follow the instructions here :
http://avi.alkalay.net/linux/docs/font-howto/Font.html

To summarize, I've acquired a libfreetype.so ( eg from http://ftp.club-internet.fr/pub/linux/plf/mandrake/free/community/i586/libfreetype6-2.1.9-2plf.i586.rpm ) library that has the byte-code interpreter enabled, for font hinting, I've turned off autohinting by default in fontconfig, and turned sub-pixel aliasing on (I'm on an LCD, though it still looks good on a CRT), and acquired a couple of truetype fonts - I copied verdana.ttf and tahome.ttf from /windows/fonts on a windows XP install, to /opt/TTF.

My /etc/fonts/local.conf is as follows:
Code:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file for local customizations -->
<fontconfig>
         <dir>/opt/TTF</dir>
   <match target="font">
      <test qual="all" name="rgba">
         <const>unknown</const>
      </test>
      <edit name="rgba" mode="assign"><const>rgb</const></edit>
   </match>
   <match target="font">
      <edit name="autohint" mode="assign"><const>False</const></edit>
   </match>
</fontconfig>


Its basically a filter on the replies to font queries, which basically says, whenever we find a font, that has an 'rgba' attribute, assign 'rgb' to the rgba attribute. And whenever we find a font, assign 'False' to the 'autohint' attribute, before returning the results to the application making the query.

I've also changed mozilla's fonts to use verdana, or tahoma, and modified the menu fonts etc, defined in $HOME/.mozilla/...../userChrome.css.

The second prooblem with linux is the plethora of different font schemes used by different apps - a mess for the average user (or even administrator) to deal with. I haven't made much progress on this - it seems to me a config app is required that can tweak all the different systems automatically.

Anyway, for just a quick bit of hacking, at least some of my apps now look comparable to windows and mac - substantially better than the standard linux install. I haven't measure memory use, performance, etc - but my take is that making text highly readable, and looking good is more of a priority. Or at least an option.

Just one caution - as detailed in the howto above - this is not neccessarily stuff that can go in a distro, as there are licensing issues.
I might knock up a HOWTO when I have things a bit slicker though.[/quote]
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Tue 23 Aug 2005, 20:19    Post subject:  

That's extremely interesting!
Wonderful in fact, as we are discussing fonts in Mozilla right now in another thread.

I was wondering, OpenOffice has some inbuilt TT fonts.
Maybe you could see how those look -- use PupGet package manager to download "openoffice-1.1.4_CUTDOWN" and install it.

Whe OO pupget pkg installs, it creates a link /root/.fonts to where the actual TT fonts folder is. Nothing else to do, Moz and all other apps automatically will use any TT fonts found in ~/.fonts/.
I'm interested to know how you find them compared to the MS fonts, considering that they are free for us to use.

...and a HOWTO, yes please!
Back to top
View user's profile Send private message Visit poster's website 
jackpipe

Joined: 23 Aug 2005
Posts: 5

PostPosted: Wed 24 Aug 2005, 08:57    Post subject:  

The bitstream fonts don't quite look as nice as the microsoft ones, in particular at low point sizes the 'e' smudges quite a bit, and the mono, and serif faces look as though they've come from a manual typewriter - the text looks uneven somehow.

Anyway, they do still look better with the freetype library with the bytecode interpreter turned on - they are 'crisper' and the glyph placement is better, though the type does look a little less heavy than the autohinted versions - those with big hi-res displays may prefer the darker versions.

I'll put together a couple of screen captures showing a few fonts with and without the bytecode hinting, and subpixel aliasing. Is there somewhere I should post the images ?

I think the trick with this is to match fonts/sizes to the rendering method - which can be done in fontconfig. ie we could turn off anti-aliasing below a certain point size, and have some fonts use the autohinter, and others use the bytecode interpreter (by setting the value of the autohint attribute). My preference so far though is that the bytecode interpreter does a better job than the autohinter. I'll tinker around some more today ...
[/img]
Back to top
View user's profile Send private message 
jackpipe

Joined: 23 Aug 2005
Posts: 5

PostPosted: Wed 24 Aug 2005, 09:14    Post subject:  

On second thoughts I may have the vera fonts the wrong way round - ie they look better with autohinting, rather than bytecode hinting.
Anyway - images on the way....
Back to top
View user's profile Send private message 
jackpipe

Joined: 23 Aug 2005
Posts: 5

PostPosted: Wed 24 Aug 2005, 09:19    Post subject:  

On third thoughts, it really does depend on the font, the font size, and the to some extent, the display. for some fonts, at some sizes the autohinter is best, other situations the bytecode hinter is best. But sometimes the difference can be quite substantial
Back to top
View user's profile Send private message 
Leon

Joined: 22 Jun 2005
Posts: 228
Location: Slovenia

PostPosted: Wed 24 Aug 2005, 11:13    Post subject:  

I've noticed that in my Chubby Puppy 1.0.4 a libfreetype.so.6.3.3 is already installed. I've changed /etc/fonts/local.conf as recommended above. I saw dramatical improvement. Fonts looked much better but the font colour turned from black to almost brown and that is unfortunatly not accaptable for me.

I' ve achieved some improvements folloving some tips about changing dpi and font in Mozilla and Firefox as suggested here: http://convexhull.com/mandrake_fonts.html.

My monitor is 15" Sony SDM-M51 LCD. Puppy Video Wizard shows current mode: 0x0118 1024x768x24.

Mozilla

Edit -> Preferences -> Appearence -> Fonts

Fonts for: Central European
Proportional: Sans Serif, Size:14
Serif: Times New Roman L2
Sans-serif: Bitstream Vera Sans
Cursive: serif
Fantasy: serif
Monospace: LucidaTypewriter, Size:14
Minimum font size: 12
Allow documents to use other fonts: unchecked
Display resolution: 72 dpi

Firefox

Edit -> Preferences -> General -> Fonts & Colors

Fonts for: Central European
Proportional: Sans Serif, Size (pixels):14
Serif: Times New Roman L2
Sans-serif: Bitstream Vera Sans
Monospace: LucidaTypewriter, Size (pixels):11
Display resolution: 96 dpi, Minimum font size: 12
Always use my: Fonts (checked)

User Chrome configuration file: /root/.mozilla/firefox/5kovolu5.default/chrome/userChrome.css:

font-size: 10pt !important;
Back to top
View user's profile Send private message 
jackpipe

Joined: 23 Aug 2005
Posts: 5

PostPosted: Wed 24 Aug 2005, 11:46    Post subject:  

The improvement you''re seeing is down to using sub-pixel rendering alone, I think - and yes it does have an effect on the colouring - some fonts exhibit quite unacceptable colour fringing etc.

puppy does include a libfreetype.so already, which is required for truetype font support for Xft - but this library has been compiled without support for byte-code interpreter hinting (I believe), so you'll need to download one includes that support (see my link above - in this case the version is 6.3.7). Install it in /usr/lib, and you'll need to alter the links in /usr/lib to point to the new library, ie :
ln -fs libfreetype.so.6.3.7 libfreetype.so.6
ln -fs libfreetype.so.6.3.7 libfreetype.so
And then restart any applications for the change to take effect.
You can just switch the links back to the old library to compare and contrast, or better still, edit /etc/fonts/local.conf to play with the 'autohint' attribute.

BTW I extracted the library file from the rpm on a redhat system, using rpm2cpio, though I'm sure there are better ways..
Back to top
View user's profile Send private message 
Leon

Joined: 22 Jun 2005
Posts: 228
Location: Slovenia

PostPosted: Wed 24 Aug 2005, 15:28    Post subject:  

Thank you verry much jackpipe!

I've done as you suggested and fonts looks now much better.

I think that I'll keep these setings in my /etc/fonts/local.conf:

Code:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file for local customizations -->
<fontconfig>
<!-- Enable sub-pixel rendering -->
   <match target="font">
      <test qual="all" name="rgba">
         <const>unknown</const>
      </test>
      <edit name="rgba" mode="assign"><const>rgb</const></edit>
   </match>
</fontconfig>


Some characters still have some blue shade but it's nice coloured shade ... Wink
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [8 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0706s ][ Queries: 11 (0.0038s) ][ GZIP on ]