| /**************************************************************************** |
| ** |
| ** Copyright (C) 2016 The Qt Company Ltd. |
| ** Contact: https://www.qt.io/licensing/ |
| ** |
| ** This file is part of the documentation of the Qt Toolkit. |
| ** |
| ** $QT_BEGIN_LICENSE:FDL$ |
| ** Commercial License Usage |
| ** Licensees holding valid commercial Qt licenses may use this file in |
| ** accordance with the commercial license agreement provided with the |
| ** Software or, alternatively, in accordance with the terms contained in |
| ** a written agreement between you and The Qt Company. For licensing terms |
| ** and conditions see https://www.qt.io/terms-conditions. For further |
| ** information use the contact form at https://www.qt.io/contact-us. |
| ** |
| ** GNU Free Documentation License Usage |
| ** Alternatively, this file may be used under the terms of the GNU Free |
| ** Documentation License version 1.3 as published by the Free Software |
| ** Foundation and appearing in the file included in the packaging of |
| ** this file. Please review the following information to ensure |
| ** the GNU Free Documentation License version 1.3 requirements |
| ** will be met: https://www.gnu.org/licenses/fdl-1.3.html. |
| ** $QT_END_LICENSE$ |
| ** |
| ****************************************************************************/ |
| |
| /*! |
| \page qt-embedded-fonts.html |
| |
| \title Qt for Embedded Linux Fonts |
| \ingroup qt-embedded-linux |
| |
| Qt normally uses \tt{fontconfig} to provide access to system fonts. If |
| \tt{fontconfig} is not available, e.g. in dedicated embedded systems where |
| space is at a premium, Qt will fall back to using \c QBasicFontDatabase. In |
| this case, Qt applications will look for fonts in Qt's \c lib/fonts/ |
| directory. Qt will automatically detect prerendered fonts and TrueType fonts. |
| |
| Qt uses the |
| \l{http://freetype.sourceforge.net/freetype2/index.html}{FreeType 2} |
| font engine to produce font output. The formats supported depends on |
| the locally installed version of the FreeType library. When using QBasicFontDatabase, |
| Qt also supports the Qt Prerendered Font format (\l QPF2), |
| a light-weight non-scalable font formats. |
| QPF2 is the native format of Qt for Embedded Linux 4.x. |
| |
| \image qt-embedded-fontfeatures.png |
| |
| All supported fonts use the Unicode character encoding. Most fonts |
| available today do, but they usually don't contain \e all the |
| Unicode characters. A complete 16-point Unicode font uses over 1 |
| MB of memory. |
| |
| \target FreeType |
| \section1 FreeType Formats |
| |
| The \l {http://freetype.sourceforge.net/freetype2/index.html}{FreeType 2} |
| library can support the following font formats: |
| |
| \list |
| \li TrueType (TTF) |
| \li PostScript Type1 (PFA/PFB) |
| \li Bitmap Distribution Format (BDF) |
| \li CID-keyed Type1 |
| \li Compact Font Format (CFF) |
| \li OpenType fonts |
| \li SFNT-based bitmap fonts |
| \li Portable Compiled Format (PCF) |
| \li Microsoft Windows Font File Format (Windows FNT) |
| \li Portable Font Resource (PFR) |
| \li Type 42 (limited support) |
| \endlist |
| |
| It is possible to add modules to the \l |
| {http://freetype.sourceforge.net/freetype2/index.html}{FreeType 2} |
| font engine to support other types of font files. For more |
| information, see the font engine's own website: \l |
| http://freetype.sourceforge.net/freetype2/index.html. |
| |
| Glyphs rendered using FreeType are shared efficiently between applications, |
| reducing memory requirements and speeding up text rendering. |
| |
| \omit |
| Qt will by default use the system FreeType library if it exists. |
| Otherwise it will use a copy of the FreeType library in Qt, which by default only |
| supports TrueType fonts to reduce footprint. |
| \endomit |
| |
| \target QPF2 |
| \section1 Qt Prerendered Font (QPF2) |
| |
| The Qt Prerendered Font (QPF2) is an architecture-independent, |
| light-weight and non-scalable font format. |
| |
| Qt comes with the cross-platform \l makeqpf tool, included in the |
| \c tools directory, which allows |
| generation of QPF2 files from system fonts. |
| |
| QPF2 supports anti-aliasing and complex writing systems, using information |
| from the corresponding TrueType font, if present on the system. The format |
| is designed to be mapped directly to memory. The same format is used to |
| share glyphs from non-prerendered fonts between applications. |
| |
| \omit |
| \section1 Memory Requirements |
| |
| Taking advantage of the way the QPF format is structured, Qt for |
| Embedded Linux memory-maps the data rather than reading and parsing it. |
| This reduces RAM consumption even further. |
| |
| Scalable fonts use a larger amount of memory per font, but |
| these fonts provide a memory saving if many different sizes of each |
| font are needed. |
| \endomit |
| |
| */ |