Difference between pages "Extlinux" and "Fonts"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
=== What is ExtLinux? ===
== Install the packages ==
 
Linux font quality is a chronic issue, by default fonts configuration far from ideal look. This can solved by rebuilding <tt>media-libs/fontconfig</tt> with the infinality USE flag which applies the infinality patch set. Infinality patches were previously available only in the lcd-filtering overlay and have now been merged into the main Funtoo portage tree.
ExtLinux is a simple and modern systemloader bundled with the syslinux tools. Installation is simple and fast, and thanks to our CoreTeam member Slashbeast the configuration is easily automated.
 
= Installing ExtLinux for funtoo =
 
Installing ExtLinux for funtoo is known to work and supported too. If you like to try it just emerge syslinux


<console>
<console>
# ##i##emerge syslinux
###i## echo "media-libs/fontconfig infinality" >> /etc/portage/package.use
###i## emerge -uN fontconfig
</console>
</console>
== Advanced configuration ==
=== Fontconfig ===
==== Default configuration ====


with that you have the complete syslinux tools installed. Another helpful tool you should merge with syslinux is slashbeast's lazykernel tool, so let us merge it too:
<console>
###i## eselect fontconfig enable 10-antialias.conf
###i## eselect fontconfig enable 10-autohint.conf 
###i## eselect fontconfig enable 10-hinting.conf 
###i## eselect fontconfig enable 10-hinting-slight.conf 
###i## eselect fontconfig enable 10-sub-pixel-rgb.conf 
###i## eselect fontconfig enable 11-lcdfilter-default.conf 
###i## eselect fontconfig enable 70-no-bitmaps.conf 
###i## eselect fontconfig disable 10-hinting-full.conf 
###i## eselect fontconfig disable 10-hinting-medium.conf 
###i## eselect fontconfig disable 10-no-sub-pixel.conf 
###i## eselect fontconfig disable 10-sub-pixel-bgr.conf 
###i## eselect fontconfig disable 10-sub-pixel-vbgr.conf 
###i## eselect fontconfig disable 10-sub-pixel-vrgb.conf 
###i## eselect fontconfig disable 10-unhinted.conf</console>
===Linux configuration ===


Same as default configuration except:
<console>
<console>
# ##i##emerge lazykernel
###i## eselect fontconfig enable 21-hinting-small-aquabase-slight.conf
###i## eselect fontconfig enable 21-hinting-small-browallia-slight.conf 
###i## eselect fontconfig enable 22-hinting-courier-italic-slight.conf
</console>
</console>
=== Infinality’s configuration ===


== Installing extlinux ==
Same as default configuration except:
 
to install extlinux just follow these steps:
 
<console>
<console>
# ##i##install -d /boot/extlinux
###i## eselect fontconfig enable 15-hinting-tt-instructed-full.conf
# ##i##extlinux --install /boot/extlinux
###i## eselect fontconfig enable 20-hinting-small-fonts-slight.conf 
###i## eselect fontconfig enable 21-hinting-small-aquabase-slight.conf 
###i## eselect fontconfig enable 21-hinting-small-browallia-slight.conf 
###i## eselect fontconfig enable 22-hinting-courier-italic-slight.conf 
###i## eselect fontconfig enable 25-hinting-small-arial-black-slight.conf
</console>
</console>
=== Windows configuration ===


The next steps are different depending on if you use an MBR or GPT setup and the HDD you installed on and want to boot from. Let us assume that <tt>/dev/sda</tt> is the drive you will be booting from.
Same as default except:
 
=== MBR ===
 
If you set up your disk with a MBR partition scheme, run the following:
 
<console>
<console>
# ##i##dd bs=440 conv=notrunc count=1 if=/usr/share/syslinux/mbr.bin of=/dev/sda
###i## eselect fontconfig disable 10-autohint.conf
# ##i##cp /usr/share/syslinux/menu.c32 /boot/extlinux/
###i## eselect fontconfig disable 10-hinting-slight.conf 
# ##i##cp /usr/share/syslinux/libutil.c32 /boot/extlinux/
###i## eselect fontconfig enable 10-hinting-full.conf 
# ##i##touch /boot/extlinux/extlinux.conf
###i## eselect fontconfig enable 15-hinting-non-tt-instructed-slight.conf 
###i## eselect fontconfig enable 20-hinting-small-fonts-slight.conf 
###i## eselect fontconfig enable 21-hinting-small-aquabase-slight.conf 
###i## eselect fontconfig enable 21-hinting-small-browallia-slight.conf 
###i## eselect fontconfig enable 22-hinting-courier-italic-slight.conf 
###i## eselect fontconfig enable 25-hinting-small-arial-black-slight.conf
</console>
</console>
=== OSX configuration ===


=== GPT ===
Same as default configuration except:
 
On the other hand, if you formatted your disk using GPT, run these commands:
 
<console>
<console>
# ##i##sgdisk /dev/sda --attributes=1:set:2
###i## eselect fontconfig disable 10-autohint.conf
# ##i##sgdisk /dev/sda --attributes=1:show
###i## eselect fontconfig disable 10-hinting.conf 
1:2:1 (legacy BIOS bootable)
###i## eselect fontconfig disable 10-hinting-slight.conf 
# ##i##dd bs=440 conv=notrunc count=1 if=/usr/share/syslinux/gptmbr.bin of=/dev/sda
###i## eselect fontconfig enable 10-unhinted.conf 
# ##i##cp /usr/share/syslinux/menu.c32 /boot/extlinux/
###i## eselect fontconfig enable 15-hinting-tt-instructed-none.conf
# ##i##cp /usr/share/syslinux/libutil.c32 /boot/extlinux/
# ##i##touch /boot/extlinux/extlinux.conf
</console>
</console>
== Freetype ==
Freetype can be configured through environment variables (see <tt>/etc/env.d/99lcdfilter</tt> for a list of the variables and their description). Those variables can be overridden on a per-user basis by either redefining them in a startup file (such as <tt>~/.bash_profile</tt>) or by sourcing the <tt>/usr/lib/ft-settings.sh</tt> script with the desired style in parameter (you can, of course, source the script from a startup file).


== Setting up the Kernel ==
usage: source ft-settings.sh <style>


Now if you followed our advice to install lazykernel we have a pretty nice way to solve all the setup with a bit of prework and finish it then. If not you should go to the manual part. :)
<console>
Possible styles: 
  default      - Use default settings. A compromise that should please most people 
  osx          - Simulate OSX rendering 
  ubuntu      - Simulate UBUNTU rendering 
  linux        - Generic Linux style - no snapping or certain other tweaks 
  windows      - Simulate Windows rendering 
  vanilla      - Just subpixel hinting


=== lazykernel way ===
Infinality styles:
 
  classic      - Infinality rendering circa 2010. No snapping 
Edit <tt>/etc/lazykernel.conf</tt>:
  nudge        - CLASSIC with lightly stem snapping and tweaks 
 
  push        - CLASSIC with medium stem snapping and tweaks 
{{file|name=/etc/lazykernel.conf|desc= |body=
  shove        - Full stem snapping and tweaks without sharpening 
# After configuring, hash or remove line below.
  sharpened    - Full stem snapping, tweaks, and Windows-style sharpening 
#CONFIGUREFIRST
  infinality  - Settings used by Infinality
 
</console>
# Number of the kernels to keep so `lazykernel clean` will not propose to remove them. Default: 3
== LibXft ==
keep_kernels=5
Only legacy programs still use libXft. The default configuration is defined in <tt>/usr/share/X11/app-defaults/Xft</tt>. It can be overriden on a per-user basis in the <tt>~/.Xresources</tt> or <tt>~/.Xdefaults</tt> files:
 
# Sort kernels by 'version' (biggest version first) or by 'mtime' (latest images first). Default: mtime
# Sorting by version may fail and 3.3.0-rc2 will be marked as newer than 3.3.0.
#sort_by='version'
sort_by=mtime
 
# The name for menu entry.
menu_entry_name="Funtoo Linux"
 
# Specify what initramfs image to use, if any. (Optional)
initramfs='initramfs.cpio.gz'
 
# Append kernel params, usualy you use it to specify rootfs device, but you can use it to pass switches to initramfs as well.  
kernel_params="rootfstype=ext4 luks enc_root=/dev/sdb3 lvm root=/dev/mapper/vg-root uswsusp resume=/dev/mapper/vg-swap"
}}
 
{{fancynote| Please make sure to comment out or delete the second line of the config file...else it will spit out an error.}}
 
Now let us setup our kernel with lazykernel. If you have a manual kernel just run:


<console>
<console>
# ##i##cd <kernel build dir>
Xft.antialias:  1
# ##i##lazykernel auto
Xft.autohint:  0 
Xft.dpi:        96 
Xft.hinting:    1 
Xft.hintstyle:  hintfull 
Xft.lcdfilter:  lcddefault 
Xft.rgba:      rgb
</console>
</console>
This will generate the modules for you. Copy your kernel form <tt>/usr/src/linux</tt> to <tt>/boot</tt> and generate the <tt>/boot/extlinux/extlinux.conf</tt>. The manual kernel will be the only one supported by lazykernel.
=== manual extlinux.conf ===
For other kernels, like those created by genkernel or by the binary USE-flag you need to edit your config by yourself. Just open <tt>/boot/extlinux/extlinux.conf</tt> in your favorite editor:
{{file|name=/boot/extlinux/extlinux.conf|desc= |body=
TIMEOUT 30
UI menu.c32
MENU TITLE Boot Menu
MENU COLOR title        1;37;40
MENU COLOR border      30;40
MENU COLOR unsel        37;40
LABEL funtoo1
        MENU LABEL Funtoo Linux KERNEL-VERSION
        LINUX /<kernel>
        INITRD /<initramfs>
        APPEND rootfstype=ext4 luks enc_root=/dev/sdb3 lvm root=/dev/mapper/vg-root uswsusp resume=/dev/mapper/vg-swap
}}
That's all. You are now ready for boot. You can also define several LABELs in that list to have multiple kernel selections to choose from before booting.


