How to enable font anti-aliasing in Wine PDF Print E-mail
Written by Tom Wickline   
Wednesday, 25 March 2009 04:16

What is Aliasing?
All computer displays show images in bitmap mode. What this means is that every image is really a bunch of tiny little squares that make up the image. What this essentially means is that computers can't display really smooth curves.

These two letters are printed with the same font face, size, and style. The only difference between them is that the top letter is aliased and the bottom is not.

As you can see, the top letter has a jagged, "stair-step" effect that is the hallmark of aliasing. It is the way that computers display curves on the screen. The bottom letter, on the other hand, has a smoother, fuzzier look to it. It is anti-aliased to simulate the look of a smooth curve on the screen.

How does anti-aliasing work?
Anti-aliasing works with the way that our eyes see things. Human eyes do not see in as precise detail as we would like to think. In reality, the mind converts the images into what it "thinks" they are supposed to look like.

With anti-aliasing, the curve is created with squares of color that are shaded darker or lighter depending on how much of the curve would take up that square. For instance, if a portion of a curve takes up 10% of a pixel, that pixel would be shaded with 10% of the color saturation of the curve.

What this amounts to is that anti-aliasing adds shading along the curve to "fool the eye" into thinking it's seeing a smooth curve rather than a jagged bitmap.

Anti-aliasing Pros and Cons
Pros

  • Makes fonts look smoother
  • Rounded edges look round
  • Type is easier to read (for some) because it looks more like what printed type looks like
  • It's just plain prettier (some would argue)

Cons

  • Small fonts become too fuzzy to read
  • Sharp edges may be fuzzy and not precise
  • You can't print anti-aliased text as it comes out blurred
  • Images are generally larger
  • Type is easier to read (for some) because the blurring is reduced and the fonts are clear

 

Understanding Antialiasing and Transparency

Introduction

When designing web pages, you will often wish to incorporate graphic elements. The easiest way to include graphics is through the use of images.

Images, though, have two fundamental limitations for supporting graphic elements. First, rather than being vector-based (as are text and graphics created in programs such as Illustrator), images are a collection of pixels. Second, images are always rectangular.

In order to make your graphics look as smooth and accurate as possible, and in order to seamlessly integrate them into your design, you will need to understand antialiasing, and how it relates to transparency. This tutorial will explain the basics of antialiasing, and how to use succesfully use it in tandem with transparency.

Aliasing

The term aliasing pertains to the process of sampling something smooth and continuous using a series of discrete measurements. If the measurements do not accurately represent the function, unwanted artifacts which are not present in the original will appear. The appearance of these artifacts is referred to as aliasing.

In our case, the smooth and continuous feature we are interested in is vector data, such as text or an illustration. The sampling that occurs is due to rasterization: the process of converting vector data into pixel data. The limitation of this representation is that while vector data can represent limitless shapes and has infinite resolution, pixels are square and are relatively large.

This limitation isn't visible when dealing with rectangular objects, as in the images below:

Rectangular features, even when magnified (right) suffer from no visual artifacts.

As soon as we deviate from rectangular shapes, however, we begin to see some unwanted artifacts.

Diagonal lines are rendered less accurately. A magnified view demonstrates jaggies.

These unwanted artifacts, often called stairsteps or jaggies, are a form of aliasing. They'll appear whenever we attempt to represent a shape that deviates from a rectangle.

Antialiasing

As you have probably surmised, antialiasing (or sometimes, anti-aliasing) refers to methods of eliminating (or most often, reducing) these unwanted artifacts. In the context of rasterizing images, antialiasing refers to the reduction of the jagged borders between colors.

The example below demonstrates the most effective technique of antialiasing graphics: taking advantage of the many levels of color that our monitors can represent.

Here is a simple image that is still complex enough to show jaggies when rendered. This is even more noticeable in the detail image.

A large atmark rendered without antialiasing.

Here is the same image rendered using antialiasing. Note how much smoother this image appears, and how much better integrates into the background.

Antialiasing smoothes out the jaggies.

The detail image should demonstrate the basics of how antialiasing works with images. Rather than only using black and white pixels, intermediate levels of gray are used to blend the pixels together. The amount of black or white used represents how much the original graphic covers a pixel. A fully covered pixel will be black. One that is not covered at all will be white. One that is halfway-covered will be gray.

In this case the border pixels are shades of gray because the foreground is black and the background is white. If the foreground were red, however, the border pixels would be shades of pink.

With a red foreground and a white background, intermediate pixels are pink.
When anti-aliasing is working Winecfg should look like this. (on Wine 1.1.0)


To enable smoothed fonts in Wine you will need to run regedit and change these settings.

REGEDIT4

[HKEY_CURRENT_USER\Control Panel\Desktop]
"FontSmoothing"="2"
"FontSmoothingType"=dword:00000002
"FontSmoothingGamma"=dword:00000578
"FontSmoothingOrientation"=dword:00000001

You may also want to install the free windows core fonts and even the
Tahoma font. Most Linux/Unix operating systems come with nice fonts also such as the Liberation font set.

OK, this sounds like chinease to you...Don't worry their is a handy little script that will do everything for you as
Wine has supported font smoothing, including subpixel since wine 1.1.12.

Here is a screenshot of the script running.


Wine font smoothing english version can downloaded from here.
And a Russian version can be downloaded from here.

