Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 6159

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qplatformfontdatabase_qpa.cpp -->
  <title>Qt 4.8: QPlatformFontDatabase Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QPlatformFontDatabase</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QPlatformFontDatabase Class Reference</h1>
<!-- $$$QPlatformFontDatabase-brief -->
<p>The QPlatformFontDatabase class makes it possible to customize how fonts are discovered and how they are rendered <a href="#details">More...</a></p>
<!-- @@@QPlatformFontDatabase -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QPlatformFontDatabase&gt;</span></pre><p>This class was introduced in Qt 4.8.</p>
<ul>
<li><a href="qplatformfontdatabase-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual QStringList </td><td class="memItemRight bottomAlign"><b><a href="qplatformfontdatabase.html#addApplicationFont">addApplicationFont</a></b> ( const QByteArray &amp; <i>fontData</i>, const QString &amp; <i>fileName</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QStringList </td><td class="memItemRight bottomAlign"><b><a href="qplatformfontdatabase.html#fallbacksForFamily">fallbacksForFamily</a></b> ( const QString <i>family</i>, const QFont::Style &amp; <i>style</i>, const QFont::StyleHint &amp; <i>styleHint</i>, const QUnicodeTables::Script &amp; <i>script</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QString </td><td class="memItemRight bottomAlign"><b><a href="qplatformfontdatabase.html#fontDir">fontDir</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QFontEngine * </td><td class="memItemRight bottomAlign"><b><a href="qplatformfontdatabase.html#fontEngine">fontEngine</a></b> ( const QFontDef &amp; <i>fontDef</i>, QUnicodeTables::Script <i>script</i>, void * <i>handle</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QFontEngine * </td><td class="memItemRight bottomAlign"><b><a href="qplatformfontdatabase.html#fontEngine-2">fontEngine</a></b> ( const QByteArray &amp; <i>fontData</i>, qreal <i>pixelSize</i>, QFont::HintingPreference <i>hintingPreference</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qplatformfontdatabase.html#populateFontDatabase">populateFontDatabase</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qplatformfontdatabase.html#releaseHandle">releaseHandle</a></b> ( void * <i>handle</i> )</td></tr>
</table>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformfontdatabase.html#registerFont">registerFont</a></b> ( const QString &amp; <i>familyName</i>, const QString &amp; <i>foundryName</i>, QFont::Weight <i>weight</i>, QFont::Style <i>style</i>, QFont::Stretch <i>stretch</i>, bool <i>antialiased</i>, bool <i>scalable</i>, int <i>pixelSize</i>, const QSupportedWritingSystems &amp; <i>writingSystems</i>, void * <i>usrPtr</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qplatformfontdatabase.html#registerQPF2Font">registerQPF2Font</a></b> ( const QByteArray &amp; <i>dataArray</i>, void * <i>handle</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QPlatformFontDatabase-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QPlatformFontDatabase class makes it possible to customize how fonts are discovered and how they are rendered</p>
<p>QPlatformFontDatabase is the superclass which is intended to let platform implementations use native font handling.</p>
<p>Qt has its internal font database which it uses to discover available fonts on the user's system. To be able to populate this database subclass this class, and reimplement <a href="qplatformfontdatabase.html#populateFontDatabase">populateFontDatabase</a>().</p>
<p>Use the function <a href="qplatformfontdatabase.html#registerFont">registerFont</a>() to populate the internal font database.</p>
<p>Sometimes a specified font does not have the required glyphs; in such a case, the fallbackForFamily() function is called automatically to find alternative font families that can supply alternatives to the missing glyphs.</p>
</div>
<p><b>See also </b><a href="qsupportedwritingsystems.html">QSupportedWritingSystems</a>.</p>
<!-- @@@QPlatformFontDatabase -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$addApplicationFont[overload1]$$$addApplicationFontconstQByteArray&constQString& -->
<h3 class="fn"><a name="addApplicationFont"></a><span class="type"><a href="qstringlist.html">QStringList</a></span> QPlatformFontDatabase::<span class="name">addApplicationFont</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>fontData</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>fileName</i> )<tt> [virtual]</tt></h3>
<p>Adds an application font described by the font contained supplied <i>fontData</i> or using the font contained in the file referenced by <i>fileName</i>. Returns a list of family names, or an empty list if the font could not be added.</p>
<p><b>Note:</b> The default implementation of this function does not add an application font. Subclasses should reimplement this function to perform the necessary loading and registration of fonts.</p>
<!-- @@@addApplicationFont -->
<!-- $$$fallbacksForFamily[overload1]$$$fallbacksForFamilyconstQStringconstQFont::Style&constQFont::StyleHint&constQUnicodeTables::Script& -->
<h3 class="fn"><a name="fallbacksForFamily"></a><span class="type"><a href="qstringlist.html">QStringList</a></span> QPlatformFontDatabase::<span class="name">fallbacksForFamily</span> ( const <span class="type"><a href="qstring.html">QString</a></span> <i>family</i>, const <span class="type"><a href="qfont.html#Style-enum">QFont::Style</a></span> &amp; <i>style</i>, const <span class="type"><a href="qfont.html#StyleHint-enum">QFont::StyleHint</a></span> &amp; <i>styleHint</i>, const <span class="type"><a href="qunicodetables.html#Script-enum">QUnicodeTables::Script</a></span> &amp; <i>script</i> ) const<tt> [virtual]</tt></h3>
<p>Returns a list of alternative fonts for the specified <i>family</i> and <i>style</i> and <i>script</i> using the <i>styleHint</i> given.</p>
<!-- @@@fallbacksForFamily -->
<!-- $$$fontDir[overload1]$$$fontDir -->
<h3 class="fn"><a name="fontDir"></a><span class="type"><a href="qstring.html">QString</a></span> QPlatformFontDatabase::<span class="name">fontDir</span> () const<tt> [virtual]</tt></h3>
<p>Returns the path to the font directory.</p>
<p>The font directory is stored in the general Qt settings unless it has been overridden by the <tt>QT_QPA_FONTDIR</tt> environment variable.</p>
<p>When using builds of Qt that do not support settings, the <tt>QT_QPA_FONTDIR</tt> environment variable is the only way to specify the font directory.</p>
<!-- @@@fontDir -->
<!-- $$$fontEngine[overload1]$$$fontEngineconstQFontDef&QUnicodeTables::Scriptvoid* -->
<h3 class="fn"><a name="fontEngine"></a><span class="type">QFontEngine</span> * QPlatformFontDatabase::<span class="name">fontEngine</span> ( const <span class="type">QFontDef</span> &amp; <i>fontDef</i>, <span class="type"><a href="qunicodetables.html#Script-enum">QUnicodeTables::Script</a></span> <i>script</i>, <span class="type">void</span> * <i>handle</i> )<tt> [virtual]</tt></h3>
<p>Returns the font engine that can be used to render the font described by the font definition, <i>fontDef</i>, in the specified <i>script</i>.</p>
<!-- @@@fontEngine -->
<!-- $$$fontEngine$$$fontEngineconstQByteArray&qrealQFont::HintingPreference -->
<h3 class="fn"><a name="fontEngine-2"></a><span class="type">QFontEngine</span> * QPlatformFontDatabase::<span class="name">fontEngine</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>fontData</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>pixelSize</i>, <span class="type"><a href="qfont.html#HintingPreference-enum">QFont::HintingPreference</a></span> <i>hintingPreference</i> )<tt> [virtual]</tt></h3>
<!-- @@@fontEngine -->
<!-- $$$populateFontDatabase[overload1]$$$populateFontDatabase -->
<h3 class="fn"><a name="populateFontDatabase"></a><span class="type">void</span> QPlatformFontDatabase::<span class="name">populateFontDatabase</span> ()<tt> [virtual]</tt></h3>
<p>This function is called once at startup by Qts internal fontdatabase. Reimplement this function in a subclass for a convenient place to initialise the internal fontdatabase.</p>
<p>The default implementation looks in the <a href="qplatformfontdatabase.html#fontDir">fontDir</a>() location and registers all qpf2 fonts.</p>
<!-- @@@populateFontDatabase -->
<!-- $$$registerFont[overload1]$$$registerFontconstQString&constQString&QFont::WeightQFont::StyleQFont::StretchboolboolintconstQSupportedWritingSystems&void* -->
<h3 class="fn"><a name="registerFont"></a><span class="type">void</span> QPlatformFontDatabase::<span class="name">registerFont</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>familyName</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>foundryName</i>, <span class="type"><a href="qfont.html#Weight-enum">QFont::Weight</a></span> <i>weight</i>, <span class="type"><a href="qfont.html#Style-enum">QFont::Style</a></span> <i>style</i>, <span class="type"><a href="qfont.html#Stretch-enum">QFont::Stretch</a></span> <i>stretch</i>, <span class="type">bool</span> <i>antialiased</i>, <span class="type">bool</span> <i>scalable</i>, <span class="type">int</span> <i>pixelSize</i>, const <span class="type"><a href="qsupportedwritingsystems.html">QSupportedWritingSystems</a></span> &amp; <i>writingSystems</i>, <span class="type">void</span> * <i>usrPtr</i> )<tt> [static]</tt></h3>
<p>Registers a font with the given set of attributes describing the font's foundry, family name, style and stretch information, pixel size, and supported writing systems. Additional information about whether the font can be scaled and antialiased can also be provided.</p>
<p>The foundry name and font family are described by <i>foundryName</i> and <i>familyName</i>. The font weight (light, normal, bold, etc.), style (normal, oblique, italic) and stretch information (condensed, expanded, unstretched, etc.) are specified by <i>weight</i>, <i>style</i> and <i>stretch</i>.</p>
<p>Some fonts can be antialiased and scaled; <i>scalable</i> and <i>antialiased</i> can be set to true for fonts with these attributes. The intended pixel size of non-scalable fonts is specified by <i>pixelSize</i>; this value will be ignored for scalable fonts.</p>
<p>The writing systems supported by the font are specified by the <i>writingSystems</i> argument.</p>
<p><b>See also </b><a href="qplatformfontdatabase.html#registerQPF2Font">registerQPF2Font</a>().</p>
<!-- @@@registerFont -->
<!-- $$$registerQPF2Font[overload1]$$$registerQPF2FontconstQByteArray&void* -->
<h3 class="fn"><a name="registerQPF2Font"></a><span class="type">void</span> QPlatformFontDatabase::<span class="name">registerQPF2Font</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>dataArray</i>, <span class="type">void</span> * <i>handle</i> )<tt> [static]</tt></h3>
<p>Registers the pre-rendered QPF2 font contained in the given <i>dataArray</i>.</p>
<p><b>See also </b><a href="qplatformfontdatabase.html#registerFont">registerFont</a>().</p>
<!-- @@@registerQPF2Font -->
<!-- $$$releaseHandle[overload1]$$$releaseHandlevoid* -->
<h3 class="fn"><a name="releaseHandle"></a><span class="type">void</span> QPlatformFontDatabase::<span class="name">releaseHandle</span> ( <span class="type">void</span> * <i>handle</i> )<tt> [virtual]</tt></h3>
<p>Releases the font handle and deletes any associated data loaded from a file.</p>
<!-- @@@releaseHandle -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Qt and respective logos are trademarks of The Qt Company Ltd 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>