summaryrefslogtreecommitdiff
path: root/libs/cairo-1.16.0/doc/public/xml/cairo-scaled-font.xml
blob: 3be82a25e9c088a368bcf108c8d1a3922f9adeb2 (plain)
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
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
		"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="cairo-cairo-scaled-font-t">
<refmeta>
<refentrytitle role="top_of_page" id="cairo-cairo-scaled-font-t.top_of_page">cairo_scaled_font_t</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>CAIRO Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>cairo_scaled_font_t</refname>
<refpurpose>Font face at particular size and options</refpurpose>
</refnamediv>

<refsect1 id="cairo-cairo-scaled-font-t.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_return" colwidth="150px"/>
<colspec colname="functions_name"/>
<tbody>
<row><entry role="function_type"><link linkend="cairo-scaled-font-t"><returnvalue>cairo_scaled_font_t</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cairo-scaled-font-create">cairo_scaled_font_create</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="cairo-scaled-font-t"><returnvalue>cairo_scaled_font_t</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cairo-scaled-font-reference">cairo_scaled_font_reference</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="cairo-scaled-font-destroy">cairo_scaled_font_destroy</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="cairo-status-t"><returnvalue>cairo_status_t</returnvalue></link>
</entry><entry role="function_name"><link linkend="cairo-scaled-font-status">cairo_scaled_font_status</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="cairo-scaled-font-extents">cairo_scaled_font_extents</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="cairo-scaled-font-text-extents">cairo_scaled_font_text_extents</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="cairo-scaled-font-glyph-extents">cairo_scaled_font_glyph_extents</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="cairo-status-t"><returnvalue>cairo_status_t</returnvalue></link>
</entry><entry role="function_name"><link linkend="cairo-scaled-font-text-to-glyphs">cairo_scaled_font_text_to_glyphs</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="cairo-font-face-t"><returnvalue>cairo_font_face_t</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cairo-scaled-font-get-font-face">cairo_scaled_font_get_font_face</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="cairo-scaled-font-get-font-options">cairo_scaled_font_get_font_options</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="cairo-scaled-font-get-font-matrix">cairo_scaled_font_get_font_matrix</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="cairo-scaled-font-get-ctm">cairo_scaled_font_get_ctm</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="cairo-scaled-font-get-scale-matrix">cairo_scaled_font_get_scale_matrix</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="cairo-font-type-t"><returnvalue>cairo_font_type_t</returnvalue></link>
</entry><entry role="function_name"><link linkend="cairo-scaled-font-get-type">cairo_scaled_font_get_type</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">unsigned <link linkend="int"><returnvalue>int</returnvalue></link>
</entry><entry role="function_name"><link linkend="cairo-scaled-font-get-reference-count">cairo_scaled_font_get_reference_count</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="cairo-status-t"><returnvalue>cairo_status_t</returnvalue></link>
</entry><entry role="function_name"><link linkend="cairo-scaled-font-set-user-data">cairo_scaled_font_set_user_data</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="cairo-scaled-font-get-user-data">cairo_scaled_font_get_user_data</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="cairo-cairo-scaled-font-t.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="name" colwidth="150px"/>
<colspec colname="description"/>
<tbody>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="cairo-scaled-font-t">cairo_scaled_font_t</link></entry></row>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="cairo-font-extents-t">cairo_font_extents_t</link></entry></row>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="cairo-text-extents-t">cairo_text_extents_t</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>


<refsect1 id="cairo-cairo-scaled-font-t.description" role="desc">
<title role="desc.title">Description</title>
<para><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> represents a realization of a font face at a particular
size and transformation and a certain set of font options.</para>

</refsect1>
<refsect1 id="cairo-cairo-scaled-font-t.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="cairo-scaled-font-create" role="function" condition="since:1.0">
<title>cairo_scaled_font_create&#160;()</title>
<indexterm zone="cairo-scaled-font-create" role="1.0"><primary sortas="scaled_font_create">cairo_scaled_font_create</primary></indexterm>
<programlisting language="C"><link linkend="cairo-scaled-font-t"><returnvalue>cairo_scaled_font_t</returnvalue></link>&#160;*
cairo_scaled_font_create (<parameter><link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link> *font_face</parameter>,
                          <parameter>const <link linkend="cairo-matrix-t"><type>cairo_matrix_t</type></link> *font_matrix</parameter>,
                          <parameter>const <link linkend="cairo-matrix-t"><type>cairo_matrix_t</type></link> *ctm</parameter>,
                          <parameter>const <link linkend="cairo-font-options-t"><type>cairo_font_options_t</type></link> *options</parameter>);</programlisting>