To run the script:

wget http://files.polosatus.ru/winefontssmoothing_en.sh
bash winefontssmoothing_en.sh



Del.icio.us     Digg This!     Furl     Google     Seed Newsvine     Reddit     Slashdot     Stumble It!     Technorati     Yahoo MyWeb

Comments
Add New Search RSS
What a coincidence
NSLW 2009-03-25 00:57:36

It was yesterday when i finished my latest POL Helper release and guess what it does have the function to set anti-aliasing on every PlayOnLinux prefix. It's a nice coincidence :) It is called "Font Smoothing" in POL Helper.

You
can download the latest release of POL Helper 24032009 plug-in from known fileshare server. The changes in the last version are at PlayOnLinux forum or in readme file in the package.
Remember to delete old "POL Helper" directory before installing new version
Tom Wickline 2009-03-25 05:21:39

Hello NWSL,

Yes this is great news, I will update the link in the older POL helper post to point to
this new release.

Thanks!

Tom
dutchy 2009-03-25 22:57:49

I ran the script on ubuntu intrepid with latest wine (1.1.17) and user.reg is correctly updated, yet
fonts are still not smooth
dutchy 2009-03-25 23:08:55

actually in some locations fonts are smooth but not in others, like winecfg fonts still look not
smooth, the fonts selector and tooltips in office 2007 are smooth (these were smooth even before
running the script though) but typed text is not smooth and dropdown of font selector is again not
smooth.

ps: I do have mscorettfonts installed...
dutchie 2009-03-25 23:23:02

Okay I found out only 6,7 and 8 point fonts are smoothed, how to smooth the bigger fonts?
re:
NSLW 2009-03-26 12:13:44

dutchie wrote:
Okay I found out only 6,7 and 8 point fonts are smoothed, how to smooth the bigger fonts?

Did you tried to install tahoma font?
Tom Wickline 2009-03-26 12:38:19

I have the tahoma font installed and it works fine for me...
hairy 2009-03-26 22:57:53

i personally found it only worked after i manually downloaded and
installed

http://download.microsoft.com/download/ office97pro/fonts/1/w95/en-us/tahoma32.exe

with
wine itself, despite having it my /usr/share/fonts already
re:
NSLW 2009-03-27 00:21:07

hairy wrote:
i personally found it only worked after i manually downloaded
and installed

http://download.microsoft.com/download/ office97pro/fonts/1/w95/en-us/tahom
a32.exe

with wine itself, despite having it my /usr/share/fonts already


You can use winetricks instead to install every font. It is easier because you don't have to
know paths.
Great tip, great script
Helio Loureiro 2009-04-17 07:44:09

Hi,

Thanks for sharing. Your script was really handy to change my settings. Worked smoothly, and
achieved the expected result.
With themes?
lumi 2009-04-28 23:06:53

Hi

The script worked great with the default setup

However, it does not seem to work with a theme
installed (msstyles)

Do you know how this can be solved?

Thanks..
Never mind
lumi 2009-04-29 02:24:13

I solved it by upgrading to wine 1.1.20
I installed 1.1.13 to install Office 2007..
Fonts
Anonymous 2009-05-17 17:21:28

A great number of good fonts for Linux can be found here: http://linuxfonts.narod.ru/
Frankynov 2009-05-26 07:26:36

Dear, you just........ ROCK !!!! :D

I wanna say a huge thank you for your blog. Thanks to you I was
able to install WLM 8.5 in Ubuntu and have the nice font in it !

Best regards from
Belgium,

François
Tom Wickline 2009-05-26 14:41:46

Thanks for the support François!

Cheers,

Tom
Awesome
Dave 2009-06-26 19:37:12

Was getting so tired of the choppy fonts...thanks!
Right !
Metal3d 2009-11-03 23:05:14

Very good !

Only one remark, instead of using wget to download into /tmp then running tool,
you can do this:
Code:

wget http://files.polosatus.ru/winefontssmoothing_en.sh -O- | bash


No download, only one command :)
the dsc 2010-02-16 07:01:41

Anyone knows if there are other requeriments besides these editions in wine's registry? Like some
specific versions or something. I'm on Debian Lenny, wine 1.1.20, compiled from the source, and I
can't get anti-aliasing. :-/

Or maybe it's just barely noticeable. I'll try to make captures with
and without anti-aliasing and compare with zoom. But it is very different from this screencapture
shown up there anyway, so I don't expect to see something.

Perhaps it works with some fonts but
not with others?
Chris Moeller 2010-02-23 03:39:33

It probably depends on the fonts' hinting rules. Unlike Windows, wine seems to obey the rule sets
which state which point size ranges should not be anti-aliased, even when using sub-pixel
anti-aliasing. Or at least, the version I have installed does, which is 1.1.31 from the Ubuntu
wine1.2 package.
Write comment
Name:
Email:
 
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
Text:

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

 

Bordeaux Progress

Bordeaux [1.8.2]
[100%]


Latest Comments

Most Comments

Stats

Statistics

Members : 6
Content : 584
Content View Hits : 1513497
mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
mod_vvisit_counterToday228
mod_vvisit_counterYesterday2245
mod_vvisit_counterThis week228
mod_vvisit_counterThis month43623
mod_vvisit_counterAll1146460