Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (No Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (No Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 19th December 2007, 05:40 PM
lmo Offline
Registered User
 
Join Date: Mar 2007
Posts: 1,047
Getting cleartype -like fonts on linux

To those not wishing to do command line style hacking with its inherent risks and frustrations (and possible damages) should stop reading now, and just be happy with the fonts as you have them. This is a lot of trouble, so if you aren't ready for that, don't try it.

Unfortunately, I could not find information about doing this on Fedoras later than 6 except to just --force it in there, and it worked for me on FC6, F7, and CENTOS5.

David Tuner of freetype created some excellent patches which provide superior subpixel redering which very much improves the appearance of fonts. At one time, these patches were readily available and could be applied to the packages of the day. Since then, David Turner made the decision that these patches could infringe on patents and so since then, these patches have not been maintained and upgraded to the latest packages. The freetype portion of the patches does exist in current freetype packages, but is shipped disabled. Unfortunately, there are 2 other areas where patches are needed and these are not maintained: cairo and Xft. Without the cairo and Xft patches, I could not get acceptable subpixel rendering. Searching for the magic lamp, led to this howto, as I might want to implement this again, and I am certain that I will loose the notes. As every howto on subpixel rendering I found was wanting, this one probably is also.

How to create rpmbuild directory

Google search for "david turner subpixel"
Get the patches
http://quanli.googlepages.com/davidt...esfordebiansid
freetype-2.2.1-subpixel-disable-quantization.diff
libcairo-1.2.4-lcd-cleartype-like.diff
libXft-2.1.8.2-lcd-cleartype-like.diff
copy/move to ~/rpmbuild/SOURCES
NOTE:
(see: http://www.danns.co.uk/node/196
for an excellent description and review of the subpixel patches)

Get the SRPMS
http://download.fedora.redhat.com/pub/fedora
Nav to your SRPMS
FC6
linux -> core -> 6 -> source -> SRPMS
cairo-1.2.4-1.fc6.src.rpm
freetype-2.2.1-10.fc6.src.rpm
libXft-2.1.10-1.1.src.rpm
copy/move to ~/rpmbuild/SRPMS
NOTE:
(The patch libXft-2.1.8.2-lcd-cleartype-like.diff
applies successfully to libXft-2.1.10-1.1.src.rpm
but not to later ones.)
F7
N/A - use FC6 - naturally, this will break if it gets updated and may break something
Testing some noted for Fedora 7 in Post #2
F8
N/A - use FC6 - naturally, this will break if it gets updated and may break something
CENTOS5
http://mirror.centos.org/centos/5/os/SRPMS/
cairo-1.2.4-2.el5.src.rpm
freetype-2.2.1-19.el5.src.rpm
libXft-2.1.10-1.1.src.rpm

Login as your regular user (not root)

SET UP THE SRPMS
rpm -i ~/rpmbuild/SRPMS/cairo-1.2.4-1.fc6.src.rpm
rpm -i ~/rpmbuild/SRPMS/libXft-2.1.10-1.1.src.rpm
rpm -i ~/rpmbuild/SRPMS/freetype-2.2.1-10.fc6.src.rpm

EDIT THE SPEC FILES TO APPLY THE PATCHES
NOTE: I tried to show in red what changes were made. Had to cut because post too long.
cairo.spec
Code:
...
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Patch0: libcairo-1.2.4-lcd-cleartype-like.diff

...

%prep
%setup -q

%patch0 -p1
%build

...
Note: Enabling bytecode interpreter not necessary, but fun to see windows fonts.
freetype.spec
Code:
# Disables patented bytecode interpreter.  Setting to 0 enables
# the bytecode interpreter.
%define without_bytecode_interpreter    0

...

Source1: freetype-doc-%{version}.tar.bz2
Source2: ft2demos-%{version}.tar.bz2

...

Patch0: freetype-2.2.1-subpixel-disable-quantization.diff
# Add -lm when linking X demos
Patch5: ft2demos-2.1.9-mathlib.patch
Patch20:  freetype-2.1.10-enable-ft2-bci.patch

...

%prep
%setup -q -b 1 -a 2

%patch0 -p1
pushd ft2demos-%{version}
%patch5 -p1 -b .mathlib
popd


...
libXft.spec
Code:
...
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Source0: ftp://ftp.x.org/pub/individual/lib/%{name}-%{version}.tar.bz2
Patch0: libxft-2.1.8.2-lcd-cleartype-like.diff

...

%prep
%setup -q

%patch0 -p1
# Disable static library creation by default.
%define with_static 0

...
BUILD THE RPMS
rpmbuild -bb ~/rpmbuild/SPECS/freetype.spec
rpmbuild -bb ~/rpmbuild/SPECS/libXft.spec
rpmbuild -bb ~/rpmbuild/SPECS/cairo.spec
NOTE:
(It failed unless you see the build end with:
+ exit 0
)

BACKUP PRIOR TO INSTALLING THE RPMS
NOTE:
(init 3 shuts down X11 gui
You must do this to remove some files
to avoid links pointing to the wrong versions.)
su -
init 3
console login: root
cd /usr/lib
mkdir BAK
cp -av lib{freetype,cairo,Xft}.* BAK/
rm -i lib{freetype,cairo,Xft}.*
(say y-yes to confirm each deletion.)
NOTE:
(It should delete
libcairo.so.2
libcairo.so.2.9.2
libfreetype.so.6
libfreetype.so.6.3.10
libXft.so.2
libXft.so.2.1.2
It may also delete
libcairo.so
libfreetype.so
libXft.so

INSTALL THE RPMS
console logoff (exit)
console login as your user
(As your user -- not root)
cd ~/rpmbuild/RPMS/i386
("su" -- not "su -")
su
rpm -ivh --force freetype-2.2.1-10.i386.rpm
rpm -ivh --force libXft-2.1.10-1.1.i386.rpm
rpm -ivh --force cairo-1.2.4-1.i386.rpm
NOTE: (rpm -Uvh will always failed with the devel installed, so I used rpm -ivh)

CONFIRM INSTALLATION
su
cd /usr/lib
ls -l lib{freetype,cairo,Xft).*
NOTE:
(These files should have today's date and a very recent time.)

BRING UP THE X11 GUI
init 5

SET FOR SUBPIXEL
XFCE4
Use antialiasing for fonts
Use hinting: full
Use subpixex hinting: RGB
GNOME
Subpixel smoothing (LCDs)
Subpixel order: RGB

CHECK
Distrowatch.com is a good test site, because of the lightly colored background. Fonts should look crisp with nearly impossible to notice color fringes.
LeMonde.fr is another good test site to compare with David Turner's screenshot.

IF EVERYTHING WENT WRONG, OR DO NOT LIKE IT
su
cd /usr/lib/BAK
cp -a * ../

I hope I didn't make too many mistakes, but it looks good on my system.

Last edited by lmo; 22nd December 2007 at 02:57 PM. Reason: Added some F7 notes as post 2
Reply With Quote
  #2  
Old 22nd December 2007, 02:44 PM
lmo Offline
Registered User
 
Join Date: Mar 2007
Posts: 1,047
Some notes I am testing for Fedora 7 ... and it seems to be working good.
A few variations from FC6 ...

I found it necessary to install freetype-devel before the cairo would build cleanly.
I rpm installed the freetype and freetype-devel that was built
from the rpmbuild before proceeding to the other rpmbuilds.
Maybe I could have 'yum install freetype-devel' if that would have worked.

http://download.fedora.redhat.com/pub/fedora/
NAV to linux -> updates -> 7 -> SRPMS
cairo-1.4.10-1.fc7.src.rpm
freetype-2.3.4-3.fc7.src.rpm
copy/move to ~/rpmbuild/SRPMS

http://download.fedora.redhat.com/pub/fedora/
NAV to linux -> releases -> 7 -> Everything -> source -> SRPMS
or
NAV to linux -> releases -> 7 -> Fedora -> source -> SRPMS
(Don't know the difference between Everything & Fedora -- I got from Everything)
libXft-2.1.12-1.fc7.src.rpm
copy/move to ~/rpmbuild/SRPMS

The source where I found the cairo-1.4.10 patch was
https://bugs.freedesktop.org/show_bug.cgi?id=10301
(I accepted invalid certificate site message)
cairo-1.4.10-lcd-filter-1.patch
Save it as cairo-1.4.10-lcd-filter-1.patch
copy/move to ~/rpmbuild/SOURCES/

cairo.spec
Code:
...
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Patch0: cairo-1.4.10-lcd-filter-1.patch

...

%prep
%setup -q

%patch0 -p1
%build

...
freetype.spec
Code:
# Disables patented bytecode interpreter.  Setting to 0 enables
# the bytecode interpreter.
%define without_bytecode_interpreter    0
%define without_subpixel_rendering      0

...

Source1: freetype-doc-%{version}.tar.bz2
Source2: ft2demos-%{version}.tar.bz2

...

Patch0: freetype-2.2.1-subpixel-disable-quantization.diff
# Add -lm when linking X demos
Patch5: ft2demos-2.1.9-mathlib.patch
Patch20:  freetype-2.1.10-enable-ft2-bci.patch
Patch21:  freetype-2.3.0-enable-spr.patch

...

%prep
%setup -q -b 1 -a 2

%patch0 -p1
pushd ft2demos-%{version}
%patch5 -p1 -b .mathlib
popd

%if ! %{without_bytecode_interpreter}
%patch20  -p1 -b .enable-ft2-bci
%endif

%if ! %{without_subpixel_rendering}
%patch21  -p1 -b .enable-spr
%endif

...
libXft.spec
(same as FC6)
Code:
...
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Source0: ftp://ftp.x.org/pub/individual/lib/%{name}-%{version}.tar.bz2
Patch0: libxft-2.1.8.2-lcd-cleartype-like.diff

...

%prep
%setup -q

%patch0 -p1
# Disable static library creation by default.
%define with_static 0

...
I think I can tell the difference between the beautiful rainbow fonts and without the rainbow.
stock (left) vs. patched to its right.
Attached Thumbnails
Click image for larger version

Name:	beautiful-rainbow.jpg
Views:	866
Size:	312.6 KB
ID:	14446   Click image for larger version

Name:	no-rainbow.jpg
Views:	846
Size:	292.7 KB
ID:	14447  

Last edited by lmo; 22nd December 2007 at 06:12 PM.
Reply With Quote
  #3  
Old 27th December 2007, 07:27 PM
lmo Offline
Registered User
 
Join Date: Mar 2007
Posts: 1,047
A note about wine and the bytecoder in freetype.
Enabling the bytecoder can, insome cases, change the way fonts look in wine.
This can be good or bad depending on the situation.
With the bytecoder enabled, I applied a hack patch to wine and got it to look like W2K.
Code:
*** dlls/winex11.drv/xrender.c.orig     2007-12-26 22:34:26.000000000 -0500
--- dlls/winex11.drv/xrender.c  2007-12-26 23:00:09.000000000 -0500
***************
*** 475,481 ****
              hinter = status.wFlags & WINE_TT_HINTER_ENABLED;
          }
          if(!hinter || !get_gasp_flags(physDev, &flags) || flags & GASP_DOGRAY)
!             entry->aa_default = AA_Grey;
          else
              entry->aa_default = AA_None;
      }
--- 475,481 ----
              hinter = status.wFlags & WINE_TT_HINTER_ENABLED;
          }
          if(!hinter || !get_gasp_flags(physDev, &flags) || flags & GASP_DOGRAY)
!             entry->aa_default = AA_None;
          else
              entry->aa_default = AA_None;
      }
Experimenting with these settings achieved the same effect
Code:
 [Software\\Wine\\X11 Driver] 1198884123
"ClientSideAntiAliasWithCore"="N"
"ClientSideAntiAliasWithRender"="N"
"ClientSideWithCore"="N"
"ClientSideWithRender"="Y"
Attached Thumbnails
Click image for larger version

Name:	wine-bytecode.jpg
Views:	602
Size:	128.5 KB
ID:	14506  

Last edited by lmo; 28th December 2007 at 11:33 PM.
Reply With Quote
  #4  
Old 9th January 2008, 12:34 PM
pentagram Offline
Registered User
 
Join Date: Jan 2008
Posts: 2
Hello, Imo!

Good thing you included CentOS in the how-to.
I did all the patching, removing, installing from your howto on CentOS 5.1... All worked well, no errors.
The fonts are shaped ok, but I have one issue: fonts are a little bit bold and not very clear.
[I use Tahoma 8 for system font]
At small sizes this "bolness" is worst, not to mention that bold fonts are bolder.
I really don't know what to do next. I tried to mess with the gnome font settings with no better result.
At home I have Gentoo, it was really easy to enable bytecode and without any manual patching I got nice fonts.

I need your opinion, should I try not to patch freetype, cairo and libXft
AND
just rebuild freetype with bytecode enabled ?

(setting
Code:
%define without_bytecode_interpreter    0
in
Code:
include/freetype/config/ftoption.h
)

Thanks in advance.

Last edited by pentagram; 9th January 2008 at 12:36 PM.
Reply With Quote
  #5  
Old 9th January 2008, 03:09 PM
lmo Offline
Registered User
 
Join Date: Mar 2007
Posts: 1,047
Quote:
I need your opinion, should I try not to patch freetype, cairo and libXft
AND
just rebuild freetype with bytecode enabled ?
This howto was aimed at making an improvement to the subpixel rendering.
Without the patches to cairo, libXft, and freetype, there is no improvement in the subpixel rendering.
Not everyone wants the little bits of color in the fonts which is what subpixel rendering is.
If you don't want to use the little bits of color in the fonts, then there isn't any need to patch the cairo and libXft, or to turn on the subpixel / LCD smoothing.
To me, the patches and the subpixel smoothing looks a little bit better -- but it is not the ultimate of perfection.

The bytecode interpreter is a separate issue from subpixel hinting although both issues are under question of patents.

My opinion of whether to build freetype with bytecode enabled is that it depends on whether you want to use the feature that the bytecode interpreter provides.
The bytecode interpreter enables the capability for "winfonts" to look like fonts in Windows 2000.
Not everyone wants those fonts to look that way.

Generally, I don't like the fonts to look like Windows 2000.
For the "winfonts" I am mostly NOT USING the capabilities of the bytecode interpreter.
However, I don't think the bold versions of those fonts look the way I would like.
So, I experiment with one of two alterations in the "fonts config"


1 - Bold with bytecoder hinting (Windows 2000 look -- not for me)
Code:
  <!-- Some adjustments for me -->
  <match target="pattern" name="weight">
    <test qual="any" name="family">
      <string>Tahoma</string>
      <string>Verdana</string>
    </test>
    <test name="weight" compare="more_eq">
      <int>180</int>
    </test>
    <!-- turn on? patented byte code interpreter hinting for these bold-->
    <edit mode="assign" name="autohint">
      <bool>false</bool>
    </edit>
    <edit mode="assign" name="antialias">
      <bool>false</bool>
    </edit>
  </match>
2 - Bold with bytecoder but not hinted (I like this one)
Code:
 <!-- Some adjustments for me -->
  <match target="pattern" name="weight">
    <test qual="any" name="family">
      <string>Tahoma</string>
      <string>Verdana</string>
    </test>
    <test name="weight" compare="more_eq">
      <int>180</int>
    </test>
    <!-- turn on? patented byte code interpreter hinting for these bold-->
    <edit mode="assign" name="autohint">
      <bool>false</bool>
    </edit>
    <edit mode="assign" name="hintstyle">
      <const>none</const>
    </edit>
  </match>
Just FYI, this is a file I called 98-msfonts.conf that I put in the directory /etc/fonts/conf.d on fedora. Other distros may have different location for this "local fonts conf". This file could also be used in the homedir as the ~/.fonts.conf file
Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="pattern" name="family">
    <test qual="any" name="family">
      <string>Arial</string>
      <string>Verdana</string>
      <string>Andale Mono</string>
      <string>Comic Sans MS</string>
      <string>Courier New</string>
      <string>Georgia</string>
      <string>Impact</string>
      <string>Microsoft Sans Serif</string>
      <string>Tahoma</string>
      <string>Times New Roman</string>
      <string>Trebuchet MS</string>
      <string>Webdings</string>
    </test>
    <!-- turn off? patented byte code interpreter hinting -->
    <edit mode="assign" name="autohint">
      <bool>true</bool>
    </edit>
  </match>
  <!-- Some adjustments for me -->
  <match target="pattern" name="weight">
    <test qual="any" name="family">
      <string>Tahoma</string>
      <string>Verdana</string>
    </test>
    <test name="weight" compare="more_eq">
      <int>180</int>
    </test>
    <!-- turn on? patented byte code interpreter hinting for these bold-->
    <edit mode="assign" name="autohint">
      <bool>false</bool>
    </edit>
    <edit mode="assign" name="hintstyle">
      <const>none</const>
    </edit>
  </match>
  <!-- Nimbus Roman No9 L is just what I like for monospace in firefox -->
  <!-- and to me, looks better at hintslight -->
  <match target="pattern" name="family">
    <test qual="any" name="family">
      <string>Nimbus Roman No9 L</string>
    </test>
    <edit mode="assign" name="hintstyle">
      <const>hintslight</const>
    </edit>
  </match>
</fontconfig>
New info:
It has come to my attention that later freetype can be used by activation (uncommenting) 2 lines in

include/freetype/config/ftoption.h

change
Code:
/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
to
Code:
#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
change
Code:
/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
to
Code:
#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
This is also accomplished in an rpm spec file with zeros instead of ones in lines like this
Code:
# Disable patented bytecode interpreter and patented subpixel rendering.
# Setting to 0 enables them.
%define without_bytecode_interpreter    0
%define without_subpixel_rendering      0

Last edited by lmo; 9th January 2008 at 03:32 PM.
Reply With Quote
  #6  
Old 10th January 2008, 10:06 AM
pentagram Offline
Registered User
 
Join Date: Jan 2008
Posts: 2
Thanks for that!
Your bold settings for Tahoma and Verdana are really ok.

An other question would be: what are your suggestions on DPI settings for screen?

I read in many forums that the DPI is important. Here I have a 17" lcd that can do 1280x1024 (4:3), and from what I learned, the DPI would be 96.
But at home I have a 17" wide LCD with 1680x1050. Is it correct to set DPI to 116?
(116 is the value from various measurements ... )

...

Best regards,
Pentagram
Reply With Quote
  #7  
Old 10th January 2008, 03:42 PM
lmo Offline
Registered User
 
Join Date: Mar 2007
Posts: 1,047
DPI is another matter, but the Mozillas et. al. seem fixated on 96 and many people just say "96".
I am not convinced that there is such a thing as "incorrect DPI" if it works satisfactorily.
Changing screen resolution can result in different computed DPI.
Under some conditions, changing screen resolution makes Mozillas' font sizes go haywire.
In some screen resolutions, fonts may look more blurry than others.
In some screen resolutions, fonts are way too small for me.
My goal is to get fonts that are big enough to read comfortably without being too blurry.

2 commands show DPI as it will be perceived by various applications
Code:
xrdb -q
xdpyinfo | grep resolution
Currently, I am setting the desktop environment's DPI to 96.
Currently, I can read screen resolution of 832x624 without glasses, while sitting back in the chair.
On my 19" LCD, it is the least blurry size that is large enough without odd side effects.

I use some computation such as this script which I called DPI_PLAY to try to find a DisplaySize parameter for xorg.conf that will result in 96 DPI for the screen resolution I currently want to use
Code:
# ThisScript Horizontal Verttical Dpi
# $0 $1 $2 $3
# $0 h v d
#
# Example
# sh DPI_PLAY 832 624 96
#
# Example command line parameters
# 832 624 96
#
# Example output
# Put this under Section "Display" in xorg.conf
#    DisplaySize 219 165 # 832x624@96
#    ... actual dimensions were adjusted to 221 164 to get 96 DPI
#
# Display resolution
# h v #example: 832 624
#
# Desired DPI
# d #example: 96
#
h=$1
v=$2
d=$3
dm1=$(echo "scale=2;$h/$d*25.4" | bc)
dm2=$(echo "scale=2;$v/$d*25.4" | bc)
echo 'Put this under Section "Display" in xorg.conf'
echo "    DisplaySize ${dm1%.*} ${dm2%.*} # ${h}x${v}@${d}"
echo
echo " check with 'xdpyinfo | grep resolution'"
echo
echo " If inexact, adjust the numbers slightly and restart X"
echo " Then check again until exact"
echo
s1=$(echo "scale=2;${h}/${d}" | bc)
s2=$(echo "scale=2;${v}/${d}" | bc)
echo " Numbers claim a Screen Measurement Horiz x Vert (inches) = $s1 x $s2"
echo " but don't worry about that."
I am not conviced of any necessity to try adjusting xorg.conf if everything seems to be working satisfactorily.
Only if there is a problem, or if someone wants to experiment.
Reply With Quote
  #8  
Old 10th January 2008, 03:59 PM
leigh123linux's Avatar
leigh123linux Offline
Retired Administrator
 
Join Date: Oct 2006
Posts: 21,509
Quote:
Originally Posted by lmo
To those not wishing to do command line style hacking with its inherent risks and frustrations (and possible damages) should stop reading now, and just be happy with the fonts as you have them. This is a lot of trouble, so if you aren't ready for that, don't try it.

Unfortunately, I could not find information about doing this on Fedoras later than 6 except to just --force it in there, and it worked for me on FC6, F7, and CENTOS5.

David Tuner of freetype created some excellent patches which provide superior subpixel redering which very much improves the appearance of fonts. At one time, these patches were readily available and could be applied to the packages of the day. Since then, David Turner made the decision that these patches could infringe on patents and so since then, these patches have not been maintained and upgraded to the latest packages. The freetype portion of the patches does exist in current freetype packages, but is shipped disabled. Unfortunately, there are 2 other areas where patches are needed and these are not maintained: cairo and Xft. Without the cairo and Xft patches, I could not get acceptable subpixel rendering. Searching for the magic lamp, led to this howto, as I might want to implement this again, and I am certain that I will loose the notes. As every howto on subpixel rendering I found was wanting, this one probably is also.

How to create rpmbuild directory

Google search for "david turner subpixel"
Get the patches
http://quanli.googlepages.com/davidt...esfordebiansid
freetype-2.2.1-subpixel-disable-quantization.diff
libcairo-1.2.4-lcd-cleartype-like.diff
libXft-2.1.8.2-lcd-cleartype-like.diff
copy/move to ~/rpmbuild/SOURCES
NOTE:
(see: http://www.danns.co.uk/node/196
for an excellent description and review of the subpixel patches)

Get the SRPMS
http://download.fedora.redhat.com/pub/fedora
Nav to your SRPMS
FC6
linux -> core -> 6 -> source -> SRPMS
cairo-1.2.4-1.fc6.src.rpm
freetype-2.2.1-10.fc6.src.rpm
libXft-2.1.10-1.1.src.rpm
copy/move to ~/rpmbuild/SRPMS
NOTE:
(The patch libXft-2.1.8.2-lcd-cleartype-like.diff
applies successfully to libXft-2.1.10-1.1.src.rpm
but not to later ones.)
F7
N/A - use FC6 - naturally, this will break if it gets updated and may break something
Testing some noted for Fedora 7 in Post #2
F8
N/A - use FC6 - naturally, this will break if it gets updated and may break something
CENTOS5
http://mirror.centos.org/centos/5/os/SRPMS/
cairo-1.2.4-2.el5.src.rpm
freetype-2.2.1-19.el5.src.rpm
libXft-2.1.10-1.1.src.rpm

Login as your regular user (not root)

SET UP THE SRPMS
rpm -i ~/rpmbuild/SRPMS/cairo-1.2.4-1.fc6.src.rpm
rpm -i ~/rpmbuild/SRPMS/libXft-2.1.10-1.1.src.rpm
rpm -i ~/rpmbuild/SRPMS/freetype-2.2.1-10.fc6.src.rpm

EDIT THE SPEC FILES TO APPLY THE PATCHES
NOTE: I tried to show in red what changes were made. Had to cut because post too long.
cairo.spec
Code:
...
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Patch0: libcairo-1.2.4-lcd-cleartype-like.diff

...

%prep
%setup -q

%patch0 -p1
%build

...
Note: Enabling bytecode interpreter not necessary, but fun to see windows fonts.
freetype.spec
Code:
# Disables patented bytecode interpreter.  Setting to 0 enables
# the bytecode interpreter.
%define without_bytecode_interpreter    0

...

Source1: freetype-doc-%{version}.tar.bz2
Source2: ft2demos-%{version}.tar.bz2

...

Patch0: freetype-2.2.1-subpixel-disable-quantization.diff
# Add -lm when linking X demos
Patch5: ft2demos-2.1.9-mathlib.patch
Patch20:  freetype-2.1.10-enable-ft2-bci.patch

...

%prep
%setup -q -b 1 -a 2

%patch0 -p1
pushd ft2demos-%{version}
%patch5 -p1 -b .mathlib
popd


...
libXft.spec
Code:
...
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Source0: ftp://ftp.x.org/pub/individual/lib/%{name}-%{version}.tar.bz2
Patch0: libxft-2.1.8.2-lcd-cleartype-like.diff

...

%prep
%setup -q

%patch0 -p1
# Disable static library creation by default.
%define with_static 0

...
BUILD THE RPMS
rpmbuild -bb ~/rpmbuild/SPECS/freetype.spec
rpmbuild -bb ~/rpmbuild/SPECS/libXft.spec
rpmbuild -bb ~/rpmbuild/SPECS/cairo.spec
NOTE:
(It failed unless you see the build end with:
+ exit 0
)

BACKUP PRIOR TO INSTALLING THE RPMS
NOTE:
(init 3 shuts down X11 gui
You must do this to remove some files
to avoid links pointing to the wrong versions.)
su -
init 3
console login: root
cd /usr/lib
mkdir BAK
cp -av lib{freetype,cairo,Xft}.* BAK/
rm -i lib{freetype,cairo,Xft}.*
(say y-yes to confirm each deletion.)
NOTE:
(It should delete
libcairo.so.2
libcairo.so.2.9.2
libfreetype.so.6
libfreetype.so.6.3.10
libXft.so.2
libXft.so.2.1.2
It may also delete
libcairo.so
libfreetype.so
libXft.so

INSTALL THE RPMS
console logoff (exit)
console login as your user
(As your user -- not root)
cd ~/rpmbuild/RPMS/i386
("su" -- not "su -")
su
rpm -ivh --force freetype-2.2.1-10.i386.rpm
rpm -ivh --force libXft-2.1.10-1.1.i386.rpm
rpm -ivh --force cairo-1.2.4-1.i386.rpm
NOTE: (rpm -Uvh will always failed with the devel installed, so I used rpm -ivh)

CONFIRM INSTALLATION
su
cd /usr/lib
ls -l lib{freetype,cairo,Xft).*
NOTE:
(These files should have today's date and a very recent time.)

BRING UP THE X11 GUI
init 5

SET FOR SUBPIXEL
XFCE4
Use antialiasing for fonts
Use hinting: full
Use subpixex hinting: RGB
GNOME
Subpixel smoothing (LCDs)
Subpixel order: RGB

CHECK
Distrowatch.com is a good test site, because of the lightly colored background. Fonts should look crisp with nearly impossible to notice color fringes.
LeMonde.fr is another good test site to compare with David Turner's screenshot.

IF EVERYTHING WENT WRONG, OR DO NOT LIKE IT
su
cd /usr/lib/BAK
cp -a * ../

I hope I didn't make too many mistakes, but it looks good on my system.
Your How to create rpmbuild directory is outdated and over complicated


Try
Code:
su
yum install rpmdevtools
Then as a normal non root user

Code:
rpmdev-setuptree
__________________
My Hardware
- CPU: AMD Phenom II X6 Hex Core 1055T 95W Edition @3.5Ghz
- Motherboard: Gigabyte GA-880GM-UD2H
- Cooler: Corsair H50 CPU Cooler
- RAM: Corsair Dominator 8GB (4x2GB) DDR3 1600MHz
- Graphics: Gigabyte GeForce GTS 450 OC 1024MB GDDR5
Reply With Quote
  #9  
Old 4th June 2008, 11:02 AM
mohbana Offline
Registered User
 
Join Date: Nov 2004
Posts: 110
I'd really like to the get the *same* font settings as Ubuntu but i can't risk breaking the system, i'm using Fedora 9, i'm willing to try out an easier tutorial.
__________________
Samsung SpinPoint 500GB & 320GB SATA-II, Corsair HX 520W, Corsair 4GB, Quad Q6600 SLACR, EVGA 8800 GTS 512MB, Thermalright Ultra-120 Extreme, Samsung SH-S203NRSMN DVD±RW SATA, Abit IP35, Antec Solo, Dell 22 inch (SP2208WFP), Logitech MX518 & Desktop Wave, Auzen X-Plosion
Reply With Quote
  #10  
Old 4th June 2008, 11:31 AM
leigh123linux's Avatar
leigh123linux Offline
Retired Administrator
 
Join Date: Oct 2006
Posts: 21,509
Quote:
Originally Posted by mohbana
I'd really like to the get the *same* font settings as Ubuntu but i can't risk breaking the system, i'm using Fedora 9, i'm willing to try out an easier tutorial.

Try


Code:
su
yum install rpmdevtools
yum install yum-utils

Then as a normal non root user ( you may need to install some build deps )


Code:
rpmdev-setuptree
yumdownloader --source freetype
rpmbuild --rebuild  --with bytecode_interpreter --with subpixel_rendering freetype-2.3.5-4.fc9.src.rpm
Then install the rpm

http://forums.fedoraforum.org/forum/...highlight=mock
__________________
My Hardware
- CPU: AMD Phenom II X6 Hex Core 1055T 95W Edition @3.5Ghz
- Motherboard: Gigabyte GA-880GM-UD2H
- Cooler: Corsair H50 CPU Cooler
- RAM: Corsair Dominator 8GB (4x2GB) DDR3 1600MHz
- Graphics: Gigabyte GeForce GTS 450 OC 1024MB GDDR5
Reply With Quote
  #11  
Old 5th June 2008, 09:39 AM
brebs's Avatar
brebs Offline
Banned
 
Join Date: Apr 2008
Posts: 558
Quote:
Originally Posted by mohbana
I'd really like to the get the *same* font settings as Ubuntu
Use these RPMs which incorporate Ubuntu's patches.
Reply With Quote
  #12  
Old 5th June 2008, 10:10 AM
leigh123linux's Avatar
leigh123linux Offline
Retired Administrator
 
Join Date: Oct 2006
Posts: 21,509
Quote:
Originally Posted by brebs
Use these RPMs which incorporate Ubuntu's patches.
So do my rpm's

http://quanli.googlepages.com/davidt...esfordebiansid
__________________
My Hardware
- CPU: AMD Phenom II X6 Hex Core 1055T 95W Edition @3.5Ghz
- Motherboard: Gigabyte GA-880GM-UD2H
- Cooler: Corsair H50 CPU Cooler
- RAM: Corsair Dominator 8GB (4x2GB) DDR3 1600MHz
- Graphics: Gigabyte GeForce GTS 450 OC 1024MB GDDR5

Last edited by leigh123linux; 5th June 2008 at 10:22 AM.
Reply With Quote
  #13  
Old 5th June 2008, 10:43 AM
brebs's Avatar
brebs Offline
Banned
 
Join Date: Apr 2008
Posts: 558
Where's your fontconfig patch then?

As in my 03_lcd_filter_freedesktop_bug13566_fedora.patch in fontconfig-2.5.0-2.fc9.src.rpm
Code:
#define FC_LCD_FILTER_NONE    0
#define FC_LCD_FILTER_DEFAULT 1
#define FC_LCD_FILTER_LIGHT   2
#define FC_LCD_FILTER_LEGACY  3
Ubuntu's patches are best IMO, giving the choice of rendering methods:

lcdfilterdefault, lcdfilterlight, lcdfilterlegacy

There's some variations of the algorithms floating around, also, to give slightly different results. This is because different algorithms look better on different monitors, to different people's eyes.
Reply With Quote
  #14  
Old 5th June 2008, 11:13 AM
leigh123linux's Avatar
leigh123linux Offline
Retired Administrator
 
Join Date: Oct 2006
Posts: 21,509
Quote:
Originally Posted by brebs
Where's your fontconfig patch then?

As in my 03_lcd_filter_freedesktop_bug13566_fedora.patch in fontconfig-2.5.0-2.fc9.src.rpm
Code:
#define FC_LCD_FILTER_NONE    0
#define FC_LCD_FILTER_DEFAULT 1
#define FC_LCD_FILTER_LIGHT   2
#define FC_LCD_FILTER_LEGACY  3
Ubuntu's patches are best IMO, giving the choice of rendering methods:

lcdfilterdefault, lcdfilterlight, lcdfilterlegacy

There's some variations of the algorithms floating around, also, to give slightly different results. This is because different algorithms look better on different monitors, to different people's eyes.
I didn't know about the fontconfig patch ( thanks for pointing it out )
I see you have the same build error .
I prefer not to ignore the RPATH errors and build the package using mock instead.

Code:
* - to ignore standard and empty RPATHs, execute 'rpmbuild' like
*   $ QA_RPATHS=$[ 0x0001|0x0010 ] rpmbuild my-package.src.rpm
* - to check existing files, set $RPM_BUILD_ROOT and execute check-rpaths like
*   $ RPM_BUILD_ROOT=<top-dir> /usr/lib/rpm/check-rpaths
*  
*******************************************************************************
ERROR   0001: file '/usr/bin/fc-list' contains a standard rpath '/usr/lib64' in [/usr/lib64]
ERROR   0001: file '/usr/bin/fc-cat' contains a standard rpath '/usr/lib64' in [/usr/lib64]
ERROR   0001: file '/usr/bin/fc-cache' contains a standard rpath '/usr/lib64' in [/usr/lib64]
ERROR   0001: file '/usr/bin/fc-match' contains a standard rpath '/usr/lib64' in [/usr/lib64]
error: Bad exit status from /var/tmp/rpm-tmp.77524 (%install)
__________________
My Hardware
- CPU: AMD Phenom II X6 Hex Core 1055T 95W Edition @3.5Ghz
- Motherboard: Gigabyte GA-880GM-UD2H
- Cooler: Corsair H50 CPU Cooler
- RAM: Corsair Dominator 8GB (4x2GB) DDR3 1600MHz
- Graphics: Gigabyte GeForce GTS 450 OC 1024MB GDDR5

Last edited by leigh123linux; 5th June 2008 at 11:44 AM.
Reply With Quote
  #15  
Old 4th June 2008, 01:01 PM
leigh123linux's Avatar
leigh123linux Offline
Retired Administrator
 
Join Date: Oct 2006
Posts: 21,509
Or you could try these patched F9 SRPM's

http://www.4shared.com/file/50079737...e/srpmtar.html

I have added the pacthes to the SRPM's in a disabled state , to build with the patches use the commands below !


Code:
rpmbuild --rebuild  --with bytecode_interpreter --with subpixel_rendering --with subpixel_disable_quantization  freetype-2.3.5-4.fc9.src.rpm


rpmbuild --rebuild  --with lcd_cleartype_like cairo-1.6.4-1.fc9.src.rpm


rpmbuild --rebuild  --with lcd_cleartype_like libXft-2.1.12-5.fc9.src.rpm

Prebuilt rpm's ( includes patched fontconfig )

i386

http://www.4shared.com/file/50208706...__i386tar.html


x86_64

http://www.4shared.com/file/50208419...x86_64tar.html
__________________
My Hardware
- CPU: AMD Phenom II X6 Hex Core 1055T 95W Edition @3.5Ghz
- Motherboard: Gigabyte GA-880GM-UD2H
- Cooler: Corsair H50 CPU Cooler
- RAM: Corsair Dominator 8GB (4x2GB) DDR3 1600MHz
- Graphics: Gigabyte GeForce GTS 450 OC 1024MB GDDR5

Last edited by leigh123linux; 5th June 2008 at 11:53 AM. Reason: Patched rpm's
Reply With Quote
Reply

Tags
cleartypelike, fonts, linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Most common Linux fonts? DennyCrane Linux Chat 8 5th September 2008 02:36 PM
Can't Get Good Hinting on Calibri (or other MS Cleartype fonts) twilightomni Using Fedora 9 13th July 2008 01:06 AM


Current GMT-time: 05:25 (Tuesday, 18-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat