Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 1282

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qfontdatabase.cpp -->
  <title>QFontDatabase Class | Qt GUI 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QFontDatabase</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<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>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QFontDatabase Class</h1>
<!-- $$$QFontDatabase-brief -->
<p>The <a href="qfontdatabase.html">QFontDatabase</a> class provides information about the fonts available in the underlying window system. <a href="#details">More...</a></p>
<!-- @@@QFontDatabase -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QFontDatabase&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += gui</td></tr></table></div><ul>
<li><a href="qfontdatabase-members.html">List of all members, including inherited members</a></li>
<li><a href="qfontdatabase-obsolete.html">Obsolete members</a></li>
</ul>
<p><b>Note:</b> All functions in this class are thread-safe.</p>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#SystemFont-enum">SystemFont</a></b> { GeneralFont, FixedFont, TitleFont, SmallestReadableFont }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#WritingSystem-enum">WritingSystem</a></b> { Any, Latin, Greek, Cyrillic, ..., Nko }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#QFontDatabase">QFontDatabase</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#bold">bold</a></b>(const QString &amp;<i>family</i>, const QString &amp;<i>style</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#families">families</a></b>(WritingSystem <i>writingSystem</i> = Any) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#font">font</a></b>(const QString &amp;<i>family</i>, const QString &amp;<i>style</i>, int <i>pointSize</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#isBitmapScalable">isBitmapScalable</a></b>(const QString &amp;<i>family</i>, const QString &amp;<i>style</i> = QString()) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#isFixedPitch">isFixedPitch</a></b>(const QString &amp;<i>family</i>, const QString &amp;<i>style</i> = QString()) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#isPrivateFamily">isPrivateFamily</a></b>(const QString &amp;<i>family</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#isScalable">isScalable</a></b>(const QString &amp;<i>family</i>, const QString &amp;<i>style</i> = QString()) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#isSmoothlyScalable">isSmoothlyScalable</a></b>(const QString &amp;<i>family</i>, const QString &amp;<i>style</i> = QString()) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#italic">italic</a></b>(const QString &amp;<i>family</i>, const QString &amp;<i>style</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;int&gt; </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#pointSizes">pointSizes</a></b>(const QString &amp;<i>family</i>, const QString &amp;<i>styleName</i> = QString())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;int&gt; </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#smoothSizes">smoothSizes</a></b>(const QString &amp;<i>family</i>, const QString &amp;<i>styleName</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#styleString">styleString</a></b>(const QFont &amp;<i>font</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#styleString-1">styleString</a></b>(const QFontInfo &amp;<i>fontInfo</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#styles">styles</a></b>(const QString &amp;<i>family</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#weight">weight</a></b>(const QString &amp;<i>family</i>, const QString &amp;<i>style</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;WritingSystem&gt; </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#writingSystems">writingSystems</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;WritingSystem&gt; </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#writingSystems-1">writingSystems</a></b>(const QString &amp;<i>family</i>) const</td></tr>
</table></div>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#addApplicationFont">addApplicationFont</a></b>(const QString &amp;<i>fileName</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#addApplicationFontFromData">addApplicationFontFromData</a></b>(const QByteArray &amp;<i>fontData</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#applicationFontFamilies">applicationFontFamilies</a></b>(int <i>id</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#removeAllApplicationFonts">removeAllApplicationFonts</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#removeApplicationFont">removeApplicationFont</a></b>(int <i>id</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;int&gt; </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#standardSizes">standardSizes</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#systemFont">systemFont</a></b>(SystemFont <i>type</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#writingSystemName">writingSystemName</a></b>(WritingSystem <i>writingSystem</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qfontdatabase.html#writingSystemSample">writingSystemSample</a></b>(WritingSystem <i>writingSystem</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QFontDatabase-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qfontdatabase.html">QFontDatabase</a> class provides information about the fonts available in the underlying window system.</p>
<p>The most common uses of this class are to query the database for the list of font <a href="qfontdatabase.html#families">families</a>() and for the <a href="qfontdatabase.html#pointSizes">pointSizes</a>() and <a href="qfontdatabase.html#styles">styles</a>() that are available for each family. An alternative to <a href="qfontdatabase.html#pointSizes">pointSizes</a>() is <a href="qfontdatabase.html#smoothSizes">smoothSizes</a>() which returns the sizes at which a given family and style will look attractive.</p>
<p>If the font family is available from two or more foundries the foundry name is included in the family name; for example: &quot;Helvetica [Adobe]&quot; and &quot;Helvetica [Cronyx]&quot;. When you specify a family, you can either use the old hyphenated &quot;foundry-family&quot; format or the bracketed &quot;family [foundry]&quot; format; for example: &quot;Cronyx-Helvetica&quot; or &quot;Helvetica [Cronyx]&quot;. If the family has a foundry it is always returned using the bracketed format, as is the case with the value returned by <a href="qfontdatabase.html#families">families</a>().</p>
<p>The <a href="qfontdatabase.html#font">font</a>() function returns a <a href="qfont.html">QFont</a> given a family, style and point size.</p>
<p>A family and style combination can be checked to see if it is <a href="qfontdatabase.html#italic">italic</a>() or <a href="qfontdatabase.html#bold">bold</a>(), and to retrieve its <a href="qfontdatabase.html#weight">weight</a>(). Similarly we can call <a href="qfontdatabase.html#isBitmapScalable">isBitmapScalable</a>(), <a href="qfontdatabase.html#isSmoothlyScalable">isSmoothlyScalable</a>(), <a href="qfontdatabase.html#isScalable">isScalable</a>() and <a href="qfontdatabase.html#isFixedPitch">isFixedPitch</a>().</p>
<p>Use the <a href="qfontdatabase.html#styleString">styleString</a>() to obtain a text version of a style.</p>
<p>The <a href="qfontdatabase.html">QFontDatabase</a> class also supports some static functions, for example, <a href="qfontdatabase.html#standardSizes">standardSizes</a>(). You can retrieve the description of a writing system using <a href="qfontdatabase.html#writingSystemName">writingSystemName</a>(), and a sample of characters in a writing system with <a href="qfontdatabase.html#writingSystemSample">writingSystemSample</a>().</p>
<p>Example:</p>
<pre class="cpp">

      <span class="type"><a href="qfontdatabase.html#QFontDatabase">QFontDatabase</a></span> database;
      <span class="type"><a href="../qtwidgets/qtreewidget.html">QTreeWidget</a></span> fontTree;
      fontTree<span class="operator">.</span>setColumnCount(<span class="number">2</span>);
      fontTree<span class="operator">.</span>setHeaderLabels(<span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span>() <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;Font&quot;</span> <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;Smooth Sizes&quot;</span>);

      foreach (<span class="keyword">const</span> <span class="type"><a href="../qtcore/qstring.html">QString</a></span> <span class="operator">&amp;</span>family<span class="operator">,</span> database<span class="operator">.</span>families()) {
          <span class="type"><a href="../qtwidgets/qtreewidgetitem.html">QTreeWidgetItem</a></span> <span class="operator">*</span>familyItem <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="../qtwidgets/qtreewidgetitem.html">QTreeWidgetItem</a></span>(<span class="operator">&amp;</span>fontTree);
          familyItem<span class="operator">-</span><span class="operator">&gt;</span>setText(<span class="number">0</span><span class="operator">,</span> family);

          foreach (<span class="keyword">const</span> <span class="type"><a href="../qtcore/qstring.html">QString</a></span> <span class="operator">&amp;</span>style<span class="operator">,</span> database<span class="operator">.</span>styles(family)) {
              <span class="type"><a href="../qtwidgets/qtreewidgetitem.html">QTreeWidgetItem</a></span> <span class="operator">*</span>styleItem <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="../qtwidgets/qtreewidgetitem.html">QTreeWidgetItem</a></span>(familyItem);
              styleItem<span class="operator">-</span><span class="operator">&gt;</span>setText(<span class="number">0</span><span class="operator">,</span> style);

              <span class="type"><a href="../qtcore/qstring.html">QString</a></span> sizes;
              foreach (<span class="type">int</span> points<span class="operator">,</span> database<span class="operator">.</span>smoothSizes(family<span class="operator">,</span> style))
                  sizes <span class="operator">+</span><span class="operator">=</span> <span class="type"><a href="../qtcore/qstring.html">QString</a></span><span class="operator">::</span>number(points) <span class="operator">+</span> <span class="char">' '</span>;

              styleItem<span class="operator">-</span><span class="operator">&gt;</span>setText(<span class="number">1</span><span class="operator">,</span> sizes<span class="operator">.</span>trimmed());
          }
      }