<para>Creates a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> object from a font face and matrices that
describe the size of the font and the environment in which it will
be used.</para>
<refsect3 id="cairo-scaled-font-create.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>font_face</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>font_matrix</para></entry>
<entry role="parameter_description"><para>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
<link linkend="cairo-set-font-matrix"><function>cairo_set_font_matrix()</function></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>ctm</para></entry>
<entry role="parameter_description"><para>user to device transformation matrix with which the font will
be used.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>options</para></entry>
<entry role="parameter_description"><para>options to use when getting metrics for the font and
rendering with it.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="cairo-scaled-font-create.returns" role="returns">
<title>Returns</title>
<para> a newly created <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link>. Destroy with
<link linkend="cairo-scaled-font-destroy"><function>cairo_scaled_font_destroy()</function></link></para>
</refsect3><para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2>
<refsect2 id="cairo-scaled-font-reference" role="function" condition="since:1.0">
<title>cairo_scaled_font_reference&#160;()</title>
<indexterm zone="cairo-scaled-font-reference" role="1.0"><primary sortas="scaled_font_reference">cairo_scaled_font_reference</primary></indexterm>
<programlisting language="C"><link linkend="cairo-scaled-font-t"><returnvalue>cairo_scaled_font_t</returnvalue></link>&#160;*
cairo_scaled_font_reference (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>);</programlisting>
<para>Increases the reference count on <parameter>scaled_font</parameter>
 by one. This prevents
<parameter>scaled_font</parameter>
 from being destroyed until a matching call to
<link linkend="cairo-scaled-font-destroy"><function>cairo_scaled_font_destroy()</function></link> is made.</para>
<para>Use <link linkend="cairo-scaled-font-get-reference-count"><function>cairo_scaled_font_get_reference_count()</function></link> to get the number of
references to a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link>.</para>
<refsect3 id="cairo-scaled-font-reference.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scaled_font</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link>, (may be <link linkend="NULL:CAPS"><literal>NULL</literal></link> in which case
this function does nothing)</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="cairo-scaled-font-reference.returns" role="returns">
<title>Returns</title>
<para> the referenced <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para>
</refsect3><para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2>
<refsect2 id="cairo-scaled-font-destroy" role="function" condition="since:1.0">
<title>cairo_scaled_font_destroy&#160;()</title>
<indexterm zone="cairo-scaled-font-destroy" role="1.0"><primary sortas="scaled_font_destroy">cairo_scaled_font_destroy</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
cairo_scaled_font_destroy (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>);</programlisting>
<para>Decreases the reference count on <parameter>font</parameter>
 by one. If the result
is zero, then <parameter>font</parameter>
 and all associated resources are freed.
See <link linkend="cairo-scaled-font-reference"><function>cairo_scaled_font_reference()</function></link>.</para>
<refsect3 id="cairo-scaled-font-destroy.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scaled_font</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2>
<refsect2 id="cairo-scaled-font-status" role="function" condition="since:1.0">
<title>cairo_scaled_font_status&#160;()</title>
<indexterm zone="cairo-scaled-font-status" role="1.0"><primary sortas="scaled_font_status">cairo_scaled_font_status</primary></indexterm>
<programlisting language="C"><link linkend="cairo-status-t"><returnvalue>cairo_status_t</returnvalue></link>
cairo_scaled_font_status (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>);</programlisting>
<para>Checks whether an error has previously occurred for this
scaled_font.</para>
<refsect3 id="cairo-scaled-font-status.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scaled_font</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="cairo-scaled-font-status.returns" role="returns">
<title>Returns</title>
<para> <link linkend="CAIRO-STATUS-SUCCESS:CAPS"><literal>CAIRO_STATUS_SUCCESS</literal></link> or another error such as
<link linkend="CAIRO-STATUS-NO-MEMORY:CAPS"><literal>CAIRO_STATUS_NO_MEMORY</literal></link>.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2>
<refsect2 id="cairo-scaled-font-extents" role="function" condition="since:1.0">
<title>cairo_scaled_font_extents&#160;()</title>
<indexterm zone="cairo-scaled-font-extents" role="1.0"><primary sortas="scaled_font_extents">cairo_scaled_font_extents</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
cairo_scaled_font_extents (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>,
                           <parameter><link linkend="cairo-font-extents-t"><type>cairo_font_extents_t</type></link> *extents</parameter>);</programlisting>
<para>Gets the metrics for a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link>.</para>
<refsect3 id="cairo-scaled-font-extents.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scaled_font</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>extents</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-font-extents-t"><type>cairo_font_extents_t</type></link> which to store the retrieved extents.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2>
<refsect2 id="cairo-scaled-font-text-extents" role="function" condition="since:1.2">
<title>cairo_scaled_font_text_extents&#160;()</title>
<indexterm zone="cairo-scaled-font-text-extents" role="1.2"><primary sortas="scaled_font_text_extents">cairo_scaled_font_text_extents</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
cairo_scaled_font_text_extents (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>,
                                <parameter>const <link linkend="char"><type>char</type></link> *utf8</parameter>,
                                <parameter><link linkend="cairo-text-extents-t"><type>cairo_text_extents_t</type></link> *extents</parameter>);</programlisting>
