Sophie

Sophie

distrib > Fedora > 13 > x86_64 > by-pkgid > f5b8bf9ba5c3c0062e8b494b5ddab2e8 > files > 49

cairomm-devel-1.8.4-1.fc13.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
        <title>cairomm: Cairo::FtFontFace Class Reference</title>
        <link href="cairomm.css" rel="stylesheet" type="text/css">
    </head>
<body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespaceCairo.html">Cairo</a>::<a class="el" href="classCairo_1_1FtFontFace.html">FtFontFace</a>
  </div>
</div>
<div class="contents">
<h1>Cairo::FtFontFace Class Reference</h1><!-- doxytag: class="Cairo::FtFontFace" --><!-- doxytag: inherits="Cairo::FontFace" -->Inherits <a class="el" href="classCairo_1_1FontFace.html">Cairo::FontFace</a>.
<p>

<p>
<a href="classCairo_1_1FtFontFace-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>&lt; <a class="el" href="classCairo_1_1FtFontFace.html">FtFontFace</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1FtFontFace.html#f0c442d25f8615efb7655a6ae9279d3e">create</a> (FT_Face face, int load_flags)</td></tr>

<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new font face for the FreeType font backend from a pre-opened FreeType face.  <a href="#f0c442d25f8615efb7655a6ae9279d3e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>&lt; <a class="el" href="classCairo_1_1FtFontFace.html">FtFontFace</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1FtFontFace.html#eedb6692fef3a1c4d13dd52792a2267b">create</a> (FcPattern* pattern)</td></tr>

<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new font face for the FreeType font backend based on a fontconfig pattern.  <a href="#eedb6692fef3a1c4d13dd52792a2267b"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1FtFontFace.html#82d1ff7fb040ba4209511c4e4fbc57f5">FtFontFace</a> (FT_Face face, int load_flags)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCairo_1_1FtFontFace.html#76879f412bddbfa3b6c2350c3fa69aa6">FtFontFace</a> (FcPattern* pattern)</td></tr>

</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="82d1ff7fb040ba4209511c4e4fbc57f5"></a><!-- doxytag: member="Cairo::FtFontFace::FtFontFace" ref="82d1ff7fb040ba4209511c4e4fbc57f5" args="(FT_Face face, int load_flags)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Cairo::FtFontFace::FtFontFace           </td>
          <td>(</td>
          <td class="paramtype">FT_Face&#160;</td>
          <td class="paramname"> <em>face</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>load_flags</em></td><td>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<a class="anchor" name="76879f412bddbfa3b6c2350c3fa69aa6"></a><!-- doxytag: member="Cairo::FtFontFace::FtFontFace" ref="76879f412bddbfa3b6c2350c3fa69aa6" args="(FcPattern *pattern)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Cairo::FtFontFace::FtFontFace           </td>
          <td>(</td>
          <td class="paramtype">FcPattern *&#160;</td>
          <td class="paramname"> <em>pattern</em>          </td>
          <td>&#160;)&#160;</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="eedb6692fef3a1c4d13dd52792a2267b"></a><!-- doxytag: member="Cairo::FtFontFace::create" ref="eedb6692fef3a1c4d13dd52792a2267b" args="(FcPattern *pattern)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>&lt;<a class="el" href="classCairo_1_1FtFontFace.html">FtFontFace</a>&gt; Cairo::FtFontFace::create           </td>
          <td>(</td>
          <td class="paramtype">FcPattern *&#160;</td>
          <td class="paramname"> <em>pattern</em>          </td>
          <td>&#160;)&#160;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Creates a new font face for the FreeType font backend based on a fontconfig pattern. 
<p>
This font can then be used with <a class="el" href="classCairo_1_1Context.html#9b344db51097aba30e36452e1364faef">Context::set_font_face()</a> or <a class="el" href="classCairo_1_1FtScaledFont.html#3c247841af3702cd28ab89b9f843a67e" title="Creates a ScaledFont From a FtFontFace.">FtScaledFont::create()</a>.<p>
Font rendering options are represented both here and when you call <a class="el" href="classCairo_1_1FtScaledFont.html#3c247841af3702cd28ab89b9f843a67e" title="Creates a ScaledFont From a FtFontFace.">FtScaledFont::create()</a>. Font options that have a representation in a FcPattern must be passed in here; to modify FcPattern appropriately to reflect the options in a <a class="el" href="classCairo_1_1FontOptions.html" title="How a font should be rendered.">FontOptions</a>, call <a class="el" href="classCairo_1_1FontOptions.html#e42f40768de7a6f0da085a4940dc6ce3" title="Add options to a FcPattern based on a cairo_font_options_t font options object.">FontOptions::substitute()</a>.<p>
The pattern's FC_FT_FACE element is inspected first and if that is set, that will be the FreeType font face associated with the returned cairo font face. Otherwise the FC_FILE and FC_INDEX elements of pattern are used to load a font face from file.<p>
If the FC_FT_FACE element of pattern is set, the user is responsible for making sure that the referenced FT_Face remains valid for the life time of the returned <a class="el" href="classCairo_1_1FtFontFace.html">FtFontFace</a>. See <a class="el" href="classCairo_1_1FtFontFace.html#f0c442d25f8615efb7655a6ae9279d3e" title="Creates a new font face for the FreeType font backend from a pre-opened FreeType...">FtFontFace::create()</a> for an exmaple of how to couple the life time of the FT_Face to that of the cairo font-face.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pattern</em>&#160;</td><td>A fully resolved fontconfig pattern. A pattern can be resolved, by, among other things, calling FcConfigSubstitute(), FcDefaultSubstitute(), then FcFontMatch(). <a class="el" href="namespaceCairo.html">Cairo</a> will call FcPatternReference() on this pattern, so you should not further modify the pattern, but you can release your reference to the pattern with FcPatternDestroy() if you no longer need to access it.</td></tr>
  </table>
</dl>
<dl class="since" compact><dt><b>Since:</b></dt><dd>1.8 </dd></dl>

</div>
</div><p>
<a class="anchor" name="f0c442d25f8615efb7655a6ae9279d3e"></a><!-- doxytag: member="Cairo::FtFontFace::create" ref="f0c442d25f8615efb7655a6ae9279d3e" args="(FT_Face face, int load_flags)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classCairo_1_1RefPtr.html">RefPtr</a>&lt;<a class="el" href="classCairo_1_1FtFontFace.html">FtFontFace</a>&gt; Cairo::FtFontFace::create           </td>
          <td>(</td>
          <td class="paramtype">FT_Face&#160;</td>
          <td class="paramname"> <em>face</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>load_flags</em></td><td>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Creates a new font face for the FreeType font backend from a pre-opened FreeType face. 
<p>
This font can then be used with <a class="el" href="classCairo_1_1Context.html#9b344db51097aba30e36452e1364faef">Context::set_font_face()</a> or <a class="el" href="classCairo_1_1FtScaledFont.html#3c247841af3702cd28ab89b9f843a67e" title="Creates a ScaledFont From a FtFontFace.">FtScaledFont::create()</a>.<p>
As an example, here is how one might correctly couple the lifetime of the FreeType face object to the <a class="el" href="classCairo_1_1FtFontFace.html">FtFontFace</a>: <div class="fragment"><pre class="fragment"> <span class="keyword">static</span> <span class="keyword">const</span> cairo_user_data_key_t key;

 font_face = cairo_ft_font_face_create_for_ft_face (ft_face, 0);
 status = cairo_font_face_set_user_data (font_face, &amp;key,
                                ft_face, (cairo_destroy_func_t) FT_Done_Face);
 <span class="keywordflow">if</span> (status) {
    cairo_font_face_destroy (font_face);
    FT_Done_Face (ft_face);
    <span class="keywordflow">return</span> ERROR;
 }
</pre></div><p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>face</em>&#160;</td><td>A FreeType face object, already opened. This must be kept around until the face's ref_count drops to zero and it is freed. Since the face may be referenced internally to <a class="el" href="namespaceCairo.html">Cairo</a>, the best way to determine when it is safe to free the face is to pass a cairo_destroy_func_t to cairo_font_face_set_user_data(). </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>load_flags</em>&#160;</td><td>flags to pass to FT_Load_Glyph when loading glyphs from the font. These flags are OR'ed together with the flags derived from the cairo_font_options_t passed to cairo_scaled_font_create(), so only a few values such as FT_LOAD_VERTICAL_LAYOUT, and FT_LOAD_FORCE_AUTOHINT are useful. You should not pass any of the flags affecting the load target, such as FT_LOAD_TARGET_LIGHT.</td></tr>
  </table>
</dl>
<dl class="since" compact><dt><b>Since:</b></dt><dd>1.8 </dd></dl>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>cairomm/fontface.h</ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Thu Aug 13 11:40:14 2009 for cairomm by&#160;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>