Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26

Thread: HOWTO: Improve font rendering; premade debs and instructions to patch yourself

  1. #11
    Join Date
    Jul 2006
    Location
    Germany
    Beans
    5
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: HOWTO: Improve font rendering; premade debs and instructions to patch yourself

    Quote Originally Posted by giuliastro View Post
    Also "sudo dpkg-reconfigure fontconfig" doesn't show any options anymore. Any ideas?
    dpkg-reconfigure fontconfig-config
    then
    dpkg-reconfigure fontconfig
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Bildschirmfoto.png 
Views:	276 
Size:	166.8 KB 
ID:	14590  
    Last edited by Mystique; August 20th, 2006 at 12:06 PM.

  2. #12
    Join Date
    Nov 2004
    Beans
    72

    Re: HOWTO: Improve font rendering; premade debs and instructions to patch yourself

    Hmm... would you mind posting more info about the dependency errors?
    Dont' bother with this. I installed those packages late at night and was tired.

    It was just a matter of installing some other dev packages.

    Your dev packages install fine now.

    Thanks again

  3. #13
    Join Date
    Jun 2006
    Location
    Houston, Texas
    Beans
    327
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: HOWTO: Improve font rendering; premade debs and instructions to patch yourself

    Ok, for those who are not using compiz, and want to patch the debs themselves, I have made the following instructions (I could not find the old patches with a google search, but after user mlind made his source debs I found them there, thanks a lot mlind ). I also attached the end result debs to this post as well (for non-compizers).

    If you'd just like to install these patched font packages, make a "fonts" directory in your home directory, save the attachments there, open a Terminal, and type the following commands:

    Code:
    cd fonts
    tar xvjf fontdebs-ubuntu.tar.bz2
    bunzip2 libfreetype*.bz2
    sudo dpkg -i *.deb
    sudo cp local.conf /etc/fonts
    Now go to Synaptic Package Manager, search for libfreetype, libcairo, and libxft, and "lock" the package versions by selecting the package files, going to the Package menu and selecting Lock Version. If you are, at any later points in time, having problems with broken packages (which you will at some point after enough updates have been made, especially if new packages in Dapper depend on new version of these font packages that currently do not exist yet, which is why the instructions about patching them yourself are key), just unselect the Lock Version for these packages (click on the "Status" button in Synaptic Package Manager at the bottom left hand corner, click on "Pinned," and you will see all packages you have locked version there) and update and you should be great.

    Now, the really fun part:

    HOWTO PATCH THEM YOURSELF

    1. Get the patches. I have attached the libcairo and libxft patches for the dapper (non-compiz) version of these packages at the end of this post (patches.tar.bz2). To extract them somewhere, go to that directory and type:

    Code:
    tar xvjf patches.tar.bz2
    Also, the following commands should install everything (I hope) you need to compile the packages:

    Code:
    sudo apt-get install build-essential devscripts fakeroot
    sudo apt-get build-dep libcairo2 libxft2 libfreetype6
    2. Now get the code for your packages:

    Code:
    mkdir fonts
    cd fonts
    apt-get source libcairo2 libxft2 libfreetype6
    3. Change the package version so that Update Manager will not try to update the packages if you lock their versions in synaptic manager.
    In each package directory, type:

    Code:
    dch -i
    Type in your comments (specifying you patched files), and then exit by pressing Control X
    and make sure you say yes to saving the file.
    Make sure you do this for all three.

    4. Now patch the sources. Here is what you do:

    For libcairo, you can just put the cairo-1.0.4-lcd_rendering.patch file into the debian/patches directory, also need to remove cairo-1.0.2-embedded-bitmaps.patch that is already there.

    Code:
    cd libcairo-1.0.4
    rm -rf debian/patches/cairo-1.0.2-embedded-bitmaps.patch
    cp pathtocairo-1.0.4patchfile debian/patches
    For libxft, since there is no debian/patches directory, I thought it is easiest to just do this:

    Code:
    cd libxft-2.1.8.2 [or whatever version you got]
    patch -p1 < pathtoyourlibxft_lcd_rendering.patch
    Finally, for libfreetype, it is a little more complicated since there is no patch. Basically, what you do is this. In the directory created (freetype-2.2.1 for example) there will be a file called freetype-2.2.1.tar.bz2. You will extract it, edit the appropriate file, adn then re-create the tar.bz2 archive. Here is how you can do it:

    Code:
    cd freetype-2.2.1
    tar xvjf freetype-2.2.1.tar.bz2
    gedit freetype-2.2.1/src/autofit/aflatin.c
    
    Now edit the file, find the part that reads:
        if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )
          other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
    
    Change that to:
        if ( mode == FT_RENDER_MODE_MONO )
          other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
    
    Find the part that reads:
        if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )
          other_flags |= AF_LATIN_HINTS_VERT_SNAP;
    
    Change that to:
        if ( mode == FT_RENDER_MODE_MONO )
          other_flags |= AF_LATIN_HINTS_VERT_SNAP;
    
    Now, do:
    tar cvjf freetype-2.2.1.tar.bz2 freetype-2.2.1/*
    rm -rf freetype-2.2.1
    Great, you're done patching.

    5. Make the packages:

    In the libcairo and lixft directories, type:

    Code:
    dpkg-buildpackage -rfakeroot
    In the libfreetype directory, since we did not use the patching system and just applied the patches ourselves, you must type:

    Code:
    dpkg-buildpackage -rfakeroot -b
    Wait a while, you will get some errors about missing a private key, but other than that it should succeed, and your packages will be in the fonts parent directory that you created. Enjoy!

    Misha
    Attached Files Attached Files
    Last edited by misha680; August 27th, 2006 at 05:01 AM. Reason: Slight modification of debs, maybe will solve dependency problems?

  4. #14
    Join Date
    Jun 2006
    Location
    A galaxy far, far away...
    Beans
    2,800

    Re: HOWTO: Improve font rendering; premade debs and instructions to patch yourself

    the repos give me a gpg NO_PUBKEY error every time I update. Any way to fix this?
    "Whoever said sunshine brings happiness has never danced in the rain." - K. Jackson
    Exaile Media Player | Arch Linux
    Click here to have your brain eaten

  5. #15
    Join Date
    May 2006
    Beans
    8

    Re: HOWTO: Improve font rendering; premade debs and instructions to patch yourself

    Running dapper and compiz from quinn's repo -- just wondering if others are having the same problems. I cannot seem to find the source versions as per the first post of this thread. Maybe I am missing something...

    My source.lst contains:
    Code:
    # Xgl and Compiz
    deb http://beerorkid.com/compiz/ dapper main
    deb http://xgl.compiz.info/ dapper main
    deb-src http://xgl.compiz.info dapper main
    When I run
    Code:
    sudo apt-get source libcairo2 libxft2 libfreetype6
    These are the versions I download.
    Code:
    freetype-2.1.10
    libcairo-1.0.4
    libxft-2.1.8.2
    So I can't apply these patches.
    Where are the sources for libcairo-1.2.2 and freetype-2.2.1
    Someone please help?

  6. #16
    Join Date
    Feb 2006
    Beans
    1,086
    Distro
    Ubuntu Gnome

    Re: HOWTO: Improve font rendering; premade debs and instructions to patch yourself

    Try
    Code:
    deb-src http://ubuntu.compiz.net/ dapper main

  7. #17
    Join Date
    Jun 2006
    Location
    Houston, Texas
    Beans
    327
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: HOWTO: Improve font rendering; premade debs and instructions to patch yourself

    Hmm... looks like they have change the repos since I wrote the howto (this past weekend). You could alwyas just use the howto version and patches for regular ubuntu higher up on this page. not sure what the differences are between the underlying versions, can't imagine it would be huge (but I really don't know, but I used to use the dapper versions and now use the compiz version or at least the ones that were on the repos and I don't really see any difference).

    Misha

  8. #18
    Join Date
    Aug 2006
    Location
    SA, Texas
    Beans
    31
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Improve font rendering; premade debs and instructions to patch yourself

    After installing the original patches from http://www.ubuntuforums.org/showthread.php?t=180647 I get really terrible font rendering. I've checked to make sure sub-pixel rendering was on ect. but still no go.

    I've also now tried your version of the patch Mischa680, but when using your debs I get a lot of dependicies errors

    Code:
    dude052@dude052-laptop:~/fonts$ sudo dpkg -i *.deb
    Password:
    (Reading database ... 101117 files and directories currently installed.)
    Preparing to replace libcairo2 1.0.4-0ubuntu1.1 (using libcairo2_1.0.4-0ubuntu2_i386.deb) ...
    Unpacking replacement libcairo2 ...
    Preparing to replace libcairo2-dev 1.0.4-0ubuntu1.1 (using libcairo2-dev_1.0.4-0ubuntu2_i386.deb) ...
    Unpacking replacement libcairo2-dev ...
    Preparing to replace libcairo2-doc 1.0.4-0ubuntu2 (using libcairo2-doc_1.0.4-0ubuntu2_all.deb) ...
    Unpacking replacement libcairo2-doc ...
    Preparing to replace libfreetype6 2.1.10-1ubuntu3 (using libfreetype6_2.1.10-1ubuntu3_i386.deb) ...
    Unpacking replacement libfreetype6 ...
    Preparing to replace libfreetype6-dev 2.1.10-1ubuntu3 (using libfreetype6-dev_2.1.10-1ubuntu3_i386.deb) ...
    Unpacking replacement libfreetype6-dev ...
    Preparing to replace libxft2 2.1.8.2-0ubuntu2 (using libxft2_2.1.8.2-0ubuntu3_i386.deb) ...
    Unpacking replacement libxft2 ...
    Preparing to replace libxft2-dbg 2.1.8.2-0ubuntu2 (using libxft2-dbg_2.1.8.2-0ubuntu3_i386.deb) ...
    Unpacking replacement libxft2-dbg ...
    Preparing to replace libxft-dev 2.1.8.2-0ubuntu2 (using libxft-dev_2.1.8.2-0ubuntu3_i386.deb) ...
    Unpacking replacement libxft-dev ...
    dpkg: dependency problems prevent configuration of libcairo2:
     libcairo2 depends on libfreetype6 (>= 2.2.1); however:
      Version of libfreetype6 on system is 2.1.10-1ubuntu3.
    dpkg: error processing libcairo2 (--install):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of libcairo2-dev:
     libcairo2-dev depends on libcairo2 (= 1.0.4-0ubuntu2); however:
      Package libcairo2 is not configured yet.
    dpkg: error processing libcairo2-dev (--install):
     dependency problems - leaving unconfigured
    Setting up libcairo2-doc (1.0.4-0ubuntu2) ...
    
    Setting up libfreetype6 (2.1.10-1ubuntu3) ...
    
    Setting up libfreetype6-dev (2.1.10-1ubuntu3) ...
    
    dpkg: dependency problems prevent configuration of libxft2:
     libxft2 depends on libfreetype6 (>= 2.2.1); however:
      Version of libfreetype6 on system is 2.1.10-1ubuntu3.
    dpkg: error processing libxft2 (--install):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of libxft2-dbg:
     libxft2-dbg depends on libxft2 (= 2.1.8.2-0ubuntu3); however:
      Package libxft2 is not configured yet.
    dpkg: error processing libxft2-dbg (--install):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of libxft-dev:
     libxft-dev depends on libxft2 (= 2.1.8.2-0ubuntu3); however:
      Package libxft2 is not configured yet.
    dpkg: error processing libxft-dev (--install):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     libcairo2
     libcairo2-dev
     libxft2
     libxft2-dbg
     libxft-dev
    I also get two or three broken packages, which apt when wanting to fix basically wants to uninstall the entire system! I fixed by removing/updating in aptitude, but now my fonts are nasty, pic below. I can not find any of the updated libs on any repo's nor can I patch my current libs it seems. Any word on any official patches for these libs or hacks that will work now?
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	screenshot2.png 
Views:	89 
Size:	3.6 KB 
ID:	14910  

  9. #19
    Join Date
    Jun 2006
    Location
    Houston, Texas
    Beans
    327
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: HOWTO: Improve font rendering; premade debs and instructions to patch yourself

    Alright, sorry about that, I changed one compilation flag (took out the -b on the dpkg-buildpackage command line from the libcairo and libxft packages) and recompiled them. Try the new debs in my ubuntu debs howto post above. However, if the original patches did not work for you, I'm not sure the ones I applied will either since it is just an update of the underlying debs being patched and not of the patches themselves.

    Personally, i also use a ~/.fonts.conf as follows:

    Code:
    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>
      <match target="font">
        <edit name="autohint" mode="assign">
          <bool>true</bool>
        </edit>
      </match>
    </fontconfig>
    but honestly I am quite blind when it comes to the fonts, I can clearly tell when I lost the patches but when it comes to little things like superbolding I don't even really notice it until someone points it out.

    Misha

    Quote Originally Posted by dude051 View Post
    After installing the original patches from http://www.ubuntuforums.org/showthread.php?t=180647 I get really terrible font rendering. I've checked to make sure sub-pixel rendering was on ect. but still no go.

    I've also now tried your version of the patch Mischa680, but when using your debs I get a lot of dependicies errors

    Code:
    dude052@dude052-laptop:~/fonts$ sudo dpkg -i *.deb
    Password:
    (Reading database ... 101117 files and directories currently installed.)
    Preparing to replace libcairo2 1.0.4-0ubuntu1.1 (using libcairo2_1.0.4-0ubuntu2_i386.deb) ...
    Unpacking replacement libcairo2 ...
    Preparing to replace libcairo2-dev 1.0.4-0ubuntu1.1 (using libcairo2-dev_1.0.4-0ubuntu2_i386.deb) ...
    Unpacking replacement libcairo2-dev ...
    Preparing to replace libcairo2-doc 1.0.4-0ubuntu2 (using libcairo2-doc_1.0.4-0ubuntu2_all.deb) ...
    Unpacking replacement libcairo2-doc ...
    Preparing to replace libfreetype6 2.1.10-1ubuntu3 (using libfreetype6_2.1.10-1ubuntu3_i386.deb) ...
    Unpacking replacement libfreetype6 ...
    Preparing to replace libfreetype6-dev 2.1.10-1ubuntu3 (using libfreetype6-dev_2.1.10-1ubuntu3_i386.deb) ...
    Unpacking replacement libfreetype6-dev ...
    Preparing to replace libxft2 2.1.8.2-0ubuntu2 (using libxft2_2.1.8.2-0ubuntu3_i386.deb) ...
    Unpacking replacement libxft2 ...
    Preparing to replace libxft2-dbg 2.1.8.2-0ubuntu2 (using libxft2-dbg_2.1.8.2-0ubuntu3_i386.deb) ...
    Unpacking replacement libxft2-dbg ...
    Preparing to replace libxft-dev 2.1.8.2-0ubuntu2 (using libxft-dev_2.1.8.2-0ubuntu3_i386.deb) ...
    Unpacking replacement libxft-dev ...
    dpkg: dependency problems prevent configuration of libcairo2:
     libcairo2 depends on libfreetype6 (>= 2.2.1); however:
      Version of libfreetype6 on system is 2.1.10-1ubuntu3.
    dpkg: error processing libcairo2 (--install):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of libcairo2-dev:
     libcairo2-dev depends on libcairo2 (= 1.0.4-0ubuntu2); however:
      Package libcairo2 is not configured yet.
    dpkg: error processing libcairo2-dev (--install):
     dependency problems - leaving unconfigured
    Setting up libcairo2-doc (1.0.4-0ubuntu2) ...
    
    Setting up libfreetype6 (2.1.10-1ubuntu3) ...
    
    Setting up libfreetype6-dev (2.1.10-1ubuntu3) ...
    
    dpkg: dependency problems prevent configuration of libxft2:
     libxft2 depends on libfreetype6 (>= 2.2.1); however:
      Version of libfreetype6 on system is 2.1.10-1ubuntu3.
    dpkg: error processing libxft2 (--install):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of libxft2-dbg:
     libxft2-dbg depends on libxft2 (= 2.1.8.2-0ubuntu3); however:
      Package libxft2 is not configured yet.
    dpkg: error processing libxft2-dbg (--install):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of libxft-dev:
     libxft-dev depends on libxft2 (= 2.1.8.2-0ubuntu3); however:
      Package libxft2 is not configured yet.
    dpkg: error processing libxft-dev (--install):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     libcairo2
     libcairo2-dev
     libxft2
     libxft2-dbg
     libxft-dev
    I also get two or three broken packages, which apt when wanting to fix basically wants to uninstall the entire system! I fixed by removing/updating in aptitude, but now my fonts are nasty, pic below. I can not find any of the updated libs on any repo's nor can I patch my current libs it seems. Any word on any official patches for these libs or hacks that will work now?

  10. #20
    Join Date
    Aug 2006
    Location
    SA, Texas
    Beans
    31
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Improve font rendering; premade debs and instructions to patch yourself

    Awesome, no errors anymore! But my fonts still stink... I have no idea why none of these patches arent working, its really bothering me now.

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

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