<para>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 <link linkend="cairo-show-text"><function>cairo_show_text()</function></link>
if the cairo graphics state were set to the same font_face,
font_matrix, ctm, and font_options as <parameter>scaled_font</parameter>
).  Additionally,
the x_advance and y_advance values indicate the amount by which the
current point would be advanced by <link linkend="cairo-show-text"><function>cairo_show_text()</function></link>.</para>
<para>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.</para>
<refsect3 id="cairo-scaled-font-text-extents.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scaled_font</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>utf8</para></entry>
<entry role="parameter_description"><para>a NUL-terminated string of text, encoded in UTF-8</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>extents</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-text-extents-t"><type>cairo_text_extents_t</type></link> which to store the retrieved extents.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.2">1.2</link></para></refsect2>
<refsect2 id="cairo-scaled-font-glyph-extents" role="function" condition="since:1.0">
<title>cairo_scaled_font_glyph_extents&#160;()</title>
<indexterm zone="cairo-scaled-font-glyph-extents" role="1.0"><primary sortas="scaled_font_glyph_extents">cairo_scaled_font_glyph_extents</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
cairo_scaled_font_glyph_extents (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>,
                                 <parameter>const <link linkend="cairo-glyph-t"><type>cairo_glyph_t</type></link> *glyphs</parameter>,
                                 <parameter><link linkend="int"><type>int</type></link> num_glyphs</parameter>,
                                 <parameter><link linkend="cairo-text-extents-t"><type>cairo_text_extents_t</type></link> *extents</parameter>);</programlisting>
<para>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 <link linkend="cairo-show-glyphs"><function>cairo_show_glyphs()</function></link> if the cairo
graphics state were set to the same font_face, font_matrix, ctm,
and font_options as <parameter>scaled_font</parameter>
).  Additionally, the x_advance and
y_advance values indicate the amount by which the current point
would be advanced by <link linkend="cairo-show-glyphs"><function>cairo_show_glyphs()</function></link>.</para>
<para>Note that whitespace glyphs do not contribute to the size of the
rectangle (extents.width and extents.height).</para>
<refsect3 id="cairo-scaled-font-glyph-extents.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scaled_font</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>glyphs</para></entry>
<entry role="parameter_description"><para>an array of glyph IDs with X and Y offsets.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>num_glyphs</para></entry>
<entry role="parameter_description"><para>the number of glyphs in the <parameter>glyphs</parameter>
array</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>extents</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-text-extents-t"><type>cairo_text_extents_t</type></link> which to store the retrieved extents.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2>
<refsect2 id="cairo-scaled-font-text-to-glyphs" role="function" condition="since:1.8">
<title>cairo_scaled_font_text_to_glyphs&#160;()</title>
<indexterm zone="cairo-scaled-font-text-to-glyphs" role="1.8"><primary sortas="scaled_font_text_to_glyphs">cairo_scaled_font_text_to_glyphs</primary></indexterm>
<programlisting language="C"><link linkend="cairo-status-t"><returnvalue>cairo_status_t</returnvalue></link>
cairo_scaled_font_text_to_glyphs (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>,
                                  <parameter><link linkend="double"><type>double</type></link> x</parameter>,
                                  <parameter><link linkend="double"><type>double</type></link> y</parameter>,
                                  <parameter>const <link linkend="char"><type>char</type></link> *utf8</parameter>,
                                  <parameter><link linkend="int"><type>int</type></link> utf8_len</parameter>,
                                  <parameter><link linkend="cairo-glyph-t"><type>cairo_glyph_t</type></link> **glyphs</parameter>,
                                  <parameter><link linkend="int"><type>int</type></link> *num_glyphs</parameter>,
                                  <parameter><link linkend="cairo-text-cluster-t"><type>cairo_text_cluster_t</type></link> **clusters</parameter>,
                                  <parameter><link linkend="int"><type>int</type></link> *num_clusters</parameter>,
                                  <parameter><link linkend="cairo-text-cluster-flags-t"><type>cairo_text_cluster_flags_t</type></link> *cluster_flags</parameter>);</programlisting>
<para>Converts UTF-8 text to an array of glyphs, optionally with cluster
mapping, that can be used to render later using <parameter>scaled_font</parameter>
.</para>
<para>If <parameter>glyphs</parameter>
 initially points to a non-<link linkend="NULL:CAPS"><literal>NULL</literal></link> value, that array is used
as a glyph buffer, and <parameter>num_glyphs</parameter>
 should point to the number of glyph