[[Category:HOWTO]]
[[Category:HOWTO]]

Revision as of 18:58, June 27, 2014

Install the packages

Linux font quality is a chronic issue, by default fonts configuration far from ideal look. This can solved by rebuilding media-libs/fontconfig with the infinality USE flag which applies the infinality patch set. Infinality patches were previously available only in the lcd-filtering overlay and have now been merged into the main Funtoo portage tree.

root # echo "media-libs/fontconfig infinality" >> /etc/portage/package.use
root # emerge -uN fontconfig 

Advanced configuration

Fontconfig

Default configuration

root # eselect fontconfig enable 10-antialias.conf
root # eselect fontconfig enable 10-autohint.conf  
root # eselect fontconfig enable 10-hinting.conf  
root # eselect fontconfig enable 10-hinting-slight.conf  
root # eselect fontconfig enable 10-sub-pixel-rgb.conf  
root # eselect fontconfig enable 11-lcdfilter-default.conf  
root # eselect fontconfig enable 70-no-bitmaps.conf  
root # eselect fontconfig disable 10-hinting-full.conf  
root # eselect fontconfig disable 10-hinting-medium.conf  
root # eselect fontconfig disable 10-no-sub-pixel.conf  
root # eselect fontconfig disable 10-sub-pixel-bgr.conf  
root # eselect fontconfig disable 10-sub-pixel-vbgr.conf  
root # eselect fontconfig disable 10-sub-pixel-vrgb.conf  
root # eselect fontconfig disable 10-unhinted.conf

Linux configuration

Same as default configuration except:

root # eselect fontconfig enable 21-hinting-small-aquabase-slight.conf
root # eselect fontconfig enable 21-hinting-small-browallia-slight.conf  
root # eselect fontconfig enable 22-hinting-courier-italic-slight.conf

Infinality’s configuration

Same as default configuration except:

root # eselect fontconfig enable 15-hinting-tt-instructed-full.conf
root # eselect fontconfig enable 20-hinting-small-fonts-slight.conf  
root # eselect fontconfig enable 21-hinting-small-aquabase-slight.conf  
root # eselect fontconfig enable 21-hinting-small-browallia-slight.conf  
root # eselect fontconfig enable 22-hinting-courier-italic-slight.conf  
root # eselect fontconfig enable 25-hinting-small-arial-black-slight.conf

Windows configuration

Same as default except:

root # eselect fontconfig disable 10-autohint.conf
root # eselect fontconfig disable 10-hinting-slight.conf  
root # eselect fontconfig enable 10-hinting-full.conf  
root # eselect fontconfig enable 15-hinting-non-tt-instructed-slight.conf  
root # eselect fontconfig enable 20-hinting-small-fonts-slight.conf  
root # eselect fontconfig enable 21-hinting-small-aquabase-slight.conf  
root # eselect fontconfig enable 21-hinting-small-browallia-slight.conf  
root # eselect fontconfig enable 22-hinting-courier-italic-slight.conf  
root # eselect fontconfig enable 25-hinting-small-arial-black-slight.conf

OSX configuration

Same as default configuration except:

root # eselect fontconfig disable 10-autohint.conf
root # eselect fontconfig disable 10-hinting.conf  
root # eselect fontconfig disable 10-hinting-slight.conf  
root # eselect fontconfig enable 10-unhinted.conf  
root # eselect fontconfig enable 15-hinting-tt-instructed-none.conf

Freetype

Freetype can be configured through environment variables (see /etc/env.d/99lcdfilter for a list of the variables and their description). Those variables can be overridden on a per-user basis by either redefining them in a startup file (such as ~/.bash_profile) or by sourcing the /usr/lib/ft-settings.sh script with the desired style in parameter (you can, of course, source the script from a startup file).

usage: source ft-settings.sh <style>

Possible styles:   
  default      - Use default settings.  A compromise that should please most people  
  osx          - Simulate OSX rendering  
  ubuntu       - Simulate UBUNTU rendering  
  linux        - Generic Linux style - no snapping or certain other tweaks  
  windows      - Simulate Windows rendering  
  vanilla      - Just subpixel hinting

Infinality styles:  
  classic      - Infinality rendering circa 2010. No snapping  
  nudge        - CLASSIC with lightly stem snapping and tweaks  
  push         - CLASSIC with medium stem snapping and tweaks  
  shove        - Full stem snapping and tweaks without sharpening  
  sharpened    - Full stem snapping, tweaks, and Windows-style sharpening  
  infinality   - Settings used by Infinality

LibXft

Only legacy programs still use libXft. The default configuration is defined in /usr/share/X11/app-defaults/Xft. It can be overriden on a per-user basis in the ~/.Xresources or ~/.Xdefaults files:

Xft.antialias:  1
Xft.autohint:   0  
Xft.dpi:        96  
Xft.hinting:    1  
Xft.hintstyle:  hintfull  
Xft.lcdfilter:  lcddefault  
Xft.rgba:       rgb