New fonts for X!

In older versions of Xfree fonts were managed via a font server, external to the binary common type xdm, and took the name of “xfs” (X Font Server). TrueType fonts were not supported by xfs and for this needed another external server, among other things not included in the xfree86 package, which took the name of “xfsft”. In newer versions, definitely 4.2.0 (but I think before) onwards, these functions have been integrated into the X server, and therefore does not require any special configuration.
There are different types of fonts and frankly, a bit ‘because I do not care, a little ‘because I’m not sure I understand something, do not know the difference. Among these types include bitmap fonts (BDF *, * .pcf) and those scalable. Among scalable ones we have four different types of fonts: Type 1, Speedo, TrueType and CIDFont.The installation of these types of fonts is similar, but for scalable fonts is required an operation at most. In this tutorial we will discuss the most common formats, such as bitmap and the first 3 types of scalable fonts, with particular attention to TrueType.
The operations are very few and simple: first we have to create a directory and piazzarci our fonts, then we need to index them (a bit ‘as a catalog them) and finally tell Xfree to seek new fonts in the directory created by us.Let’s see how: We try, download and copy the fonts Many of you will surely have the need to download the best TrueType font (common on Windows). If you have a partition or a computer running Windows, the question becomes simple: enter the directory with the fonts and copy them into a directory on your Linux partition. If you want new types of fonts, or you do not have windows, you have to download them from the internet and believe me, many more satisfactions. After a long search and several sites visited, I can advise you on the best archive with truly exceptional font: . Here you find in quantity, usually compressed in a .zip or .tar archive. Once downloaded, unzip and remove any files that are not interested in leaving only the file with the extension of the type of downloaded fonts (BDF, .pcf , .ttf, etc.). at this point we can proceed in two ways: either create a separate directory to save your font (so if you want to delete just easily remove the folder and the path to it in the configuration file X) or save your font in the default directory by X for fonts (usually in / usr / X11R6 / lib / fonts /). Personally I prefer to integrate my fonts with the system. If you chose the first method, you simply create a directory and copying your fonts. But first it is better to convert fonts in BDF format in .pcf format, with “bdftopcf” command: #bdftopcf nomefont.bdf and then compress it: #gzip nomefont.pcf As for the second method, as root, go to the directory of X font: #cd / usr / X11R6 / lib / fonts / #ls 100dpi 75dpi CID Speedo TTF Type1 encodings local misc util As you can see we have a different directory for each font type. If we are installing bitmap fonts, then we copy the fonts in “100dpi directory” or “75dpi” depending on the type of bitmap fonts. If we are installing scalable fonts, copy the font in the “Type1” fonts directory for homonyms, in “CID” for CIDFont fonts in “Speedo” fonts for homonyms, and in “TTF” if we are installing TrueType Fonts. Assuming you have saved the fonts in the font directory / of my home:# cp / home / Julio / font / * / usr / X11R6 / lib / fonts / TTF / TTF #cd Why I downloaded fonts truetype. Indexing fonts We now need to create an index of fonts. We enter the directory where you saved the fonts. As for the font bitmap, you just create a list of fonts in the directory by running “mkfontdir”: #mkfontdir This creates the fonts.dir file (which contains the list of fonts in the directory). If we are treating scalable fonts (the first 3 types), then we must first create another file named “fonts.scale” (because “mkfontdir” can not automatically recognize scalable font files).This file is associated with each file name, the name under which the file will be recognized by X (of course there are more names of X for each real file). – For Type1 fonts, use the binary “type1inst”, not included in X and available to page . Once downloaded, we can copy it to the directory of the X binaries in / usr / X11R6 / bin / and run it from within the directory of Type1. – For TrueType fonts, use the binary “ttmkfdir”, not included in X and available to the page http : // . The package is called “ttmkfdir.tar.gz” and are the sources, but inside there is also a precompiled binary named “ttmkfdir.linuxbin.glibc2” we can rename to “ttmkfdir” and copy it in the bin directory X in / usr / X11R6 / bin /. At this point to create the index of truetype, from its directory, give the command: -o #ttmkfdir fonts.scale And finally we create the true index, but for scalable fonts, you must also specify the directory with the files for ‘encoding of characters: #mkfontdir -e / usr / X11R6 / lib / fonts / encodings at this point should be present fonts.scale and fonts.dir files. – i do not know for fonts Speedo, but i think it’s like for fonts type1. we now come to the last step. Configure X first we need to tell X to search the fonts in the directory that we used. To do this, use the directive: FontPath “/ path / to / directory” in the X (usually / etc / X11 / XF86Config configuration file). OF Usually these directives are in the early sections of the file. If we followed the first method (creating our directory) then you MUST enter a new line in the file with the FontPath directive; If instead we used the second method, most likely the directory will already be present in the various FontPath. Also check that it is inserted in the file the option for loading the module that handles the font installed X. This is a thing of the genre: Load “Type1” for Type1 font type, or: Load “bitmap” Load “speedo” Load “freetype” (for truetype) Load “xtt” (for alternative truetype). This is however not necessary: it is only when the installation of X is modular, and therefore requires the loading of the individual modules. In other cases it may be that X is “monolithic” and then everything is already integrated. The installation is complete. Some programs may not need to restart X to see the new fonts (like Kword), for others it yes (such as OpenOffice) and others seems to be even asked to restart your computer (like Gimp, but most likely it comes to restoring the environment variables with a new login). Have fun !!


Leave Your Reply

Your email address will not be published. Required fields are marked *