</pre>
<p>This example gets the list of font families, the list of styles for each family, and the point sizes that are available for each combination of family and style, displaying this information in a tree view.</p>
</div>
<p><b>See also </b><a href="qfont.html">QFont</a>, <a href="qfontinfo.html">QFontInfo</a>, <a href="qfontmetrics.html">QFontMetrics</a>, and <a href="../qtwidgets/qtwidgets-widgets-charactermap-example.html">Character Map Example</a>.</p>
<!-- @@@QFontDatabase -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$SystemFont$$$GeneralFont$$$FixedFont$$$TitleFont$$$SmallestReadableFont -->
<h3 class="fn" id="SystemFont-enum"><a name="SystemFont-enum"></a>enum QFontDatabase::<span class="name">SystemFont</span></h3>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QFontDatabase::GeneralFont</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The default system font.</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::FixedFont</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The fixed font that the system recommends.</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::TitleFont</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The system standard font for titles.</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::SmallestReadableFont</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">The smallest readable system font.</td></tr>
</table></div>
<p>This enum was introduced or modified in  Qt 5.2.</p>
<!-- @@@SystemFont -->
<!-- $$$WritingSystem$$$Any$$$Latin$$$Greek$$$Cyrillic$$$Armenian$$$Hebrew$$$Arabic$$$Syriac$$$Thaana$$$Devanagari$$$Bengali$$$Gurmukhi$$$Gujarati$$$Oriya$$$Tamil$$$Telugu$$$Kannada$$$Malayalam$$$Sinhala$$$Thai$$$Lao$$$Tibetan$$$Myanmar$$$Georgian$$$Khmer$$$SimplifiedChinese$$$TraditionalChinese$$$Japanese$$$Korean$$$Vietnamese$$$Symbol$$$Other$$$Ogham$$$Runic$$$Nko$$$WritingSystemsCount -->
<h3 class="fn" id="WritingSystem-enum"><a name="WritingSystem-enum"></a>enum QFontDatabase::<span class="name">WritingSystem</span></h3>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QFontDatabase::Any</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Latin</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Greek</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Cyrillic</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Armenian</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Hebrew</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Arabic</code></td><td class="topAlign tblval"><code>6</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Syriac</code></td><td class="topAlign tblval"><code>7</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Thaana</code></td><td class="topAlign tblval"><code>8</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Devanagari</code></td><td class="topAlign tblval"><code>9</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Bengali</code></td><td class="topAlign tblval"><code>10</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Gurmukhi</code></td><td class="topAlign tblval"><code>11</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Gujarati</code></td><td class="topAlign tblval"><code>12</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Oriya</code></td><td class="topAlign tblval"><code>13</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Tamil</code></td><td class="topAlign tblval"><code>14</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Telugu</code></td><td class="topAlign tblval"><code>15</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Kannada</code></td><td class="topAlign tblval"><code>16</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Malayalam</code></td><td class="topAlign tblval"><code>17</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Sinhala</code></td><td class="topAlign tblval"><code>18</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Thai</code></td><td class="topAlign tblval"><code>19</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Lao</code></td><td class="topAlign tblval"><code>20</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Tibetan</code></td><td class="topAlign tblval"><code>21</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Myanmar</code></td><td class="topAlign tblval"><code>22</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Georgian</code></td><td class="topAlign tblval"><code>23</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Khmer</code></td><td class="topAlign tblval"><code>24</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::SimplifiedChinese</code></td><td class="topAlign tblval"><code>25</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::TraditionalChinese</code></td><td class="topAlign tblval"><code>26</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Japanese</code></td><td class="topAlign tblval"><code>27</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Korean</code></td><td class="topAlign tblval"><code>28</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Vietnamese</code></td><td class="topAlign tblval"><code>29</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Symbol</code></td><td class="topAlign tblval"><code>30</code></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Other</code></td><td class="topAlign tblval"><code>Symbol</code></td><td class="topAlign">(the same as Symbol)</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Ogham</code></td><td class="topAlign tblval">?</td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Runic</code></td><td class="topAlign tblval">?</td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><code>QFontDatabase::Nko</code></td><td class="topAlign tblval">?</td><td class="topAlign">&nbsp;</td></tr>
</table></div>
<!-- @@@WritingSystem -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QFontDatabase[overload1]$$$QFontDatabase -->
<h3 class="fn" id="QFontDatabase"><a name="QFontDatabase"></a>QFontDatabase::<span class="name">QFontDatabase</span>()</h3>
<p>Creates a font database object.</p>
<!-- @@@QFontDatabase -->
<!-- $$$addApplicationFont[overload1]$$$addApplicationFontconstQString& -->
<h3 class="fn" id="addApplicationFont"><a name="addApplicationFont"></a><code>[static] </code><span class="type">int</span> QFontDatabase::<span class="name">addApplicationFont</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>fileName</i>)</h3>
<p>Loads the font from the file specified by <i>fileName</i> and makes it available to the application. An ID is returned that can be used to remove the font again with <a href="qfontdatabase.html#removeApplicationFont">removeApplicationFont</a>() or to retrieve the list of family names contained in the font.</p>
<p>The function returns -1 if the font could not be loaded.</p>
<p>Currently only TrueType fonts, TrueType font collections, and OpenType fonts are supported.</p>
<p><b>Note: </b>Adding application fonts on Unix/X11 platforms without fontconfig is currently not supported.</p><p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qfontdatabase.html#addApplicationFontFromData">addApplicationFontFromData</a>(), <a href="qfontdatabase.html#applicationFontFamilies">applicationFontFamilies</a>(), and <a href="qfontdatabase.html#removeApplicationFont">removeApplicationFont</a>().</p>
<!-- @@@addApplicationFont -->
<!-- $$$addApplicationFontFromData[overload1]$$$addApplicationFontFromDataconstQByteArray& -->
<h3 class="fn" id="addApplicationFontFromData"><a name="addApplicationFontFromData"></a><code>[static] </code><span class="type">int</span> QFontDatabase::<span class="name">addApplicationFontFromData</span>(const <span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> &amp;<i>fontData</i>)</h3>
<p>Loads the font from binary data specified by <i>fontData</i> and makes it available to the application. An ID is returned that can be used to remove the font again with <a href="qfontdatabase.html#removeApplicationFont">removeApplicationFont</a>() or to retrieve the list of family names contained in the font.</p>
<p>The function returns -1 if the font could not be loaded.</p>
<p>Currently only TrueType fonts and TrueType font collections are supported.</p>
<p><b>Note:</b> Adding application fonts on Unix/X11 platforms without fontconfig is currently not supported.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qfontdatabase.html#addApplicationFont">addApplicationFont</a>(), <a href="qfontdatabase.html#applicationFontFamilies">applicationFontFamilies</a>(), and <a href="qfontdatabase.html#removeApplicationFont">removeApplicationFont</a>().</p>
<!-- @@@addApplicationFontFromData -->
<!-- $$$applicationFontFamilies[overload1]$$$applicationFontFamiliesint -->
<h3 class="fn" id="applicationFontFamilies"><a name="applicationFontFamilies"></a><code>[static] </code><span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> QFontDatabase::<span class="name">applicationFontFamilies</span>(<span class="type">int</span> <i>id</i>)</h3>
<p>Returns a list of font families for the given application font identified by <i>id</i>.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qfontdatabase.html#addApplicationFont">addApplicationFont</a>() and <a href="qfontdatabase.html#addApplicationFontFromData">addApplicationFontFromData</a>().</p>
<!-- @@@applicationFontFamilies -->
<!-- $$$bold[overload1]$$$boldconstQString&constQString& -->
<h3 class="fn" id="bold"><a name="bold"></a><span class="type">bool</span> QFontDatabase::<span class="name">bold</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>family</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>style</i>) const</h3>
<p>Returns <code>true</code> if the font that has family <i>family</i> and style <i>style</i> is bold; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qfontdatabase.html#italic">italic</a>() and <a href="qfontdatabase.html#weight">weight</a>().</p>
<!-- @@@bold -->
<!-- $$$families[overload1]$$$familiesWritingSystem -->
<h3 class="fn" id="families"><a name="families"></a><span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> QFontDatabase::<span class="name">families</span>(<span class="type"><a href="qfontdatabase.html#WritingSystem-enum">WritingSystem</a></span> <i>writingSystem</i> = Any) const</h3>
<p>Returns a sorted list of the available font families which support the <i>writingSystem</i>.</p>
<p>If a family exists in several foundries, the returned name for that font is in the form &quot;family [foundry]&quot;. Examples: &quot;Times [Adobe]&quot;, &quot;Times [Cronyx]&quot;, &quot;Palatino&quot;.</p>
<p><b>See also </b><a href="qfontdatabase.html#writingSystems">writingSystems</a>().</p>
<!-- @@@families -->
<!-- $$$font[overload1]$$$fontconstQString&constQString&int -->
<h3 class="fn" id="font"><a name="font"></a><span class="type"><a href="qfont.html">QFont</a></span> QFontDatabase::<span class="name">font</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>family</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>style</i>, <span class="type">int</span> <i>pointSize</i>) const</h3>
<p>Returns a <a href="qfont.html">QFont</a> object that has family <i>family</i>, style <i>style</i> and point size <i>pointSize</i>. If no matching font could be created, a <a href="qfont.html">QFont</a> object that uses the application's default font is returned.</p>
<!-- @@@font -->
<!-- $$$isBitmapScalable[overload1]$$$isBitmapScalableconstQString&constQString& -->
<h3 class="fn" id="isBitmapScalable"><a name="isBitmapScalable"></a><span class="type">bool</span> QFontDatabase::<span class="name">isBitmapScalable</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>family</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>style</i> = QString()) const</h3>
<p>Returns <code>true</code> if the font that has family <i>family</i> and style <i>style</i> is a scalable bitmap font; otherwise returns <code>false</code>. Scaling a bitmap font usually produces an unattractive hardly readable result, because the pixels of the font are scaled. If you need to scale a bitmap font it is better to scale it to one of the fixed sizes returned by <a href="qfontdatabase.html#smoothSizes">smoothSizes</a>().</p>
<p><b>See also </b><a href="qfontdatabase.html#isScalable">isScalable</a>() and <a href="qfontdatabase.html#isSmoothlyScalable">isSmoothlyScalable</a>().</p>
<!-- @@@isBitmapScalable -->
<!-- $$$isFixedPitch[overload1]$$$isFixedPitchconstQString&constQString& -->
<h3 class="fn" id="isFixedPitch"><a name="isFixedPitch"></a><span class="type">bool</span> QFontDatabase::<span class="name">isFixedPitch</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>family</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>style</i> = QString()) const</h3>
<p>Returns <code>true</code> if the font that has family <i>family</i> and style <i>style</i> is fixed pitch; otherwise returns <code>false</code>.</p>
<!-- @@@isFixedPitch -->
<!-- $$$isPrivateFamily[overload1]$$$isPrivateFamilyconstQString& -->
<h3 class="fn" id="isPrivateFamily"><a name="isPrivateFamily"></a><span class="type">bool</span> QFontDatabase::<span class="name">isPrivateFamily</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>family</i>) const</h3>
<p>Returns <code>true</code> if and only if the <i>family</i> font family is private.</p>
<p>This happens, for instance, on macOS and iOS, where the system UI fonts are not accessible to the user. For completeness, <a href="qfontdatabase.html#families">QFontDatabase::families</a>() returns all font families, including the private ones. You should use this function if you are developing a font selection control in order to keep private fonts hidden.</p>
<p>This function was introduced in  Qt 5.5.</p>
<p><b>See also </b><a href="qfontdatabase.html#families">families</a>().</p>
<!-- @@@isPrivateFamily -->
<!-- $$$isScalable[overload1]$$$isScalableconstQString&constQString& -->
<h3 class="fn" id="isScalable"><a name="isScalable"></a><span class="type">bool</span> QFontDatabase::<span class="name">isScalable</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>family</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>style</i> = QString()) const</h3>
<p>Returns <code>true</code> if the font that has family <i>family</i> and style <i>style</i> is scalable; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qfontdatabase.html#isBitmapScalable">isBitmapScalable</a>() and <a href="qfontdatabase.html#isSmoothlyScalable">isSmoothlyScalable</a>().</p>
<!-- @@@isScalable -->
<!-- $$$isSmoothlyScalable[overload1]$$$isSmoothlyScalableconstQString&constQString& -->
<h3 class="fn" id="isSmoothlyScalable"><a name="isSmoothlyScalable"></a><span class="type">bool</span> QFontDatabase::<span class="name">isSmoothlyScalable</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>family</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>style</i> = QString()) const</h3>
<p>Returns <code>true</code> if the font that has family <i>family</i> and style <i>style</i> is smoothly scalable; otherwise returns <code>false</code>. If this function returns <code>true</code>, it's safe to scale this font to any size, and the result will always look attractive.</p>
<p><b>See also </b><a href="qfontdatabase.html#isScalable">isScalable</a>() and <a href="qfontdatabase.html#isBitmapScalable">isBitmapScalable</a>().</p>
<!-- @@@isSmoothlyScalable -->
<!-- $$$italic[overload1]$$$italicconstQString&constQString& -->
<h3 class="fn" id="italic"><a name="italic"></a><span class="type">bool</span> QFontDatabase::<span class="name">italic</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>family</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>style</i>) const</h3>
<p>Returns <code>true</code> if the font that has family <i>family</i> and style <i>style</i> is italic; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qfontdatabase.html#weight">weight</a>() and <a href="qfontdatabase.html#bold">bold</a>().</p>
<!-- @@@italic -->
<!-- $$$pointSizes[overload1]$$$pointSizesconstQString&constQString& -->
<h3 class="fn" id="pointSizes"><a name="pointSizes"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type">int</span>&gt; QFontDatabase::<span class="name">pointSizes</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>family</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>styleName</i> = QString())</h3>
<p>Returns a list of the point sizes available for the font that has family <i>family</i> and style <i>styleName</i>. The list may be empty.</p>
<p><b>See also </b><a href="qfontdatabase.html#smoothSizes">smoothSizes</a>() and <a href="qfontdatabase.html#standardSizes">standardSizes</a>().</p>
<!-- @@@pointSizes -->
<!-- $$$removeAllApplicationFonts[overload1]$$$removeAllApplicationFonts -->
<h3 class="fn" id="removeAllApplicationFonts"><a name="removeAllApplicationFonts"></a><code>[static] </code><span class="type">bool</span> QFontDatabase::<span class="name">removeAllApplicationFonts</span>()</h3>
<p>Removes all application-local fonts previously added using <a href="qfontdatabase.html#addApplicationFont">addApplicationFont</a>() and <a href="qfontdatabase.html#addApplicationFontFromData">addApplicationFontFromData</a>().</p>
<p>Returns <code>true</code> if unloading of the fonts succeeded; otherwise returns <code>false</code>.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qfontdatabase.html#removeApplicationFont">removeApplicationFont</a>(), <a href="qfontdatabase.html#addApplicationFont">addApplicationFont</a>(), and <a href="qfontdatabase.html#addApplicationFontFromData">addApplicationFontFromData</a>().</p>
<!-- @@@removeAllApplicationFonts -->
<!-- $$$removeApplicationFont[overload1]$$$removeApplicationFontint -->
<h3 class="fn" id="removeApplicationFont"><a name="removeApplicationFont"></a><code>[static] </code><span class="type">bool</span> QFontDatabase::<span class="name">removeApplicationFont</span>(<span class="type">int</span> <i>id</i>)</h3>
<p>Removes the previously loaded application font identified by <i>id</i>. Returns <code>true</code> if unloading of the font succeeded; otherwise returns <code>false</code>.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qfontdatabase.html#removeAllApplicationFonts">removeAllApplicationFonts</a>(), <a href="qfontdatabase.html#addApplicationFont">addApplicationFont</a>(), and <a href="qfontdatabase.html#addApplicationFontFromData">addApplicationFontFromData</a>().</p>
<!-- @@@removeApplicationFont -->
<!-- $$$smoothSizes[overload1]$$$smoothSizesconstQString&constQString& -->
<h3 class="fn" id="smoothSizes"><a name="smoothSizes"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type">int</span>&gt; QFontDatabase::<span class="name">smoothSizes</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>family</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>styleName</i>)</h3>
<p>Returns the point sizes of a font that has family <i>family</i> and style <i>styleName</i> that will look attractive. The list may be empty. For non-scalable fonts and bitmap scalable fonts, this function is equivalent to <a href="qfontdatabase.html#pointSizes">pointSizes</a>().</p>
<p><b>See also </b><a href="qfontdatabase.html#pointSizes">pointSizes</a>() and <a href="qfontdatabase.html#standardSizes">standardSizes</a>().</p>
<!-- @@@smoothSizes -->
<!-- $$$standardSizes[overload1]$$$standardSizes -->
<h3 class="fn" id="standardSizes"><a name="standardSizes"></a><code>[static] </code><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type">int</span>&gt; QFontDatabase::<span class="name">standardSizes</span>()</h3>
<p>Returns a list of standard font sizes.</p>
<p><b>See also </b><a href="qfontdatabase.html#smoothSizes">smoothSizes</a>() and <a href="qfontdatabase.html#pointSizes">pointSizes</a>().</p>
<!-- @@@standardSizes -->
<!-- $$$styleString[overload1]$$$styleStringconstQFont& -->
<h3 class="fn" id="styleString"><a name="styleString"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QFontDatabase::<span class="name">styleString</span>(const <span class="type"><a href="qfont.html">QFont</a></span> &amp;<i>font</i>)</h3>
<p>Returns a string that describes the style of the <i>font</i>. For example, &quot;Bold Italic&quot;, &quot;Bold&quot;, &quot;Italic&quot; or &quot;Normal&quot;. An empty string may be returned.</p>
<!-- @@@styleString -->
<!-- $$$styleString$$$styleStringconstQFontInfo& -->
<h3 class="fn" id="styleString-1"><a name="styleString-1"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QFontDatabase::<span class="name">styleString</span>(const <span class="type"><a href="qfontinfo.html">QFontInfo</a></span> &amp;<i>fontInfo</i>)</h3>
<p>Returns a string that describes the style of the <i>fontInfo</i>. For example, &quot;Bold Italic&quot;, &quot;Bold&quot;, &quot;Italic&quot; or &quot;Normal&quot;. An empty string may be returned.</p>
<!-- @@@styleString -->
<!-- $$$styles[overload1]$$$stylesconstQString& -->
<h3 class="fn" id="styles"><a name="styles"></a><span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span> QFontDatabase::<span class="name">styles</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>family</i>) const</h3>
<p>Returns a list of the styles available for the font family <i>family</i>. Some example styles: &quot;Light&quot;, &quot;Light Italic&quot;, &quot;Bold&quot;, &quot;Oblique&quot;, &quot;Demi&quot;. The list may be empty.</p>
<p><b>See also </b><a href="qfontdatabase.html#families">families</a>().</p>
<!-- @@@styles -->
<!-- $$$systemFont[overload1]$$$systemFontSystemFont -->
<h3 class="fn" id="systemFont"><a name="systemFont"></a><code>[static] </code><span class="type"><a href="qfont.html">QFont</a></span> QFontDatabase::<span class="name">systemFont</span>(<span class="type"><a href="qfontdatabase.html#SystemFont-enum">SystemFont</a></span> <i>type</i>)</h3>
<p>Returns the most adequate font for a given <i>type</i> case for proper integration with the system's look and feel.</p>
<p>This function was introduced in  Qt 5.2.</p>
<p><b>See also </b><a href="qguiapplication.html#font">QGuiApplication::font</a>().</p>
<!-- @@@systemFont -->
<!-- $$$weight[overload1]$$$weightconstQString&constQString& -->
<h3 class="fn" id="weight"><a name="weight"></a><span class="type">int</span> QFontDatabase::<span class="name">weight</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>family</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>style</i>) const</h3>
<p>Returns the weight of the font that has family <i>family</i> and style <i>style</i>. If there is no such family and style combination, returns -1.</p>
<p><b>See also </b><a href="qfontdatabase.html#italic">italic</a>() and <a href="qfontdatabase.html#bold">bold</a>().</p>
<!-- @@@weight -->
<!-- $$$writingSystemName[overload1]$$$writingSystemNameWritingSystem -->
<h3 class="fn" id="writingSystemName"><a name="writingSystemName"></a><code>[static] </code><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QFontDatabase::<span class="name">writingSystemName</span>(<span class="type"><a href="qfontdatabase.html#WritingSystem-enum">WritingSystem</a></span> <i>writingSystem</i>)</h3>
<p>Returns the names the <i>writingSystem</i> (e.g&#x2e; for displaying to the user in a dialog).</p>
<!-- @@@writingSystemName -->
<!-- $$$writingSystemSample[overload1]$$$writingSystemSampleWritingSystem -->
<h3 class="fn" id="writingSystemSample"><a name="writingSystemSample"></a><code>[static] </code><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QFontDatabase::<span class="name">writingSystemSample</span>(<span class="type"><a href="qfontdatabase.html#WritingSystem-enum">WritingSystem</a></span> <i>writingSystem</i>)</h3>
<p>Returns a string with sample characters from <i>writingSystem</i>.</p>
<!-- @@@writingSystemSample -->
<!-- $$$writingSystems[overload1]$$$writingSystems -->
<h3 class="fn" id="writingSystems"><a name="writingSystems"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qfontdatabase.html#WritingSystem-enum">WritingSystem</a></span>&gt; QFontDatabase::<span class="name">writingSystems</span>() const</h3>
<p>Returns a sorted list of the available writing systems. This is list generated from information about all installed fonts on the system.</p>
<p><b>See also </b><a href="qfontdatabase.html#families">families</a>().</p>
<!-- @@@writingSystems -->
<!-- $$$writingSystems$$$writingSystemsconstQString& -->
<h3 class="fn" id="writingSystems-1"><a name="writingSystems-1"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qfontdatabase.html#WritingSystem-enum">WritingSystem</a></span>&gt; QFontDatabase::<span class="name">writingSystems</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>family</i>) const</h3>
<p>Returns a sorted list of the writing systems supported by a given font <i>family</i>.</p>
<p><b>See also </b><a href="qfontdatabase.html#families">families</a>().</p>
<!-- @@@writingSystems -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    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.<br>    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. </p>
</div>
</body>
</html>