-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathintegration-cairo.html
66 lines (66 loc) · 3.69 KB
/
integration-cairo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Cairo integration: HarfBuzz Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="HarfBuzz Manual">
<link rel="up" href="integration.html" title="Platform Integration Guide">
<link rel="prev" href="integration-freetype.html" title="FreeType integration">
<link rel="next" href="integration-uniscribe.html" title="Uniscribe integration">
<meta name="generator" content="GTK-Doc V1.34.0 (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="integration.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="integration-freetype.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="integration-uniscribe.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="integration-cairo"></a>Cairo integration</h2></div></div></div>
<p>
Cairo is a 2D graphics library that is frequently used together
with GTK and Pango. Cairo supports rendering text using FreeType, or
by using callback-based 'user fonts'.
</p>
<p>
HarfBuzz provides integration points with cairo for fonts as well as
for buffers. To use the Cairo-integration API, link against libharfbuzz-cairo,
and include the <code class="filename">hb-cairo.h</code> header. For easy buildsystem
integration, HarfBuzz comes with a <code class="filename">harfbuzz-cairo.pc</code>
pkg-config file.
</p>
<p>
To create a <span class="type">cairo_scaled_font_t</span> font from a HarfBuzz
<span class="type">hb_font_t</span>, you can use <code class="function">hb_cairo_font_face_create_for_font()</code>
or <code class="function">hb_cairo_font_face_create_for_face()</code>. The former API
applies variations and synthetic slant from the <span class="type">hb_font_t</span> when
rendering, the latter takes them from the <span class="type">cairo_font_options_t</span>
that were passed when creating the <span class="type">cairo_scaled_font_t</span>.
</p>
<p>
The Cairo fonts created in this way make use of Cairo's user-font facilities.
They can be used to render on any Cairo context, and provide full support for
font rendering features, including color. One current limitation of the
implementation is that it does not support hinting for glyph outlines.
</p>
<p>
When using color fonts with this API, the color palette index is taken from
the <span class="type">cairo_font_options_t</span> (with new enough Cairo), and the foreground
color is extracted from the source of the Cairo context.
</p>
<p>
To render the results of shaping a piece of text, use
<code class="function">hb_cairo_glyphs_from_buffer()</code> to obtain the glyphs in
a form that can be passed to <code class="function">cairo_show_text_glyphs()</code> or
<code class="function">cairo_show_glyphs()</code>.
</p>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.34.0</div>
</body>
</html>