⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fonts-qws.html

📁 qtopiaphone英文帮助,用于初学者和开发人员,初学者可以用来学习,开发人员可以用来资料查询.
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Qt Toolkit -  Fonts in Qt/Embedded</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }--></style></head><body bgcolor="#ffffff"><p><table width="100%"><tr><td><a href="index.html"><img width="100" height="100" src="qtlogo.png"alt="Home" border="0"><img width="100"height="100" src="face.png" alt="Home" border="0"></a><td valign="top"><div align="right"><img src="dochead.png" width="472" height="27"><br><a href="classes.html"><b>Classes</b></a>- <a href="annotated.html">Annotated</a>- <a href="hierarchy.html">Tree</a>- <a href="functions.html">Functions</a>- <a href="index.html">Home</a>- <a href="topicals.html"><b>Structure</b>  <font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" align="center" size=32>Qte</font></a></div></table><h1 align="center"> Fonts in Qt/Embedded</h1><br clear="all"><h2>Supported formats</h2><p>Qt/Embedded supports four font formats:<p><ul> <li><b>TrueType (TTF)</b> - the scalable font technology now standard            on MS-Windows and Apple Macintosh, and becoming popular on X11. <li><b>Postscript Type1 (PFA/PFB)</b> - scalable fonts often used by printers,            also popular on X11. These are similar in functionality to TTF            fonts and are not discussed further in this document. <li><b>Bitmap Distribution Format fonts (BDF)</b> - a standard format            for non-scalable fonts. A large number of BDF fonts are            supplied as part of standard X11 distributions - most of            these can be used with Qt/Embedded. <li><b>Qt Prerendered Font (QPF)</b> - a light-weight non-scalable font            format specific to Qt/Embedded.</ul><p>Support for each of these font formats,except QPF which is always enabled,can be enabled or disabled independently by using the<a href=features.html>Qt/Embedded Features Definition</a>There is support inQt/Embedded for writing a QPF font file from any font, thus you caninitially enable TTF and BDF formats, save QPF files for the fonts andsizes you need, then remove TTF and BDF support.<p><h2>Memory requirements</h2><p>With TTF fonts, each character in the font at a given point size isonly rendered when first used in a drawing or metrics operation. WithBDF fonts all characters are rendered when the font is used.With QPF fonts, the characters are stored in the same format as Qt useswhen drawing.<p>As an example, a 10-point Times font containing the ASCII characters usesaround 1300 bytes when stored in QPF format.<p>Taking advantage of the way the QPF format is structured, Qt/Embeddedmemory-maps the data rather than reading and parsing it.This reduces the RAM consumption even further.<p>The scalable fonts use a larger amount of memory per font, butthese fonts can give a memory saving if many different sizes of eachfont are needed.<p><h2>Smooth fonts</h2><p>TTF, PFA, and QPF fonts can be rendered as <i>smooth</i> anti-aliasedfonts to give superior readability, especially on low-resolution devices.The difference between smooth and non-smooth fonts is illustrated below(you may need to change your display to low resolution to see the difference).<p><center><table><tr align="center"><td><img src="smooth.png"><td width=10%><td><img src="unsmooth.png"></table></center><p>In Qt/Embedded 2.2.1, smooth fonts use 8 times as much memory as non-smoothfonts. This multiplier will be reduced to a configurable2 or 4 (ie. 4-level and 16-level shading rather than the current excessive256-level shading).<p><h2>Unicode</h2><p>All fonts used by Qt/Embedded use the Unicode character encoding. Most fontsavailable today do not actually contain all the Unicode characters, but theydo use the Unicode characters ordering. A single <i>complete</i> 16-pointUnicode font uses over 1Mb of memory.<p><h2>The font definition file</h2><p>When Qt/Embedded applications run, they look for a file called<tt>$QTDIR/lib/fonts/fontdir</tt> or<tt>/usr/local/qt-embedded/lib/fonts/fontdir</tt>. This file defines thefonts available to the application. It has the following format:<p><blockquote>   <i>name</i> <i>file</i> <i>renderer</i> <i>italic</i> <i>weight</i> <i>size</i> <i>flags</i></blockquote><p>where:<p><blockquote><p><table><tr><td valign="top">      <i>name</i> <td> <b>Helvetica</b>, <b>Times</b>, etc.<tr><td valign="top">      <i>file</i> <td> <b>helvR0810.bdf</b>, <b>verdana.ttf</b>, etc.<tr><td valign="top">  <i>renderer</i> <td> <b>BDF</b> or <b>FT</b><tr><td valign="top">    <i>italic</i> <td> <b>y</b> or <b>n</b><tr><td valign="top">    <i>weight</i> <td> <b>50</b> is Normal, <b>75</b> is Bold, etc.<tr><td valign="top">      <i>size</i> <td> <b>0</b> for scalable or 10 times pointsize (eg. <b>120</b> for 12pt)<tr><td valign="top">     <i>flags</i> <td> Flag characters:<br>                        <b>s</b> = smooth (anti-aliased)<br>                        <b>u</b> = unicode range when saving (default is Latin 1)<br>                        <b>a</b> = ascii range when saving (default is Latin 1)<br></table></blockquote><p>The font definition file does not specify QPF fonts - these are loaded directly from the directory containing the <tt>fontdir</tt> file, and mustbe named <i>name</i>_<i>size</i>_<i>weight</i><i>italicflag</i>.qpf, where:<p><blockquote><p><table><tr><td valign="top">      <i>name</i> <td> <b>helvetica</b>, <b>times</b>, etc. (lowercase)<tr><td valign="top">      <i>size</i> <td> 10 times pointsize (eg. <b>120</b> for 12pt)<tr><td valign="top">    <i>italicflag</i> <td> <b>i</b> for italic or nothing.<tr><td valign="top">    <i>weight</i> <td> <b>50</b> is Normal, <b>75</b> is Bold, etc.</table></blockquote><p>If an application is run with the <tt>-savefonts</tt> command-line option,then whenever a font other than a QPF font is used, a corresponding QPF fileis saved. This allows you to easily find the font usage of your applicationsand to generate QPF files so that you can eventually reduce the memoryusage of your applications by disabling TTF and BDF support from Qt/Embedded.option, or by modifying the initialization of <tt>qws_savefonts</tt> in<tt>kernel/qapplication_qws.cpp</tt> of the Qt/Embedded library source code.In extreme cases of memory-saving, it is possible to save partially-renderedfonts (eg. only the characters in "Product Name<sup>TM</sup>") if you arecertain that these are the only characters you will need from the font.See QMemoryManager::savePrerenderedFont() for this functionality.<p><h2>Notes</h2><p>The font definition file, naming conventions for font files, and the formatof QPF files may change in versions of Qt/Embedded.<p>When enabled, Qt/Embedded uses the powerful FreeType2 library to implementTrueType and Type1 support.<p><h2>Helvetica BDF Fonts</h2><p><b>The Helvetica BDF font files supplied with Qt/Embedded are distributed under the following highlypermissive license.  We recommend that all Qt/Embedded installations that use these font files alsoacknowledge this contribution, and quote this licensestatement in an appendix to the documentation.</b> -- located in <tt>lib/fonts</tt><p>Copyright 1984-1989, 1994 Adobe Systems Incorporated.<p>Copyright 1988, 1994 Digital Equipment Corporation.<p>Adobe is a trademark of Adobe Systems Incorporated which may beregistered in certain jurisdictions.Permission to use these trademarks is hereby granted only inassociation with the images described in this file.<p>Permission to use, copy, modify, distribute and sell this softwareand its documentation for any purpose and without fee is herebygranted, provided that the above copyright notices appear in allcopies and that both those copyright notices and this permissionnotice appear in supporting documentation, and that the names ofAdobe Systems and Digital Equipment Corporation not be used inadvertising or publicity pertaining to distribution of the softwarewithout specific, written prior permission.  Adobe Systems andDigital Equipment Corporation make no representations about thesuitability of this software for any purpose.  It is provided "asis" without express or implied warranty.<p><address><hr><div align="center"><table width="100%" cellspacing="0" border="0"><tr><td>Copyright 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -