====== Utilizzo dei font TrueType in X-Window ====== ===== Debian Squeeze e X.org ===== Vedere questo utile post: [[http://machine-cycle.blogspot.com/2008/01/installing-truetype-fonts-on-debian.html|Installing TrueType Fonts on Debian]] e anche questo [[http://www.ghacks.net/2009/01/09/installing-fonts-in-linux/|Installing Fonts in Linux]]. Con una distribuzione moderna è sufficiente creare una directory **''$HOME/.fonts/''**, copiarci dentro il file ''.ttf'' ed eseguire **''fc-cache -fv''**. Per vedere quali font risultano installati si esegue **''fc-list''**. Per rendere disponibile il font a tutti gli utenti di sistema dovrebbe essere sufficiente copiarlo in **''/usr/local/share/fonts/''**. Questo meccanismo funziona grazie al pacchetto **fontconfig**. ===== XFree86: supporto TrueType integrato o tramite X-Font-Server ===== DELETEME **NOTA:** Le informazioni che seguono sono relative al server XFree86 e sono probabilmente obsolete. Vere il paragrafo precedente. Il supporto ai font TrueType integrato nel server XFree86 4.0, puo' utilizzare il modulo **freetype** (motore //FreeType// chiamato un tempo //xfsft//) o in alternativa il modulo **xtt** (motore //X-TrueType//). I moduli non possono coesistere. Le differenze sembrano minime, soprattutto riguardano la capacità di ricodificare un font ad esempio da iso8859-1 a iso8859-2. Vedi a riguardo ''/usr/share/doc/xfree86-common/README.fonts.gz''. X-TT ha la capacità di creare le varianti grassetto e corsivo dal font normale. Debian propone per default FreeType, per caricare il modulo desiderato, in ''/etc/X11/XF86Config-4'' si usa la direttiva: Load "freetype" E' meglio che sia il server stesso a fare il rastering dei font piuttosto che utilizzare un font server (normalmente in ascolto su Unix soket, porta 7100). Oltre a motivi di performance c'è il fatto che il server legge dentro i file dei font informazioni aggiuntive per il rendering che un font server non supporta. Comunque in Debian 3.0 esistono tre font server, in ordine di preferenza: * **xfs** X font server (supporta i TrueType tramite motore FreeType) * **xfs-xtt** X-TrueType font server (usa il motore X-TT) * **xfstt** TrueType Font Server for X11 (supporta solo font TrueType, no X bitmap né Type1, ...) ===== Installazione di font TrueType pacchettizzati Debian ===== Se si usa Debian Sarge e Defoma (Debian Font Manager) i font TrueType (quelli di MS-Windows) e i font CID (inventati da Adobe per supportare character set più ampi) vengono installati in: /var/lib/defoma/x-ttcidfont-conf.d/dirs/CID /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType Con Debian Woody probabilmente la directory da usare è ''/usr/lib/X11/fonts/TrueType''. Installando il pacchetto **msttcorefonts** (richiede cabextract) vengono prelevati con wget e installati i font TrueType che Microsoft rende disponibili gratuitamente. I vari font (archivi compressi .exe) vengono scaricati da [[http://unc.dl.sourceforge.net/sourceforge/corefonts/]] e sono stati salvati in ''/usr/local/download/msttcorefonts/''. E' stato necessario aggiungere manualmente in ''/etc/X11/XF86Config-4'' le directory che contengono i font e riavviare il server X: FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID" Il server X ottiene un indice dei font disponibili da due file: ''fonts.dir'' e ''fonts.scale'' in ciascuna directory "FontPath". Gli script Debian ''update-fonts-dir'' e ''update-fonts-scale'' leggono il contenuto delle directory in ''/etc/X11/fonts/'' ed aggiornano i rispettivi file in ''/usr/lib/X11/fonts/''. Pare che i file ''fonts.scale'' generati dipendono dal back-end usato da X per i font (FreeType o X-TT), se lo si cambia si deve riconfigurare x-ttcidfont-conf (vedi ''/usr/share/doc/x-ttcidfont-conf''). ===== Installazione di altri font TrueType ===== Vedi [[http://www.paulandlesley.org/linux/xfree4_tt.html]]: Installato il pacchetto ''ttmkfdir''. * Creata la directory ''/usr/local/share/fonts/TrueType/'' dove si copiano i file ''.ttf''. * Creati gli indici ''font.scale'' e ''fonts.dir'' con i comandi ttmkfdir > fonts.scale mkfontdir /usr/local/share/fonts/TrueType * Aggiungere in XF86Config-4 la riga FontPath "/usr/local/share/fonts/TrueType" Per vedere quali font sono disponibili al server X-Window si può usare il comando ''xlsfonts''. ===== Font Linux in Konsole ===== **2009-02-21 Update:** To enable bitmap fonts in **Debian Lenny** - which enables a lot of fonts in Konsole - you must run: dpkg-reconfigure fontconfig-config fc-cache -fs **Obsolete notes follow** Debian bug #223838 Package: konsole Version: 4:3.1.3-1 Severity: normal Menu Settings, Font, Linux, brings this error message: Font `-misc-console-medium-r-normal--16-160-72-72-c-160-iso10646-1' not found. Check README.linux.console for help. The error exists despite that the font is available (installed by xfonts-konsole package), as displayed by xlsfonts and xfontsel. The problem may be caused by not enabling bitmapped fonts in fontconfig. You can enable bitmapped fonts in ''/etc/fonts/local.conf'': /usr/X11R6/lib/X11/fonts **2005-04-11 Update**: With recent versions of ''**fontconfig**'' package: If you wish to enable bitmapped fonts manually, either reconfigure this package (with ''dpkg-reconfigure fontconfig''), or remove the symbolic link ''/etc/fonts/conf.d/30-debconf-no-bitmaps.conf''. Check also anti-aliasing in KDE (Control Center, Appearance & Themes, Fonts), you can enable or disable it, but if you disable it, check that in ''$HOME/.qt/qtrc'' you have enableXft=true useXft=false If both the options are set to false, you can get the error too. There is also a file ''/var/lib/fontconfig/local.conf'', which is a copy of ''/etc/fonts/local.conf'', don't know when and how it is generated.