entries available there.  If the provided glyph array is too short for
the conversion, a new glyph array is allocated using <link linkend="cairo-glyph-allocate"><function>cairo_glyph_allocate()</function></link>
and placed in <parameter>glyphs</parameter>
.  Upon return, <parameter>num_glyphs</parameter>
 always contains the
number of generated glyphs.  If the value <parameter>glyphs</parameter>
 points to has changed
after the call, the user is responsible for freeing the allocated glyph
array using <link linkend="cairo-glyph-free"><function>cairo_glyph_free()</function></link>.  This may happen even if the provided
array was large enough.</para>
<para>If <parameter>clusters</parameter>
 is not <link linkend="NULL:CAPS"><literal>NULL</literal></link>, <parameter>num_clusters</parameter>
 and <parameter>cluster_flags</parameter>
 should not be <link linkend="NULL:CAPS"><literal>NULL</literal></link>,
and cluster mapping will be computed.
The semantics of how cluster array allocation works is similar to the glyph
array.  That is,
if <parameter>clusters</parameter>
 initially points to a non-<link linkend="NULL:CAPS"><literal>NULL</literal></link> value, that array is used
as a cluster buffer, and <parameter>num_clusters</parameter>
 should point to the number of cluster
entries available there.  If the provided cluster array is too short for
the conversion, a new cluster array is allocated using <link linkend="cairo-text-cluster-allocate"><function>cairo_text_cluster_allocate()</function></link>
and placed in <parameter>clusters</parameter>
.  Upon return, <parameter>num_clusters</parameter>
 always contains the
number of generated clusters.  If the value <parameter>clusters</parameter>
 points at has changed
after the call, the user is responsible for freeing the allocated cluster
array using <link linkend="cairo-text-cluster-free"><function>cairo_text_cluster_free()</function></link>.  This may happen even if the provided
array was large enough.</para>
<para>In the simplest case, <parameter>glyphs</parameter>
 and <parameter>clusters</parameter>
 can point to <link linkend="NULL:CAPS"><literal>NULL</literal></link> initially
and a suitable array will be allocated.  In code:</para>
<informalexample><programlisting>
cairo_status_t status;

cairo_glyph_t *glyphs = NULL;
int num_glyphs;
cairo_text_cluster_t *clusters = NULL;
int num_clusters;
cairo_text_cluster_flags_t cluster_flags;

status = cairo_scaled_font_text_to_glyphs (scaled_font,
                                           x, y,
                                           utf8, utf8_len,
                                           &amp;glyphs, &amp;num_glyphs,
                                           &amp;clusters, &amp;num_clusters, &amp;cluster_flags);

if (status == CAIRO_STATUS_SUCCESS) {
    cairo_show_text_glyphs (cr,
                            utf8, utf8_len,
                            glyphs, num_glyphs,
                            clusters, num_clusters, cluster_flags);

    cairo_glyph_free (glyphs);
    cairo_text_cluster_free (clusters);
}
</programlisting></informalexample>
<para>If no cluster mapping is needed:</para>
<informalexample><programlisting>
cairo_status_t status;

cairo_glyph_t *glyphs = NULL;
int num_glyphs;

status = cairo_scaled_font_text_to_glyphs (scaled_font,
                                           x, y,
                                           utf8, utf8_len,
                                           &amp;glyphs, &amp;num_glyphs,
                                           NULL, NULL,
                                           NULL);

if (status == CAIRO_STATUS_SUCCESS) {
    cairo_show_glyphs (cr, glyphs, num_glyphs);
    cairo_glyph_free (glyphs);
}
</programlisting></informalexample>
<para>If stack-based glyph and cluster arrays are to be used for small
arrays:</para>
<informalexample><programlisting>
cairo_status_t status;

cairo_glyph_t stack_glyphs[40];
cairo_glyph_t *glyphs = stack_glyphs;
int num_glyphs = sizeof (stack_glyphs) / sizeof (stack_glyphs[0]);
cairo_text_cluster_t stack_clusters[40];
cairo_text_cluster_t *clusters = stack_clusters;
int num_clusters = sizeof (stack_clusters) / sizeof (stack_clusters[0]);
cairo_text_cluster_flags_t cluster_flags;

status = cairo_scaled_font_text_to_glyphs (scaled_font,
                                           x, y,
                                           utf8, utf8_len,
                                           &amp;glyphs, &amp;num_glyphs,
                                           &amp;clusters, &amp;num_clusters, &amp;cluster_flags);

if (status == CAIRO_STATUS_SUCCESS) {
    cairo_show_text_glyphs (cr,
                            utf8, utf8_len,
                            glyphs, num_glyphs,
                            clusters, num_clusters, cluster_flags);

    if (glyphs != stack_glyphs)
        cairo_glyph_free (glyphs);
    if (clusters != stack_clusters)
        cairo_text_cluster_free (clusters);
}
</programlisting></informalexample>
<para>For details of how <parameter>clusters</parameter>
, <parameter>num_clusters</parameter>
, and <parameter>cluster_flags</parameter>
 map input
