TrueType
Материал из openSUSE.
Содержание |
Обзор
TrueType — шрифтовый стандарт, изначально созданный компанией Apple Computer в конце 1980-х годов в противовес стандарту Adobe's Type 1, который использовался в PostScript. Главное достоинство TrueType в предоставлении разработчикам возможности очень точно контролировать, как именно отображаются символы шрифта, вплоть до конкретных пикселей при определённом размере шрифта.
Проект Девида Тёрнера FreeType ставит своей целью реализацию стандарта TrueType (а также других шрифтовых стандартов). FreeType поставляется вместе с SUSE 10.0.
Особенности установки и рендеринга шрифтов
Многие пользователи ОС Linux недовольны рендерингом шрифтов под X11, но эта ситуация легко исправима. Обратите внимание, что предлагаемое решение использует патентованную технологию. Вам не нужна особая лицензия для частного использования, но может возникнуть необходимость в ней при распространении пакетов, использующих её. Смотрите патентную информацию в разделе внешних ссылок ниже.
Activating the TrueType bytecode interpreter for freetype2
SuSE 10.0 comes with the bytecode interpreter already compiled, so you only need to read this section if you're using some other version. If you are using SuSE 10.0 or greater, please skip ahead to Getting some TrueType fonts.
Download the freetype2 source package that matches your distribution. For SuSE 9.0, get it here. For SuSE 9.1, get it here. For SuSE 9.2, get it here. For SuSE 9.3, get it here. For any other distribution, get it from your vendor's server or from your installation media.
Install the source package you just downloaded:
rpm -i freetype2-$Version-$Release.src.rpm
Note that this does not require root privileges unless your system security is set to "paranoid", which is not the default. You must, of course, replace $Version and $Release with the values that match the source package you just downloaded.
This step will copy several files onto your system: freetype2.spec and the actual source code along with some patches. Unless you have set up a package building environment, freetype2.spec will be copied into /usr/src/packages/SPECS and all the other files will be copied into /usr/src/packages/SOURCES.
Open freetype2.spec in your favorite text editor and edit it. This might require higher privileges than you currently have. Copy the file elsewhere or change the permissions if necessary. You will find a section somewhere in the middle of freetype2.spec that looks like this:
# Remove the comment character in front ot the '%patch100' line # if you want to turn on the bytecode interpreter. # But first read http://www.freetype.org/freetype2/2.1.3-explained.html # I.3. Do I still need to enable the TrueType bytecode interpreter ? # # Short answer: No for most people !! # #%%patch100 -p 1 -b .bytecode
Edit it so that it looks like this:
# Remove the comment character in front ot the '%patch100' line # if you want to turn on the bytecode interpreter. # But first read http://www.freetype.org/freetype2/2.1.3-explained.html # I.3. Do I still need to enable the TrueType bytecode interpreter ? # # Short answer: No for most people !! # %patch100 -p 1 -b .bytecode
Note the difference at the beginning of the very last line in this section.
Change the Release tag of the package. This is not strictly necessary, but it might help you to organise your packages. If you would like to do so, find the following line at the beginning of freetype2.spec:
Release: #
"#" reflects the Release tag of the source package you downloaded before. Append ".bytecode" to it so that it looks like this:
Release: #.bytecode
Now let us turn the source package into binary packages. Change into the directory that contains your edited copy of freetype2.spec and execute the following:
rpmbuild -bb freetype2.spec
You might get error messages about missing build requirements at this step. If so, install the missing packages with yast, apt or whatever you prefer.
If everything goes well, you will get two binary packages after the build process has completed: freetype2-$Version-$Release.i586.rpm and freetype2-devel-$Version-$Release.i586.rpm. Unless you have set up a package building environment, they will be located in /usr/src/packages/RPMS/i586.
Install these packages as usual. freetype2 is definitely needed, freetype2-devel is needed in order to compile software that uses freetype2. Most graphical software does use freetype2, so let us install both packages. Change into the directory that contains these packages and execute the following:
rpm -Uvh freetype2-*
Note that this requires root privileges.
Congratulations, your TrueType bytecode interpreter for freetype2 is now activated! Log out from your Xsession and log in again in order for the new libraries to load.
Getting some TrueType fonts
Most Linux distributions contain a basic set of TrueType fonts, but these are often not the best ones that we can find. Microsoft released some high quality TrueType fonts as freeware some years ago. In order to install them, start YaST and do an online update. Activate the option that offers you to download and install these fonts. It is not activated by default!
These fonts are freeware and do not require a license for any Microsoft product. If you have a license for a Microsoft product, especially the Windows operating system, you can use additional fonts. They are in the %WINDIR%\FONTS directory of your Windows installation, copy them into /usr/X11R6/lib/X11/fonts/local and execute the following:
SuSEconfig
Note that this requires root privileges. It is necessary in order to make X11 aware of the new fonts.
If you have a license for the Windows operating system without having it installed anywhere, you can download some fonts that belong to the Internet Explorer web browser that is part of the Windows operating system. The most valuable font distributed with the Internet Explorer web browser is Tahoma. Get it from here. In order to extract the actual TrueType fonts, execute the following:
cabextract --lowercase ielpkth.cab
Copy tahoma.ttf and tahomabd.ttf into /usr/X11R6/lib/X11/fonts/local and run SuSEconfig.
Congratulations, your TrueType fonts are now installed!
Adjusting your desktop preferences
Installing TrueType fonts does not modify your desktop preferences in any way. In order to take advantage of your new fonts, open your KDE or GNOME control center and choose one of your new fonts. The best screen fonts are Arial, Tahoma or Verdana at sizes from 8 to 10. If you prefer a serif font, try Georgia.
Note that anti-aliasing is no longer necessary since the TrueType bytecode interpreter was activated. Disable it completely or restrict it to sizes above 12 or 15.
You might want to adjust the preferences of your web browser as well. For Mozilla Firefox, open Edit - Preferences - General - Fonts & Colours and choose your new fonts there.

