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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Scaled Fonts</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="Cairo: A Vector Graphics Library">
<link rel="up" href="Fonts.html" title="Fonts">
<link rel="prev" href="cairo-cairo-font-face-t.html" title="cairo_font_face_t">
<link rel="next" href="cairo-Font-Options.html" title="Font Options">
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="part" href="pt01.html" title="Part I. Tutorial">
<link rel="part" href="pt02.html" title="Part II. Reference">
<link rel="chapter" href="Drawing.html" title="Drawing">
<link rel="chapter" href="Fonts.html" title="Fonts">
<link rel="chapter" href="Surfaces.html" title="Surfaces">
<link rel="chapter" href="Support.html" title="Utilities">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of new symbols in 1.2">
<link rel="appendix" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
</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="2">
<tr valign="middle">
<td><a accesskey="p" href="cairo-cairo-font-face-t.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="Fonts.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Cairo: A Vector Graphics Library</th>
<td><a accesskey="n" href="cairo-Font-Options.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#top_of_page" class="shortcut">Top</a>
 | 
<a href="#desc" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="cairo-Scaled-Fonts"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="top_of_page"></a>Scaled Fonts</span></h2>
<p>Scaled Fonts — Caching metrics for a particular font size</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
typedef <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a>;
<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a>* <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-create">cairo_scaled_font_create</a>
(<a href="cairo-cairo-font-face-t.html#cairo-font-face-t">cairo_font_face_t</a> *font_face,
const <a href="cairo-cairo-matrix-t.html#cairo-matrix-t">cairo_matrix_t</a> *font_matrix,
const <a href="cairo-cairo-matrix-t.html#cairo-matrix-t">cairo_matrix_t</a> *ctm,
const <a href="cairo-Font-Options.html#cairo-font-options-t">cairo_font_options_t</a> *options);
<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a>* <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-reference">cairo_scaled_font_reference</a>
(<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font);
void <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-destroy">cairo_scaled_font_destroy</a> (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font);
<a href="cairo-Error-handling.html#cairo-status-t">cairo_status_t</a> <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-status">cairo_scaled_font_status</a> (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font);
<a href="cairo-Scaled-Fonts.html#cairo-font-extents-t">cairo_font_extents_t</a>;
void <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-extents">cairo_scaled_font_extents</a> (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font,
<a href="cairo-Scaled-Fonts.html#cairo-font-extents-t">cairo_font_extents_t</a> *extents);
<a href="cairo-Scaled-Fonts.html#cairo-text-extents-t">cairo_text_extents_t</a>;
void <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-text-extents">cairo_scaled_font_text_extents</a> (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font,
const char *utf8,
<a href="cairo-Scaled-Fonts.html#cairo-text-extents-t">cairo_text_extents_t</a> *extents);
void <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-glyph-extents">cairo_scaled_font_glyph_extents</a> (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font,
<a href="cairo-Text.html#cairo-glyph-t">cairo_glyph_t</a> *glyphs,
int num_glyphs,
<a href="cairo-Scaled-Fonts.html#cairo-text-extents-t">cairo_text_extents_t</a> *extents);
<a href="cairo-cairo-font-face-t.html#cairo-font-face-t">cairo_font_face_t</a>* <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-get-font-face">cairo_scaled_font_get_font_face</a>
(<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font);
void <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-get-font-options">cairo_scaled_font_get_font_options</a>
(<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font,
<a href="cairo-Font-Options.html#cairo-font-options-t">cairo_font_options_t</a> *options);
void <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-get-font-matrix">cairo_scaled_font_get_font_matrix</a>
(<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font,
<a href="cairo-cairo-matrix-t.html#cairo-matrix-t">cairo_matrix_t</a> *font_matrix);
void <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-get-ctm">cairo_scaled_font_get_ctm</a> (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font,
<a href="cairo-cairo-matrix-t.html#cairo-matrix-t">cairo_matrix_t</a> *ctm);
<a href="cairo-cairo-font-face-t.html#cairo-font-type-t">cairo_font_type_t</a> <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-get-type">cairo_scaled_font_get_type</a>
(<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="desc"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1" lang="en">
<a name="details"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2713545"></a><h3>
<a name="cairo-scaled-font-t"></a>cairo_scaled_font_t</h3>
<a class="indexterm" name="id2713557"></a><pre class="programlisting">typedef struct _cairo_scaled_font cairo_scaled_font_t;
</pre>
<p>
A <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a> is a font scaled to a particular size and device
resolution. A cairo_scaled_font_t is most useful for low-level font
usage where a library or application wants to cache a reference
to a scaled font to speed up the computation of metrics.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2713588"></a><h3>
<a name="cairo-scaled-font-create"></a>cairo_scaled_font_create ()</h3>
<a class="indexterm" name="id2713599"></a><pre class="programlisting"><a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a>* cairo_scaled_font_create
(<a href="cairo-cairo-font-face-t.html#cairo-font-face-t">cairo_font_face_t</a> *font_face,
const <a href="cairo-cairo-matrix-t.html#cairo-matrix-t">cairo_matrix_t</a> *font_matrix,
const <a href="cairo-cairo-matrix-t.html#cairo-matrix-t">cairo_matrix_t</a> *ctm,
const <a href="cairo-Font-Options.html#cairo-font-options-t">cairo_font_options_t</a> *options);</pre>
<p>
Creates a <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a> object from a font face and matrices that
describe the size of the font and the environment in which it will
be used.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>font_face</code></em> :</span></td>
<td> a <a href="cairo-cairo-font-face-t.html#cairo-font-face-t"><span class="type">cairo_font_face_t</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>font_matrix</code></em> :</span></td>
<td> font space to user space transformation matrix for the
font. In the simplest case of a N point font, this matrix is
just a scale by N, but it can also be used to shear the font
or stretch it unequally along the two axes. See
<a href="cairo-Text.html#cairo-set-font-matrix"><code class="function">cairo_set_font_matrix()</code></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>ctm</code></em> :</span></td>
<td> user to device transformation matrix with which the font will
be used.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>options</code></em> :</span></td>
<td> options to use when getting metrics for the font and
rendering with it.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a newly created <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a>. Destroy with
<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-destroy"><code class="function">cairo_scaled_font_destroy()</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2713772"></a><h3>
<a name="cairo-scaled-font-reference"></a>cairo_scaled_font_reference ()</h3>
<a class="indexterm" name="id2710731"></a><pre class="programlisting"><a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a>* cairo_scaled_font_reference
(<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font);</pre>
<p>
Increases the reference count on <em class="parameter"><code>scaled_font</code></em> by one. This prevents
<em class="parameter"><code>scaled_font</code></em> from being destroyed until a matching call to
<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-destroy"><code class="function">cairo_scaled_font_destroy()</code></a> is made.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></td>
<td> a <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a>, (may be NULL in which case
this function does nothing)
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the referenced <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2710828"></a><h3>
<a name="cairo-scaled-font-destroy"></a>cairo_scaled_font_destroy ()</h3>
<a class="indexterm" name="id2710840"></a><pre class="programlisting">void cairo_scaled_font_destroy (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font);</pre>
<p>
Decreases the reference count on <em class="parameter"><code>font</code></em> by one. If the result
is zero, then <em class="parameter"><code>font</code></em> and all associated resources are freed.
See <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-reference"><code class="function">cairo_scaled_font_reference()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></td>
<td> a <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2710917"></a><h3>
<a name="cairo-scaled-font-status"></a>cairo_scaled_font_status ()</h3>
<a class="indexterm" name="id2710928"></a><pre class="programlisting"><a href="cairo-Error-handling.html#cairo-status-t">cairo_status_t</a> cairo_scaled_font_status (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font);</pre>
<p>
Checks whether an error has previously occurred for this
scaled_font.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></td>
<td> a <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> <a href="cairo-Error-handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a> or another error such as
<a href="cairo-Error-handling.html#CAIRO-STATUS-NO-MEMORY:CAPS"><code class="literal">CAIRO_STATUS_NO_MEMORY</code></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2714860"></a><h3>
<a name="cairo-font-extents-t"></a>cairo_font_extents_t</h3>
<a class="indexterm" name="id2714870"></a><pre class="programlisting">typedef struct {
double ascent;
double descent;
double height;
double max_x_advance;
double max_y_advance;
} cairo_font_extents_t;
</pre>
<p>
The <a href="cairo-Scaled-Fonts.html#cairo-font-extents-t"><span class="type">cairo_font_extents_t</span></a> structure stores metric information for
a font. Values are given in the current user-space coordinate
system.
</p>
<p>
Because font metrics are in user-space coordinates, they are
mostly, but not entirely, independent of the current transformation
matrix. If you call <code class="literal">cairo_scale(cr, 2.0, 2.0)</code>,
text will be drawn twice as big, but the reported text extents will
not be doubled. They will change slightly due to hinting (so you
can't assume that metrics are independent of the transformation
matrix), but otherwise will remain unchanged.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term">double <em class="structfield"><code>ascent</code></em>;</span></td>
<td> the distance that the font extends above the baseline.
Note that this is not always exactly equal to the maximum
of the extents of all the glyphs in the font, but rather
is picked to express the font designer's intent as to
how the font should align with elements above it.
</td>
</tr>
<tr>
<td>
<span class="term">double <em class="structfield"><code>descent</code></em>;</span></td>
<td> the distance that the font extends below the baseline.
This value is positive for typical fonts that include
portions below the baseline. Note that this is not always
exactly equal to the maximum of the extents of all the
glyphs in the font, but rather is picked to express the
font designer's intent as to how the the font should
align with elements below it.
</td>
</tr>
<tr>
<td>
<span class="term">double <em class="structfield"><code>height</code></em>;</span></td>
<td> the recommended vertical distance between baselines when
setting consecutive lines of text with the font. This
is greater than <em class="parameter"><code>ascent</code></em>+<em class="parameter"><code>descent</code></em> by a
quantity known as the <em class="firstterm">line spacing</em>
or <em class="firstterm">external leading</em>. When space
is at a premium, most fonts can be set with only
a distance of <em class="parameter"><code>ascent</code></em>+<em class="parameter"><code>descent</code></em> between lines.
</td>
</tr>
<tr>
<td>
<span class="term">double <em class="structfield"><code>max_x_advance</code></em>;</span></td>
<td> the maximum distance in the X direction that
the the origin is advanced for any glyph in the font.
</td>
</tr>
<tr>
<td>
<span class="term">double <em class="structfield"><code>max_y_advance</code></em>;</span></td>
<td> the maximum distance in the Y direction that
the the origin is advanced for any glyph in the font.
this will be zero for normal fonts used for horizontal
writing. (The scripts of East Asia are sometimes written
vertically.)
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2715064"></a><h3>
<a name="cairo-scaled-font-extents"></a>cairo_scaled_font_extents ()</h3>
<a class="indexterm" name="id2715076"></a><pre class="programlisting">void cairo_scaled_font_extents (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font,
<a href="cairo-Scaled-Fonts.html#cairo-font-extents-t">cairo_font_extents_t</a> *extents);</pre>
<p>
Gets the metrics for a <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></td>
<td> a <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>extents</code></em> :</span></td>
<td> a <a href="cairo-Scaled-Fonts.html#cairo-font-extents-t"><span class="type">cairo_font_extents_t</span></a> which to store the retrieved extents.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2715168"></a><h3>
<a name="cairo-text-extents-t"></a>cairo_text_extents_t</h3>
<a class="indexterm" name="id2715179"></a><pre class="programlisting">typedef struct {
double x_bearing;
double y_bearing;
double width;
double height;
double x_advance;
double y_advance;
} cairo_text_extents_t;
</pre>
<p>
The <a href="cairo-Scaled-Fonts.html#cairo-text-extents-t"><span class="type">cairo_text_extents_t</span></a> structure stores the extents of a single
glyph or a string of glyphs in user-space coordinates. Because text
extents are in user-space coordinates, they are mostly, but not
entirely, independent of the current transformation matrix. If you call
<code class="literal">cairo_scale(cr, 2.0, 2.0)</code>, text will
be drawn twice as big, but the reported text extents will not be
doubled. They will change slightly due to hinting (so you can't
assume that metrics are independent of the transformation matrix),
but otherwise will remain unchanged.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term">double <em class="structfield"><code>x_bearing</code></em>;</span></td>
<td> the horizontal distance from the origin to the
leftmost part of the glyphs as drawn. Positive if the
glyphs lie entirely to the right of the origin.
</td>
</tr>
<tr>
<td>
<span class="term">double <em class="structfield"><code>y_bearing</code></em>;</span></td>
<td> the vertical distance from the origin to the
topmost part of the glyphs as drawn. Positive only if the
glyphs lie completely below the origin; will usually be
negative.
</td>
</tr>
<tr>
<td>
<span class="term">double <em class="structfield"><code>width</code></em>;</span></td>
<td> width of the glyphs as drawn
</td>
</tr>
<tr>
<td>
<span class="term">double <em class="structfield"><code>height</code></em>;</span></td>
<td> height of the glyphs as drawn
</td>
</tr>
<tr>
<td>
<span class="term">double <em class="structfield"><code>x_advance</code></em>;</span></td>
<td>distance to advance in the X direction
after drawing these glyphs
</td>
</tr>
<tr>
<td>
<span class="term">double <em class="structfield"><code>y_advance</code></em>;</span></td>
<td> distance to advance in the Y direction
after drawing these glyphs. Will typically be zero except
for vertical text layout as found in East-Asian languages.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2715359"></a><h3>
<a name="cairo-scaled-font-text-extents"></a>cairo_scaled_font_text_extents ()</h3>
<a class="indexterm" name="id2715375"></a><pre class="programlisting">void cairo_scaled_font_text_extents (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font,
const char *utf8,
<a href="cairo-Scaled-Fonts.html#cairo-text-extents-t">cairo_text_extents_t</a> *extents);</pre>
<p>
Gets the extents for a string of text. The extents describe a
user-space rectangle that encloses the "inked" portion of the text
drawn at the origin (0,0) (as it would be drawn by <a href="cairo-Text.html#cairo-show-text"><code class="function">cairo_show_text()</code></a>
if the cairo graphics state were set to the same font_face,
font_matrix, ctm, and font_options as <em class="parameter"><code>scaled_font</code></em>). Additionally,
the x_advance and y_advance values indicate the amount by which the
current point would be advanced by <a href="cairo-Text.html#cairo-show-text"><code class="function">cairo_show_text()</code></a>.
</p>
<p>
Note that whitespace characters do not directly contribute to the
size of the rectangle (extents.width and extents.height). They do
contribute indirectly by changing the position of non-whitespace
characters. In particular, trailing whitespace characters are
likely to not affect the size of the rectangle, though they will
affect the x_advance and y_advance values.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></td>
<td> a <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>utf8</code></em> :</span></td>
<td> a string of text, encoded in UTF-8
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>extents</code></em> :</span></td>
<td> a <a href="cairo-Scaled-Fonts.html#cairo-text-extents-t"><span class="type">cairo_text_extents_t</span></a> which to store the retrieved extents.
</td>
</tr>
</tbody>
</table></div>
<p>Since 1.2
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2715527"></a><h3>
<a name="cairo-scaled-font-glyph-extents"></a>cairo_scaled_font_glyph_extents ()</h3>
<a class="indexterm" name="id2715541"></a><pre class="programlisting">void cairo_scaled_font_glyph_extents (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font,
<a href="cairo-Text.html#cairo-glyph-t">cairo_glyph_t</a> *glyphs,
int num_glyphs,
<a href="cairo-Scaled-Fonts.html#cairo-text-extents-t">cairo_text_extents_t</a> *extents);</pre>
<p>
Gets the extents for an array of glyphs. The extents describe a
user-space rectangle that encloses the "inked" portion of the
glyphs, (as they would be drawn by <a href="cairo-Text.html#cairo-show-glyphs"><code class="function">cairo_show_glyphs()</code></a> if the cairo
graphics state were set to the same font_face, font_matrix, ctm,
and font_options as <em class="parameter"><code>scaled_font</code></em>). Additionally, the x_advance and
y_advance values indicate the amount by which the current point
would be advanced by cairo_show_glyphs.
</p>
<p>
Note that whitespace glyphs do not contribute to the size of the
rectangle (extents.width and extents.height).</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></td>
<td> a <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>glyphs</code></em> :</span></td>
<td> an array of glyph IDs with X and Y offsets.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>num_glyphs</code></em> :</span></td>
<td> the number of glyphs in the <em class="parameter"><code>glyphs</code></em> array
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>extents</code></em> :</span></td>
<td> a <a href="cairo-Scaled-Fonts.html#cairo-text-extents-t"><span class="type">cairo_text_extents_t</span></a> which to store the retrieved extents.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2715703"></a><h3>
<a name="cairo-scaled-font-get-font-face"></a>cairo_scaled_font_get_font_face ()</h3>
<a class="indexterm" name="id2672906"></a><pre class="programlisting"><a href="cairo-cairo-font-face-t.html#cairo-font-face-t">cairo_font_face_t</a>* cairo_scaled_font_get_font_face
(<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font);</pre>
<p>
Gets the font face that this scaled font was created for.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></td>
<td> a <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> The <a href="cairo-cairo-font-face-t.html#cairo-font-face-t"><span class="type">cairo_font_face_t</span></a> with which <em class="parameter"><code>scaled_font</code></em> was
created.
</td>
</tr>
</tbody>
</table></div>
<p>Since 1.2
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2715780"></a><h3>
<a name="cairo-scaled-font-get-font-options"></a>cairo_scaled_font_get_font_options ()</h3>
<a class="indexterm" name="id2715796"></a><pre class="programlisting">void cairo_scaled_font_get_font_options
(<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font,
<a href="cairo-Font-Options.html#cairo-font-options-t">cairo_font_options_t</a> *options);</pre>
<p>
Stores the font options with which <em class="parameter"><code>scaled_font</code></em> was created into
<em class="parameter"><code>options</code></em>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></td>
<td> a <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>options</code></em> :</span></td>
<td> return value for the font options
</td>
</tr>
</tbody>
</table></div>
<p>Since 1.2
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2715881"></a><h3>
<a name="cairo-scaled-font-get-font-matrix"></a>cairo_scaled_font_get_font_matrix ()</h3>
<a class="indexterm" name="id2715897"></a><pre class="programlisting">void cairo_scaled_font_get_font_matrix
(<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font,
<a href="cairo-cairo-matrix-t.html#cairo-matrix-t">cairo_matrix_t</a> *font_matrix);</pre>
<p>
Stores the font matrix with which <em class="parameter"><code>scaled_font</code></em> was created into
<em class="parameter"><code>matrix</code></em>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></td>
<td> a <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>font_matrix</code></em> :</span></td>
<td> return value for the matrix
</td>
</tr>
</tbody>
</table></div>
<p>Since 1.2
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2715982"></a><h3>
<a name="cairo-scaled-font-get-ctm"></a>cairo_scaled_font_get_ctm ()</h3>
<a class="indexterm" name="id2715995"></a><pre class="programlisting">void cairo_scaled_font_get_ctm (<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font,
<a href="cairo-cairo-matrix-t.html#cairo-matrix-t">cairo_matrix_t</a> *ctm);</pre>
<p>
Stores the CTM with which <em class="parameter"><code>scaled_font</code></em> was created into <em class="parameter"><code>ctm</code></em>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></td>
<td> a <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>ctm</code></em> :</span></td>
<td> return value for the CTM
</td>
</tr>
</tbody>
</table></div>
<p>Since 1.2
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2716079"></a><h3>
<a name="cairo-scaled-font-get-type"></a>cairo_scaled_font_get_type ()</h3>
<a class="indexterm" name="id2716092"></a><pre class="programlisting"><a href="cairo-cairo-font-face-t.html#cairo-font-type-t">cairo_font_type_t</a> cairo_scaled_font_get_type
(<a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t">cairo_scaled_font_t</a> *scaled_font);</pre>
<p>
This function returns the type of the backend used to create
a scaled font. See <a href="cairo-cairo-font-face-t.html#cairo-font-type-t"><span class="type">cairo_font_type_t</span></a> for available types.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></td>
<td> a <a href="cairo-Scaled-Fonts.html#cairo-scaled-font-t"><span class="type">cairo_scaled_font_t</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> The type of <em class="parameter"><code>scaled_font</code></em>.
</td>
</tr>
</tbody>
</table></div>
<p>Since 1.2
</p>
</div>
</div>
</div>
</body>
</html>
|