Difference between revisions of "Fonts (Italiano)"

From ArchWiki
Jump to: navigation, search
m (use i18n template)
(re-flag article)
Line 4: Line 4:
 
[[Category:Eye candy (Italiano)]]
 
[[Category:Eye candy (Italiano)]]
 
{{i18n|Fonts}}
 
{{i18n|Fonts}}
 +
{{Bad translation}}
 +
 
{{Article summary start}}
 
{{Article summary start}}
 
{{Article summary text|Documenta l'installazione e l'utilizzo dei Fonts su Arch Linux.}}
 
{{Article summary text|Documenta l'installazione e l'utilizzo dei Fonts su Arch Linux.}}
Line 12: Line 14:
 
{{Article summary wiki|Xorg Font Configuration}}
 
{{Article summary wiki|Xorg Font Configuration}}
 
{{Article summary end}}
 
{{Article summary end}}
{{translateme}}
 
{{merge|Xorg Font Configuration|Talk:Xorg Font Configuration}}
 
  
 
= Introduzione =
 
= Introduzione =

Revision as of 18:22, 7 December 2010

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Tango-preferences-desktop-locale-modified.pngThe translation of this article or section does not reflect the original text.Tango-preferences-desktop-locale-modified.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Fonts (Italiano)#)
Template:Article summary start

Template:Article summary text Template:Article summary heading Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary end

Introduzione

Un'installazione standard di Arch Linux fornisce un eccellente supporto ai fonts, con gli ultimi rilasci stabili del server X.org, di freetype2 (con abilitato l'interprete bytecode) e fontconfig. Per ulteriori informazioni sulla configurazione dei font, fare riferimento a: Font Configuration

Tipi differenti di Fonts

