FedoraForum.org - Fedora Support Forums and Community
Page 1 of 6 123 ... LastLast
Results 1 to 15 of 85
  1. #1
    lmo Guest

    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 03:57 PM. Reason: Added some F7 notes as post 2

  2. #2
    lmo Guest
    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 Images Attached Images
    Last edited by lmo; 22nd December 2007 at 07:12 PM.

  3. #3
    lmo Guest
    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 Images Attached Images
    Last edited by lmo; 29th December 2007 at 12:33 AM.

  4. #4
    pentagram Guest
    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 01:36 PM.

  5. #5
    lmo Guest
    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 04:32 PM.

  6. #6
    pentagram Guest
    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

  7. #7
    lmo Guest
    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.

  8. #8
    leigh123linux Guest
    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

  9. #9
    Join Date
    Nov 2004
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  10. #10
    leigh123linux Guest
    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

  11. #11
    leigh123linux Guest
    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
    Last edited by leigh123linux; 5th June 2008 at 11:53 AM. Reason: Patched rpm's

  12. #12
    Join Date
    Nov 2004
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok i've rebuilt the packages, and i've got the following;

    Code:
    ls rpmbuild/RPMS/x86_64/
    cairo-1.6.4-1.fc9.x86_64.rpm
    cairo-debuginfo-1.6.4-1.fc9.x86_64.rpm
    cairo-devel-1.6.4-1.fc9.x86_64.rpm
    freetype-2.3.5-4.fc9.x86_64.rpm
    freetype-debuginfo-2.3.5-4.fc9.x86_64.rpm
    freetype-demos-2.3.5-4.fc9.x86_64.rpm
    freetype-devel-2.3.5-4.fc9.x86_64.rpm
    libXft-2.1.12-5.fc9.x86_64.rpm
    libXft-debuginfo-2.1.12-5.fc9.x86_64.rpm
    libXft-devel-2.1.12-5.fc9.x86_64.rpm
    Do i need to force the installation of the rpms? When I compiled freetype manually I remember doing so i.e.,

    Code:
    su -c 'rpm -Uvh --force /home/usernmae/rpmbuild/RPMS/x86_64/freetype-2.3.5-4.fc9.x86_64.rpm'
    Thanks for the patches
    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

  13. #13
    Join Date
    Jun 2005
    Location
    Westminster, Colorado
    Posts
    2,306
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not just install freetype-freeworld from livna? Does this procedure give different results? See the last paragraph of this:
    Code:
    ebrunsonlx(~)$ rpm -qi freetype-freeworld
    Name        : freetype-freeworld           Relocations: (not relocatable)
    Version     : 2.3.5                             Vendor: rpm.livna.org
    Release     : 3.lvn8                        Build Date: Tue 18 Sep 2007 09:28:30 AM MDT
    Install Date: Mon 02 Jun 2008 05:31:33 PM MDT      Build Host: plague-builder.livna.org
    Group       : System Environment/Libraries   Source RPM: freetype-freeworld-2.3.5-3.lvn8.src.rpm
    Size        : 685309                           License: FTL or GPLv2+
    Signature   : DSA/SHA1, Sat 22 Sep 2007 09:23:19 AM MDT, Key ID 71295441a109b1ec
    Packager    : rpm.livna.org <http://bugzilla.livna.org>
    URL         : http://www.freetype.org
    Summary     : A free and portable font rendering engine
    Description :
    The FreeType engine is a free and portable font rendering
    engine, developed to provide advanced font support for a variety of
    platforms and environments. FreeType is a library which can open and
    manages font files as well as efficiently load, hint and render
    individual glyphs. FreeType is not a font server or a complete
    text-rendering library.
    
    This version is compiled with the patented bytecode interpreter and subpixel
    rendering enabled. It transparently overrides the system library using
    ld.so.conf.d.
    Registered Linux User #4837
    411th in line to get sued by Micro$oft
    Basically, to learn Unix you learn to understand and apply a small set of key ideas and achieve expertise by expanding both the set of ideas and your ability to apply them - Paul Murphy

  14. #14
    leigh123linux Guest
    Quote Originally Posted by mohbana
    Ok i've rebuilt the packages, and i've got the following;

    Code:
    ls rpmbuild/RPMS/x86_64/
    cairo-1.6.4-1.fc9.x86_64.rpm
    cairo-debuginfo-1.6.4-1.fc9.x86_64.rpm
    cairo-devel-1.6.4-1.fc9.x86_64.rpm
    freetype-2.3.5-4.fc9.x86_64.rpm
    freetype-debuginfo-2.3.5-4.fc9.x86_64.rpm
    freetype-demos-2.3.5-4.fc9.x86_64.rpm
    freetype-devel-2.3.5-4.fc9.x86_64.rpm
    libXft-2.1.12-5.fc9.x86_64.rpm
    libXft-debuginfo-2.1.12-5.fc9.x86_64.rpm
    libXft-devel-2.1.12-5.fc9.x86_64.rpm
    Do i need to force the installation of the rpms? When I compiled freetype manually I remember doing so i.e.,

    Code:
    su -c 'rpm -Uvh --force /home/usernmae/rpmbuild/RPMS/x86_64/freetype-2.3.5-4.fc9.x86_64.rpm'
    Thanks for the patches

    I would use the replace commands ( you may have some i386 packages installed , I have linked some prebuilt patched rpm's if needed )

    Code:
    su -c 'rpm -Uvh --replacepkgs --replacefiles  /home/usernmae/rpmbuild/RPMS/x86_64/freetype-2.3.5-4.fc9.x86_64.rpm'


    i386

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


    Code:
    [leigh@localhost ~]$ rpm -qa |grep freetype
    freetype-2.3.5-4.fc9.x86_64
    freetype-devel-2.3.5-4.fc9.x86_64
    freetype-2.3.5-4.fc9.i386
    [leigh@localhost ~]$ rpm -qa |grep libXft
    libXft-2.1.12-5.fc9.i386
    libXft-2.1.12-5.fc9.x86_64
    libXft-devel-2.1.12-5.fc9.x86_64
    [leigh@localhost ~]$ rpm -qa |grep cairo
    cairomm-1.5.0-1.fc9.x86_64
    cairo-dock-1.5.6-1.date20080528.fc9.x86_64
    cairo-1.6.4-1.fc9.i386
    cairo-dock-plug-ins-1.5.6-1.date20080528.fc9.x86_64
    cairo-1.6.4-1.fc9.x86_64
    pycairo-1.4.12-3.fc9.x86_64
    cairo-dock-themes-1.5.6-1.date20080528.fc9.x86_64
    cairo-devel-1.6.4-1.fc9.x86_64
    cairomm-devel-1.5.0-1.fc9.x86_64
    pycairo-devel-1.4.12-3.fc9.x86_64
    [leigh@localhost ~]$

  15. #15
    leigh123linux Guest
    Quote Originally Posted by brunson
    Why not just install freetype-freeworld from livna? Does this procedure give different results? See the last paragraph of this:
    Code:
    ebrunsonlx(~)$ rpm -qi freetype-freeworld
    Name        : freetype-freeworld           Relocations: (not relocatable)
    Version     : 2.3.5                             Vendor: rpm.livna.org
    Release     : 3.lvn8                        Build Date: Tue 18 Sep 2007 09:28:30 AM MDT
    Install Date: Mon 02 Jun 2008 05:31:33 PM MDT      Build Host: plague-builder.livna.org
    Group       : System Environment/Libraries   Source RPM: freetype-freeworld-2.3.5-3.lvn8.src.rpm
    Size        : 685309                           License: FTL or GPLv2+
    Signature   : DSA/SHA1, Sat 22 Sep 2007 09:23:19 AM MDT, Key ID 71295441a109b1ec
    Packager    : rpm.livna.org <http://bugzilla.livna.org>
    URL         : http://www.freetype.org
    Summary     : A free and portable font rendering engine
    Description :
    The FreeType engine is a free and portable font rendering
    engine, developed to provide advanced font support for a variety of
    platforms and environments. FreeType is a library which can open and
    manages font files as well as efficiently load, hint and render
    individual glyphs. FreeType is not a font server or a complete
    text-rendering library.
    
    This version is compiled with the patented bytecode interpreter and subpixel
    rendering enabled. It transparently overrides the system library using
    ld.so.conf.d.

    This package only provides 2 patches to freetype i.e patented bytecode interpreter and subpixel rendering .

    I combined the patches in post #1 as well ( it seems to work well here with my LCD ) .

    http://quanli.googlepages.com/davidt...esfordebiansid

Page 1 of 6 123 ... LastLast

Similar Threads

  1. Replies: 10
    Last Post: 23rd May 2014, 06:36 AM
  2. Most common Linux fonts?
    By DennyCrane in forum Linux Chat
    Replies: 8
    Last Post: 5th September 2008, 02:36 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •