(root)/
harfbuzz-8.3.0/
docs/
html/
object-model-object-types.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Objects in HarfBuzz: HarfBuzz Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="HarfBuzz Manual">
<link rel="up" href="object-model.html" title="The HarfBuzz object model">
<link rel="prev" href="object-model.html" title="The HarfBuzz object model">
<link rel="next" href="object-model-lifecycle.html" title="Object lifecycle management">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="object-model.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="object-model.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="object-model-lifecycle.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="object-model-object-types"></a>Objects in HarfBuzz</h2></div></div></div>
<p>
      <span class="emphasis"><em>Object types:</em></span> Opaque struct types are used
      for what HarfBuzz loosely calls "objects."  This doesn’t have
      much to do with the terminology from object-oriented programming
      (OOP), although some of the concepts are similar.
    </p>
<p>
      In HarfBuzz, all object types provide certain
      lifecycle-management APIs.  Objects are reference-counted, and
      constructed with various <code class="function">create()</code> methods, referenced via
      <code class="function">reference()</code> and dereferenced using
      <code class="function">destroy()</code>.
    </p>
<p>
      For example,
      the <code class="literal">hb_buffer_t</code> object has
      <code class="function">hb_buffer_create()</code> as its constructor,
      <code class="function">hb_buffer_reference()</code> to reference, and
      <code class="function">hb_buffer_destroy()</code> to dereference.
    </p>
<p>
      After construction, each object's properties are accessible only
      through the setter and getter functions described in the API
      Reference manual.
    </p>
<p>
      Note that many object types can be marked as read-only or immutable,
      facilitating their use in multi-threaded environments.
    </p>
<p>
      Key object types provided by HarfBuzz include:
    </p>
<div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: disc; ">
<li class="listitem"><p>
	  <span class="emphasis"><em>blobs</em></span>, which act as low-level wrappers around binary
	  data. Blobs are typically used to hold the contents of a
	  binary font file.
	</p></li>
<li class="listitem"><p>
	  <span class="emphasis"><em>faces</em></span>, which represent typefaces from a
	  font file, but without specific parameters (such as size) set.
	</p></li>
<li class="listitem"><p>
	  <span class="emphasis"><em>fonts</em></span>, which represent instances of a
	  face with all of their parameters specified.
	</p></li>
<li class="listitem"><p>
	  <span class="emphasis"><em>buffers</em></span>, which hold Unicode code points
	  for characters (before shaping) and the shaped glyph output
	  (after shaping).
	</p></li>
<li class="listitem"><p>
	  <span class="emphasis"><em>shape plans</em></span>, which store the settings
	  that HarfBuzz will use when shaping a particular text
	  segment. Shape plans are not generally used by client
	  programs directly, but as we will see in a later chapter,
	  they are still valuable to understand.
	</p></li>
</ul></div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>