Uso de fuentes TrueType de Windows en Linux.



Este mini-howto solo tiene la intencion de dar a conocer la posibilidad de usar las fuentes TrueType de Windows en Linux, ya que en ciertos momentos estas prestan gran utilidad, explicando en forma simple, como "instalarlas" en nuestro SO, dejandolas operativas para todas los programas.

Manos a la obra

Demas esta decir que si no tienes windows instalado en tu computador tambien puedes usar las fuentes truetype para windows que puedes encontrar en internet. El primer paso es ingresar a nuestro directorio con nuestras fuentes de linux:

root@dick:/root#cd /usr/X11R6/lib/fonts/

Luego creamos el directorio donde pondremos nuestras nuevas fuentes:

root@dick:/usr/X11R6/lib/fonts#mkdir truetype
root@dick:/usr/X11R6/lib/fonts#cd truetype


Ahora que estamos en el directorio necesario, procederemos a copiar las fuentes, por ejemplo las que se encuentran en windows:
(suponiendo que tienes montada la particion de windows en /win_c)

root@dick:/usr/X11R6/lib/fonts/truetype/#cp /win_c/windows/fonts/*.ttf ./

Ahora crearemos nuestro fonts.dir que es un archivo que contiene la informacion de las fuentes existentes, necesario para poder utilizarlas. Esto lo haremos con un programa llamado ttmkfdir, descargalo y haz lo siguiente:
(suponiendo que lo haz bajado en la carpeta donde tenemos nuestras fuentes)
Descomprimimos el tarball.

root@dick:/usr/X11R6/lib/fonts/truetype/#tar xvfz ttmkfdir.tar.gz

Usaremos el binario que viene includido ya en este paquete.

root@dick:/usr/X11R6/lib/fonts/truetype/#ttmkfdir.linuxbin.glibc2 >fonts.dir

Con esto ya habremos creado nuestro fonts.dir, ahora procederemos a modificar nuestro /etc/X11/XF86Config, para agregar nuestro path de las fonts. Con algun editor de texto abrimos este fichero de configuracion, localizamos la seccion modules, la cual es algo como esto:

Section "Module"
# This loads the DBE extension module.
Load "dbe" # Double buffer extension
# This loads the miscellaneous extensions module, and disables
# initialisation of the XFree86-DGA extension within that module.
SubSection "extmod"
Option "omit xfree86-dga" # don't initialise the DGA extension
EndSubSection
# This loads the Type1 and FreeType font modules
Load "type1"
# This loads the GLX module
# Load "glx"
EndSection


En ella agregamos la siguiente linea (en caso de que exista la dejamos asi):

Load "freetype"

Luego agregamos en la seccion Files que deberia ser algo asi:

Section "Files"
# The location of the RGB database. Note, this is the name of the
# file minus the extension (like ".txt" or ".db"). There is normally
# no need to change the default.
RgbPath "/usr/X11R6/lib/X11/rgb"
# Multiple FontPath entries are allowed (which are concatenated together),
# as well as specifying multiple comma-separated entries in one FontPath
# command (or a combination of both methods)
#
# If you don't have a floating point coprocessor and emacs, Mosaic or other
# programs take long to start up, try moving the Type1 and Speedo directory
# to the end of this list (or comment them out).
#
FontPath "/usr/X11R6/lib/X11/fonts/local/"
FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath "/usr/X11R6/lib/X11/fonts/Speedo/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
# The module search path. The default path is shown here.
# ModulePath "/usr/X11R6/lib/modules"
EndSection


Una linea como la siguiente:

FontPath "/usr/X11R6/lib/X11/fonts/truetype/"

Ok, hasta aqui la configuracion ha finalizado. Ahora para revisar si todo va bien haremos lo siguiente (como el usuario actual, no como root):

onix@dick:/usr/X11R6/lib/fonts/truetype$ xset fp+ "/usr/X11R6/lib/X11/fonts/truetype/"
onix@dick:/usr/X11R6/lib/fonts/truetype$ xset fp rehash


Con esto se supone que todo deberia andar bien, para comprobarlo ejecuta xfontsel, y en el menu presiona la opcion "fndry" o "foundry", se desplegara una lista, revisa si esta en ella la opcion "microsoft", si existe todo esta ok y puedes comenzar a usar tus nuevas fuentes :)

onix@dick:/usr/X11R6/lib/fonts/truetype$ xfontsel

En caso contrario reinicia la X, y comprueba nuevamente con fontsel, si sigue sin funcionar revisa los pasos que realizaste uno a uno y busca tu error.

Por ahora eso es todo,espero que este peque�o documento te haya sido util, si tengo algun error, o tienes alguna duda, puedes contactarme a [email protected].

Atte.
Claudio Villalobos C.
C-Cube.org Systems
Hosted by www.Geocities.ws

1