UTF-8 text to the output glyphs see <link linkend="cairo-show-text-glyphs"><function>cairo_show_text_glyphs()</function></link>.</para>
<para>The output values can be readily passed to <link linkend="cairo-show-text-glyphs"><function>cairo_show_text_glyphs()</function></link>
<link linkend="cairo-show-glyphs"><function>cairo_show_glyphs()</function></link>, or related functions, assuming that the exact
same <parameter>scaled_font</parameter>
 is used for the operation.</para>
<refsect3 id="cairo-scaled-font-text-to-glyphs.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>x</para></entry>
<entry role="parameter_description"><para>X position to place first glyph</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>y</para></entry>
<entry role="parameter_description"><para>Y position to place first glyph</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>scaled_font</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>utf8</para></entry>
<entry role="parameter_description"><para>a string of text encoded in UTF-8</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>utf8_len</para></entry>
<entry role="parameter_description"><para>length of <parameter>utf8</parameter>
in bytes, or -1 if it is NUL-terminated</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>glyphs</para></entry>
<entry role="parameter_description"><para>pointer to array of glyphs to fill</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>num_glyphs</para></entry>
<entry role="parameter_description"><para>pointer to number of glyphs</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>clusters</para></entry>
<entry role="parameter_description"><para>pointer to array of cluster mapping information to fill, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>num_clusters</para></entry>
<entry role="parameter_description"><para>pointer to number of clusters, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>cluster_flags</para></entry>
<entry role="parameter_description"><para>pointer to location to store cluster flags corresponding to the
output <parameter>clusters</parameter>
, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="cairo-scaled-font-text-to-glyphs.returns" role="returns">
<title>Returns</title>
<para> <link linkend="CAIRO-STATUS-SUCCESS:CAPS"><literal>CAIRO_STATUS_SUCCESS</literal></link> upon success, or an error status
if the input values are wrong or if conversion failed.  If the input
values are correct but the conversion failed, the error status is also
set on <parameter>scaled_font</parameter>
.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.8">1.8</link></para></refsect2>
<refsect2 id="cairo-scaled-font-get-font-face" role="function" condition="since:1.2">
<title>cairo_scaled_font_get_font_face&#160;()</title>
<indexterm zone="cairo-scaled-font-get-font-face" role="1.2"><primary sortas="scaled_font_get_font_face">cairo_scaled_font_get_font_face</primary></indexterm>
<programlisting language="C"><link linkend="cairo-font-face-t"><returnvalue>cairo_font_face_t</returnvalue></link>&#160;*
cairo_scaled_font_get_font_face (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>);</programlisting>
<para>Gets the font face that this scaled font uses.  This might be the
font face passed to <link linkend="cairo-scaled-font-create"><function>cairo_scaled_font_create()</function></link>, but this does not
hold true for all possible cases.</para>
<refsect3 id="cairo-scaled-font-get-font-face.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scaled_font</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="cairo-scaled-font-get-font-face.returns" role="returns">
<title>Returns</title>
<para> The <link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link> with which <parameter>scaled_font</parameter>
was
created.  This object is owned by cairo. To keep a reference to it,
you must call <link linkend="cairo-scaled-font-reference"><function>cairo_scaled_font_reference()</function></link>.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.2">1.2</link></para></refsect2>
<refsect2 id="cairo-scaled-font-get-font-options" role="function" condition="since:1.2">
<title>cairo_scaled_font_get_font_options&#160;()</title>
<indexterm zone="cairo-scaled-font-get-font-options" role="1.2"><primary sortas="scaled_font_get_font_options">cairo_scaled_font_get_font_options</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
cairo_scaled_font_get_font_options (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>,
                                    <parameter><link linkend="cairo-font-options-t"><type>cairo_font_options_t</type></link> *options</parameter>);</programlisting>
<para>Stores the font options with which <parameter>scaled_font</parameter>
 was created into
<parameter>options</parameter>
.</para>
<refsect3 id="cairo-scaled-font-get-font-options.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scaled_font</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>options</para></entry>
<entry role="parameter_description"><para>return value for the font options</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.2">1.2</link></para></refsect2>
<refsect2 id="cairo-scaled-font-get-font-matrix" role="function" condition="since:1.2">
<title>cairo_scaled_font_get_font_matrix&#160;()</title>
<indexterm zone="cairo-scaled-font-get-font-matrix" role="1.2"><primary sortas="scaled_font_get_font_matrix">cairo_scaled_font_get_font_matrix</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
cairo_scaled_font_get_font_matrix (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>,
                                   <parameter><link linkend="cairo-matrix-t"><type>cairo_matrix_t</type></link> *font_matrix</parameter>);</programlisting>
<para>Stores the font matrix with which <parameter>scaled_font</parameter>
 was created into
<parameter>matrix</parameter>
.</para>
<refsect3 id="cairo-scaled-font-get-font-matrix.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scaled_font</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>font_matrix</para></entry>
<entry role="parameter_description"><para>return value for the matrix</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.2">1.2</link></para></refsect2>
<refsect2 id="cairo-scaled-font-get-ctm" role="function" condition="since:1.2">
<title>cairo_scaled_font_get_ctm&#160;()</title>
<indexterm zone="cairo-scaled-font-get-ctm" role="1.2"><primary sortas="scaled_font_get_ctm">cairo_scaled_font_get_ctm</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
cairo_scaled_font_get_ctm (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>,
                           <parameter><link linkend="cairo-matrix-t"><type>cairo_matrix_t</type></link> *ctm</parameter>);</programlisting>
<para>Stores the CTM with which <parameter>scaled_font</parameter>
 was created into <parameter>ctm</parameter>
.
Note that the translation offsets (x0, y0) of the CTM are ignored
by <link linkend="cairo-scaled-font-create"><function>cairo_scaled_font_create()</function></link>.  So, the matrix this
function returns always has 0,0 as x0,y0.</para>
<refsect3 id="cairo-scaled-font-get-ctm.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scaled_font</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>ctm</para></entry>
<entry role="parameter_description"><para>return value for the CTM</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.2">1.2</link></para></refsect2>
<refsect2 id="cairo-scaled-font-get-scale-matrix" role="function" condition="since:1.8">
<title>cairo_scaled_font_get_scale_matrix&#160;()</title>
<indexterm zone="cairo-scaled-font-get-scale-matrix" role="1.8"><primary sortas="scaled_font_get_scale_matrix">cairo_scaled_font_get_scale_matrix</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
cairo_scaled_font_get_scale_matrix (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>,
                                    <parameter><link linkend="cairo-matrix-t"><type>cairo_matrix_t</type></link> *scale_matrix</parameter>);</programlisting>
<para>Stores the scale matrix of <parameter>scaled_font</parameter>
 into <parameter>matrix</parameter>
.
The scale matrix is product of the font matrix and the ctm
associated with the scaled font, and hence is the matrix mapping from
font space to device space.</para>
<refsect3 id="cairo-scaled-font-get-scale-matrix.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scaled_font</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>scale_matrix</para></entry>
<entry role="parameter_description"><para>return value for the matrix</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-1.8">1.8</link></para></refsect2>
<refsect2 id="cairo-scaled-font-get-type" role="function" condition="since:1.2">
<title>cairo_scaled_font_get_type&#160;()</title>
<indexterm zone="cairo-scaled-font-get-type" role="1.2"><primary sortas="scaled_font_get_type">cairo_scaled_font_get_type</primary></indexterm>
<programlisting language="C"><link linkend="cairo-font-type-t"><returnvalue>cairo_font_type_t</returnvalue></link>
cairo_scaled_font_get_type (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>);</programlisting>
<para>This function returns the type of the backend used to create
a scaled font. See <link linkend="cairo-font-type-t"><type>cairo_font_type_t</type></link> for available types.
However, this function never returns <link linkend="CAIRO-FONT-TYPE-TOY:CAPS"><literal>CAIRO_FONT_TYPE_TOY</literal></link>.</para>
<refsect3 id="cairo-scaled-font-get-type.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scaled_font</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="cairo-scaled-font-get-type.returns" role="returns">
<title>Returns</title>
<para> The type of <parameter>scaled_font</parameter>
.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.2">1.2</link></para></refsect2>
<refsect2 id="cairo-scaled-font-get-reference-count" role="function" condition="since:1.4">
<title>cairo_scaled_font_get_reference_count&#160;()</title>
<indexterm zone="cairo-scaled-font-get-reference-count" role="1.4"><primary sortas="scaled_font_get_reference_count">cairo_scaled_font_get_reference_count</primary></indexterm>
<programlisting language="C">unsigned <link linkend="int"><returnvalue>int</returnvalue></link>
cairo_scaled_font_get_reference_count (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>);</programlisting>
<para>Returns the current reference count of <parameter>scaled_font</parameter>
.</para>
<refsect3 id="cairo-scaled-font-get-reference-count.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scaled_font</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="cairo-scaled-font-get-reference-count.returns" role="returns">
<title>Returns</title>
<para> the current reference count of <parameter>scaled_font</parameter>
.  If the
object is a nil object, 0 will be returned.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.4">1.4</link></para></refsect2>
<refsect2 id="cairo-scaled-font-set-user-data" role="function" condition="since:1.4">
<title>cairo_scaled_font_set_user_data&#160;()</title>
<indexterm zone="cairo-scaled-font-set-user-data" role="1.4"><primary sortas="scaled_font_set_user_data">cairo_scaled_font_set_user_data</primary></indexterm>
<programlisting language="C"><link linkend="cairo-status-t"><returnvalue>cairo_status_t</returnvalue></link>
cairo_scaled_font_set_user_data (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>,
                                 <parameter>const <link linkend="cairo-user-data-key-t"><type>cairo_user_data_key_t</type></link> *key</parameter>,
                                 <parameter><link linkend="void"><type>void</type></link> *user_data</parameter>,
                                 <parameter><link linkend="cairo-destroy-func-t"><type>cairo_destroy_func_t</type></link> destroy</parameter>);</programlisting>
<para>Attach user data to <parameter>scaled_font</parameter>
.  To remove user data from a surface,
call this function with the key that was used to set it and <link linkend="NULL:CAPS"><literal>NULL</literal></link>
for <parameter>data</parameter>
.</para>
<refsect3 id="cairo-scaled-font-set-user-data.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scaled_font</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>the address of a <link linkend="cairo-user-data-key-t"><type>cairo_user_data_key_t</type></link> to attach the user data to</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>user_data</para></entry>
<entry role="parameter_description"><para>the user data to attach to the <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>destroy</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-destroy-func-t"><type>cairo_destroy_func_t</type></link> which will be called when the
<link linkend="cairo-t"><type>cairo_t</type></link> is destroyed or when new user data is attached using the
same key.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="cairo-scaled-font-set-user-data.returns" role="returns">
<title>Returns</title>
<para> <link linkend="CAIRO-STATUS-SUCCESS:CAPS"><literal>CAIRO_STATUS_SUCCESS</literal></link> or <link linkend="CAIRO-STATUS-NO-MEMORY:CAPS"><literal>CAIRO_STATUS_NO_MEMORY</literal></link> if a
slot could not be allocated for the user data.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.4">1.4</link></para></refsect2>
<refsect2 id="cairo-scaled-font-get-user-data" role="function" condition="since:1.4">
<title>cairo_scaled_font_get_user_data&#160;()</title>
<indexterm zone="cairo-scaled-font-get-user-data" role="1.4"><primary sortas="scaled_font_get_user_data">cairo_scaled_font_get_user_data</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>&#160;*
cairo_scaled_font_get_user_data (<parameter><link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> *scaled_font</parameter>,
                                 <parameter>const <link linkend="cairo-user-data-key-t"><type>cairo_user_data_key_t</type></link> *key</parameter>);</programlisting>
<para>Return user data previously attached to <parameter>scaled_font</parameter>
 using the
specified key.  If no user data has been attached with the given
key this function returns <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para>
<refsect3 id="cairo-scaled-font-get-user-data.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>scaled_font</para></entry>
<entry role="parameter_description"><para>a <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>key</para></entry>
<entry role="parameter_description"><para>the address of the <link linkend="cairo-user-data-key-t"><type>cairo_user_data_key_t</type></link> the user data was
attached to</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="cairo-scaled-font-get-user-data.returns" role="returns">
<title>Returns</title>
<para> the user data previously attached or <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para>
</refsect3><para role="since">Since: <link linkend="api-index-1.4">1.4</link></para></refsect2>