Esistono differenti tipi di caratteri per Linux.

  • caratteri bitmap (.pcf .bdf .pcf.gz .bdf.gz)
  • caratteri PostScript (.pfa .pfb)
    (pfa: formato ascii; pfb: formato binario)
  • caratteri TrueType/OpenType (.ttf)
    (fonts OpenType con degli outline quadratici hanno anch'essi il suffisso .ttf)
  • caratteri PostScript flavored OpenType (.otf)
  • caratteri TeX bitmap (.pk)
    (di solito generati automaticamente dalla sorgente METAFONT .mf)
  • caratteri TeX virtuali (.vf)

Installare i fonts

Aggiungere font ad un sistema moderno Linux è molto più semplice che nelle prime distribuzioni. Qui sono riportati alcuni consigli per rendere il funzionamento semplice per la maggior parte degli utenti. Solitamente, per aggiungere un set di font al sistema, basta copiare i files necessari nelle directory seguenti:

  • /usr/share/fonts
  • /usr/X11R6/lib/X11/fonts

In questo modo ogni utente sulla macchina avrà a disposizione i font installati.

Note: copiare i font nelle directory sopra riportate richiede i privilegi da amministratore. Eseguite la copia da root o attraverso sudo se installato

Copiare i temi anche nella directory:

  • ~/.fonts

costituisce una buona idea.

Alcune collezioni di font sono già state preparate per gli utenti di Archlinux. Potete reperirle cercandole in pacman (o yaourt se installato):

pacman -Ss fonts

Tra i pacchetti trovati potrete trovare (ad esempio):

extra/artwiz-fonts 1.3-4
    This is set of (improved) artwiz fonts.
extra/ttf-ms-fonts 2.0-2
    Un-extracted TTF fonts from Microsoft

Se volete installare questi due set di font, eseguite il seguente comando:

pacman -S artwiz-fonts ttf-ms-fonts

Quest'ordine installerà i due set di font nella directory Template:Filename. Gli utenti CJK (Cinesi/Giapponesi/Coreani) dovrebbero anche installare i font ttf-arphic-uming, ttf-arphic-ukai e ttf-fireflysung per mostrare i caratteri asiatici in modo appropriato.

Un'altra valida opzione è quella di utilizzare l'Installatore di Font, situato nel Centro di Controllo di KDE. Questa opzione risolve egregiamente l'installazione dei font, a patto che abbiate, ovviamente, KDE installato.

Terza e ultima opzione, sconsigliata, è quella di copiare direttamente i file font nelle cartelle sopra riportate. Ricordatevi di possedere i privilegi di amministratore :
fc-cache -vf

Queste tre opzioni funzionano nella maggior parte dei casi con gli ambienti desktop GNOME, KDE e XFCE4 per la maggior parte delle applicazioni. Allo stesso tempo, alcune applicazioni datate o costruite con GTK1 non supportano fontconfig. (Qualcuno dovrebbe effettivamente controllare questo problema e cercare di risolverlo.) Per aggirare questo inconveniente è necessario eseguire questi comandi nel terminale, assicurandosi di possedere i privilegi da amministratore:

  mkfontscale
  mkfontdir
  ln -s /usr/share/fonts/encodings/encodings.dir directoryDelFont/encodings.dir

Inoltre, se usate KDE:

   ln -s /usr/share/fonts/encodings/encodings.dir ~/.fonts/

A questo punto potete riavviare X.

Se volete condividere dei font (magari di vostra creazione), o volete evitare il ripetersi di questi comandi manuali, potete creare un pacchetto Arch. Salvate i font che volete pronti per l'installazione in un pacchetto .tar.bz2 e usate una variazione (secondo le vostre necessità) del PKGBUILD e del file .install qui sotto riportati:

# PKGBUILD
  pkgname=fonts-extra
  pkgver=1.0
  pkgrel=1
  depends=('xfree86')
  pkgdesc=\"Fonts extra\"
  source=(fonts-extra.tar.bz2)
  install=fonts-extra.install
  build()        {
    mkdir -p $startdir/pkg/usr/X11R6/lib/X11/fonts/local
    mv $startdir/src/*.ttf $startdir/pkg/usr/X11R6/lib/X11/fonts/local
  }
# fonts-extra.install:
  # arg 1:  the new package version
  post_install() {
    echo -n \"updating font cache... \"
    /usr/bin/fc-cache
    cd /usr/X11R6/lib/X11/fonts/local
    /usr/X11R6/bin/mkfontscale
    /usr/X11R6/bin/mkfontdir
    ln -s /usr/X11R6/lib/X11/fonts/encodings/encodings.dir /usr/X11R6/lib/X11/fonts/local/encodings.dir
    echo \"done.\"
  }

  # arg 1:  the new package version
  # arg 2:  the old package version
  post_upgrade() {
    post_install $1
  }

  # arg 1:  the old package version
  pre_remove() {
    /bin/true
  }

  op=$1
  shift

  $op $*

Pacchetti di Font in Arch Linux

NB: Questa è una lista selettiva, ma riporta la maggior parte dei font reperibili in AUR.

  • Hebrew
    • culmus - Ottima collezione di Font ebrei
  • Thai
    • ttf-thai - Font necessario per i grafi thai
  • Khmer
    • ttf-khmer - Font necessario per i grafi della lingua Khmer
  • “Programmer's fonts” (per programmazione e display di terminale)

I migliori font per il terminale

Il font migliore per il terminale dipende innanzitutto da quale emulatore di terminale usate, e quali feature (funzioni) supporta . For example, it even depends on how your fonts.dir looks, as sometimes fonts get installed incorrectly. It also depends on how you have configured your X Server, if you use freetype2 or freetype1, if you use the autohinter with the bytecode interpreter compiled into freetypeN, if you have compiled in the BI but doesn't use the autohinter, if you have not compiled in the BI and use the autohinter, if you have not compiled in the BI but uses the autohinter, etc.

A top favorite of some Arch Linux users is Terminus (in community as "terminus-font").

Some other fonts to try out:

  • Lucida Typewriter
  • Andale Mono
  • Bitstream Vera Mono
  • Courier
  • Terminal
  • Test
  • Gamov
  • default8x16
  • monospace
  • Liberation Mono
  • Proggy Clean

Example how to use Terminus:

xterm -bg black -fg gray -fn -xos4-terminus-medium-r-normal--14-140-72-72-c-80-iso8859-1
xterm -bg black -fg gray -fn -xos4-terminus-bold-r-normal--14-140-72-72-c-80-iso8859-1

Fonts in virtual console

Default font in virtual console can display only ASCII characters. If you use other characters you can change the CONSOLEFONT and CONSOLEMAP settings in your /etc/rc.conf file. Different fonts can be found in /usr/share/kbd/consolefonts directory and key maps can be found in the subdirectories of /usr/share/kbd/keymaps.

Examples

For displaying characters like "č ć ž đ š" use lat2-16.psfu.gz font:

CONSOLEFONT="lat2-16.psfu.gz"

Also, don't forget to set the proper key map, in this case:

CONSOLEMAP="8859-2"

To use the specified font in early userspace (early in the bootup process), add the 'keymap' hook to /etc/mkinitcpio.conf and rebuild the image. See the Mkinitcpio article for more information.

Fonts with LCD filter enabled

"LCD" packages

Install patched packages

Remove the original packages:

pacman -Rd libxft cairo

Install the patched packages from AUR unsupported (ex. using yaourt):

yaourt -S fontconfig-lcd
yaourt -S cairo-lcd

Install the patched packages from [community]:

pacman -S libxft-lcd

Reboot your system.

Note: if you want, you can simply revert to the original packages entering

pacman -Rd libxft-lcd cairo-lcd fontconfig-lcd
pacman -S libxft cairo

Change filter configuration

The "fontconfig-lcd" package enables by default the "lcddefault" filter. You can edit the /etc/fonts/conf.avail/10-lcd-filter.conf file and replace it with another filter.

  • New filter, fontconfig-lcd default
 <const>lcddefault</const>
  • None
 <const>lcdnone</const>
  • Lighter filter, less aggressive
 <const>lcdlight</const>
  • Legacy filter, cairo default
 <const>lcdlegacy</const>

Alternative with "ClearType" packages

There are more effects for fonts from Windows system, this method of beautifying fonts has been tested with GNOME/Xfce/KDE.

Remove Packages:

pacman -Rd cairo libxft freetype2

Install Packages

Install the package cairo-cleartype, libxft-cleartype, freetype2-cleartype from AUR

Search "cairo-cleartype", "libxft-cleartype", "freetype2-cleartype" in AUR, download all these tarballs, extract them, and compile them with makepkg, install them with

pacman -U *-cleartype*.pkg.tar.gz

Restart X11 (ctrl+alt+backspace)

OR if you have yaourt installed:

yaourt -S cairo-cleartype freetype2-cleartype libxft-cleartype

Configuration

FreeType autohinter (optional)

You can set the FreeType autohinter. As root :

ln -s /etc/fonts/conf.avail/10-autohint.conf /etc/fonts/conf.d/10-autohint.conf

Disable Unattractive Bitmap Fonts (optional)

Edit ~/.fonts.conf with the following content:

   <selectfont>
       <rejectfont>
           <pattern>
               <patelt name="scalable">
                   <bool>false</bool>
               </patelt>
           </pattern>
       </rejectfont>
   </selectfont>

Restart X11 (ctrl+alt+backspace)

At this point if you think fonts look too bold, modify the fonts configuration file: edit (or create if it doesn't exist yet) the file ~/.fonts.conf with the following content:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font" >
<test compare="more" name="weight">
<const>medium</const>
</test>
<edit mode="assign" name="autohint">
<bool>false</bool>
</edit>
</match>
</fontconfig>

FAQ

Q. My fonts are too large or too small. The resolution seems wrong. My fonts are mis-shapen.

A(1). Read the Display Size/DPI section of Xorg for configuration sample settings and formula.

A(2). Get your proper resolution from a console, by typing:

xdpyinfo | grep resolution

Change the value to this in the Gnome font configurator. Restart X. Sometimes, the videocard gives bogus information to X. It may be better to settle on a value between 72-78 DPI for 1024x768 displays. 96 DPI is a good value for 1280x1024, but it depends on the exact resolution. I actually prefer 75 on my home machine, and the font sizes seem to be a bit more true to their proper sizes when this is set. In most cases, if the numbers don't match, you may use the following method.

You may also opt to force X to start with a forced resolution. This may produce good results in some display modes. For example, you may use:

startx -- -dpi 75

This will force X to start in 75x75 DPI mode. You may change your Gnome font settings (From the menu: Applications/Desktop Preferences/Font) to 75 DPI and you should get a good match.

If this worked well for you, you may edit your "startx" script to always force this option on startup. Edit the file "/usr/bin/startx" as root.

Change the following line:

defaultserverargs=""

to...

defaultserverargs="-dpi 75"

Q. How do I install fonts?

A. An easy way to install fonts is to drop them into your "$HOME/.fonts" directory and running "fc-cache". You can also perform a system-wide font installation by copying the fonts to "/usr/share/fonts" or another font directory (as long as it is listed in your "/etc/fonts/fonts.conf" file), and then performing the "fc-cache" command as root. You may also need to run "ttmkfdir" or "mkfontdir" as well.

Q. The fonts in GNU Emacs are displayed as squares.

A. You need to install the xorg-fonts-75dpi or xorg-fonts-100dpi package.

Q. The fonts in OpenOffice.org look very bad.

A. If we have a bug/font-issue in the openoffice-base package, using the original rpm-packages from the office website will allways work. "Bad fonts are a thing of the past with the newest version (2.3.1)." (http://www.stchman.com/tweaks.html).

Note that OpenOffice.org for Linux ships with an (inferior) copy of freetype2 that are built directly into the code. In the past you could force it to link to your system's, shared, freetype2 by setting the following before starting the suit.

export LD_PRELOAD=/usr/lib/xorg/modules/fonts/libfreetype.so

The (Jan 2008) above is reported to not work anymore but at qa.openoffice.org a patch to do this bypass is emering.

Q. The OpenOffice.org menu font looks really bad. It doesn't use antialiasing either.

A. This can be changed in the OpenOffice.org configurator. From the drop-down menu, select "Tools/Options/OpenOffice.org/Fonts". Check the box that says "Apply Replacement Table". Type "Andale Sans UI" in the font box (this may have to be input manually, if it doesn't appear in the drop-down menu) and choose your desired font for the "Replace With" option. Dropline users may prefer the system default, "Trebuchet MS". When selected, click the checkmark box. Then choose the "always" and "screen" options in the box below. Apply the changes, and your menu fonts should look great.

Q. OpenOffice.org doesn't detect my TrueType fonts!

A. Make sure that you add the appropriate entry in your /etc/X11/xorg.conf file that points your programs to the /usr/share/fonts/ directory.

For example, here's a sample of an xorg.conf file

Section "Files"
    RgbPath         "/usr/share/X11/rgb"
    ModulePath      "/usr/lib/xorg/modules"
    FontPath        "/usr/share/fonts/misc"
    FontPath        "/usr/share/fonts/75dpi"
    FontPath        "/usr/share/fonts/100dpi"
    FontPath        "/usr/share/fonts/TTF"
    FontPath        "/usr/share/fonts/Type1"
EndSection

Another solution is to run the openoffice administration tool

# /opt/openoffice/program/spadmin

from which you can add fonts.

Q. Mozilla and other programs can no longer access TrueType fonts on my system, and are reverting to ugly fonts instead.

A. Make sure the "freetype" module is loaded in your /etc/X11/xorg.conf file and your /usr/share/fonts/TTF/fonts.dir lists all of the TrueType fonts you have installed.

Try checking your "Files" section of your xorg.conf, and make sure that you have all (or most) of these directories listed.

Section "Files"
    RgbPath         "/usr/share/X11/rgb"
    ModulePath      "/usr/lib/xorg/modules"
    FontPath        "/usr/share/fonts/misc"
    FontPath        "/usr/share/fonts/75dpi"
    FontPath        "/usr/share/fonts/100dpi"
    FontPath        "/usr/share/fonts/TTF"
    FontPath        "/usr/share/fonts/Type1"
EndSection

Finally, go to the following font directories:

/usr/share/fonts/TTF
/usr/share/fonts

Try deleting the "fonts.dir" and "fonts.scale" files in these directories. You may want to make backups first though. Run these commands to replace them.

mkfontscale
mkfontdir

Make sure you restart X for the changes to come into effect.

Q. What are some suggested font settings for Mozilla/Firefox?

A. These are recommended for Firefox:

Proportional: Serif   Size (pixels): 16
Serif: Times New Roman
Sans-serif: Arial
Monospace: Courier New   Size (pixels): 13
Display resolution: System settings
  • Note: Times New Roman may appear to be a non-TTF font. If this is the case, read above about how to fix this.

I believe that the following are Dropline's Mozilla defaults (also recommended):

Proportional: Serif   Size (pixels): 14
Serif: Times New Roman
Sans-serif: Verdana
Cursive: Andale Mono
Fantasy: Andale Mono
Monospace: Courier New   Size (pixels): 11
Allow Documents to use other fonts: Enabled
Display resolution: System settings

Q. Why do my Apps show squares when there should be arrows and the like?

A. It may help to activate bitmap fonts. They are disabled by default.

cd /etc/fonts/conf.d
rm 10-bitmaps.conf
ln -s yes-bitmaps.conf 10-bitmaps.conf
cd -

If you think your fonts look ugly now then consider to remove the following packages.

pacman -Rs xorg-fonts-100dpi xorg-fonts-75dpi

Read here and here for some background info.

Q: I just upgraded via pacman -Syu and my fonts are all ugly

A: There are several possible conflicting issues here. See these threads:

1 - http://bbs.archlinux.org/viewtopic.php?t=866

2 - http://bbs.archlinux.org/viewtopic.php?t=4975