</refsect1>
<refsect1 id="cairo-cairo-scaled-font-t.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="cairo-scaled-font-t" role="typedef" condition="since:1.0">
<title>cairo_scaled_font_t</title>
<indexterm zone="cairo-scaled-font-t" role="1.0"><primary sortas="scaled_font_t">cairo_scaled_font_t</primary></indexterm>
<programlisting language="C">typedef struct _cairo_scaled_font cairo_scaled_font_t;
</programlisting>
<para>A <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> is a font scaled to a particular size and device
resolution. A <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> 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.</para>
<para>There are various types of scaled fonts, depending on the
<firstterm>font backend</firstterm> they use. The type of a
scaled font can be queried using <link linkend="cairo-scaled-font-get-type"><function>cairo_scaled_font_get_type()</function></link>.</para>
<para>Memory management of <link linkend="cairo-scaled-font-t"><type>cairo_scaled_font_t</type></link> is done with
<link linkend="cairo-scaled-font-reference"><function>cairo_scaled_font_reference()</function></link> and <link linkend="cairo-scaled-font-destroy"><function>cairo_scaled_font_destroy()</function></link>.</para>
<para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2>
<refsect2 id="cairo-font-extents-t" role="struct" condition="since:1.0">
<title>cairo_font_extents_t</title>
<indexterm zone="cairo-font-extents-t" role="1.0"><primary sortas="font_extents_t">cairo_font_extents_t</primary></indexterm>
<programlisting language="C">typedef struct {
    double ascent;
    double descent;
    double height;
    double max_x_advance;
    double max_y_advance;
} cairo_font_extents_t;
</programlisting>
<para>The <link linkend="cairo-font-extents-t"><type>cairo_font_extents_t</type></link> structure stores metric information for
a font. Values are given in the current user-space coordinate
system.</para>
<para>Because font metrics are in user-space coordinates, they are
mostly, but not entirely, independent of the current transformation
matrix. If you call <literal>cairo_scale(cr, 2.0, 2.0)</literal>,
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.</para>
<refsect3 id="cairo-font-extents-t.members" role="struct_members">
<title>Members</title>
<informaltable role="struct_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="struct_members_name" colwidth="300px"/>
<colspec colname="struct_members_description"/>
<colspec colname="struct_members_annotations" colwidth="200px"/>
<tbody>
<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link>&#160;<structfield id="cairo-font-extents-t.ascent">ascent</structfield>;</para></entry>
<entry role="struct_member_description"><para>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.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link>&#160;<structfield id="cairo-font-extents-t.descent">descent</structfield>;</para></entry>
<entry role="struct_member_description"><para>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 font should
align with elements below it.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link>&#160;<structfield id="cairo-font-extents-t.height">height</structfield>;</para></entry>
<entry role="struct_member_description"><para>the recommended vertical distance between baselines when
setting consecutive lines of text with the font. This
is greater than <parameter>ascent</parameter>
+<parameter>descent</parameter>
by a
quantity known as the <firstterm>line spacing</firstterm>
or <firstterm>external leading</firstterm>. When space
is at a premium, most fonts can be set with only
a distance of <parameter>ascent</parameter>
+<parameter>descent</parameter>
between lines.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link>&#160;<structfield id="cairo-font-extents-t.max-x-advance">max_x_advance</structfield>;</para></entry>
<entry role="struct_member_description"><para>the maximum distance in the X direction that
the origin is advanced for any glyph in the font.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link>&#160;<structfield id="cairo-font-extents-t.max-y-advance">max_y_advance</structfield>;</para></entry>
<entry role="struct_member_description"><para>the maximum distance in the Y direction that
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.)</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3>
<para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2>
<refsect2 id="cairo-text-extents-t" role="struct" condition="since:1.0">
<title>cairo_text_extents_t</title>
<indexterm zone="cairo-text-extents-t" role="1.0"><primary sortas="text_extents_t">cairo_text_extents_t</primary></indexterm>
<programlisting language="C">typedef struct {
    double x_bearing;
    double y_bearing;
    double width;
    double height;
    double x_advance;
    double y_advance;
} cairo_text_extents_t;
</programlisting>
<para>The <link linkend="cairo-text-extents-t"><type>cairo_text_extents_t</type></link> 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
<literal>cairo_scale(cr, 2.0, 2.0)</literal>, 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.</para>
<refsect3 id="cairo-text-extents-t.members" role="struct_members">
<title>Members</title>
<informaltable role="struct_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="struct_members_name" colwidth="300px"/>
<colspec colname="struct_members_description"/>
<colspec colname="struct_members_annotations" colwidth="200px"/>
<tbody>
<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link>&#160;<structfield id="cairo-text-extents-t.x-bearing">x_bearing</structfield>;</para></entry>
<entry role="struct_member_description"><para>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.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link>&#160;<structfield id="cairo-text-extents-t.y-bearing">y_bearing</structfield>;</para></entry>
<entry role="struct_member_description"><para>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.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link>&#160;<structfield id="cairo-text-extents-t.width">width</structfield>;</para></entry>
<entry role="struct_member_description"><para>width of the glyphs as drawn</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link>&#160;<structfield id="cairo-text-extents-t.height">height</structfield>;</para></entry>
<entry role="struct_member_description"><para>height of the glyphs as drawn</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link>&#160;<structfield id="cairo-text-extents-t.x-advance">x_advance</structfield>;</para></entry>
<entry role="struct_member_description"><para>distance to advance in the X direction
after drawing these glyphs</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
<row role="member"><entry role="struct_member_name"><para><link linkend="double"><type>double</type></link>&#160;<structfield id="cairo-text-extents-t.y-advance">y_advance</structfield>;</para></entry>
<entry role="struct_member_description"><para>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.</para></entry>
<entry role="struct_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3>
<para role="since">Since: <link linkend="api-index-1.0">1.0</link></para></refsect2>

</refsect1>
<refsect1 id="cairo-cairo-scaled-font-t.see-also">
<title>See Also</title>
<para><link linkend="cairo-font-face-t"><type>cairo_font_face_t</type></link>, <link linkend="cairo-matrix-t"><type>cairo_matrix_t</type></link>, <link linkend="cairo-font-options-t"><type>cairo_font_options_t</type></link></para>

</refsect1>

</refentry>