summaryrefslogtreecommitdiff
path: root/doc/public/html/cairo-text.html
blob: 9e88dc961e02d803a488f1b7c97079ffab06b3ff (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
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>text</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Cairo: A Vector Graphics Library">
<link rel="up" href="cairo-drawing.html" title="Drawing">
<link rel="prev" href="cairo-Transformations.html" title="Transformations">
<link rel="next" href="cairo-fonts.html" title="Fonts">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="cairo-Transformations.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="cairo-drawing.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-fonts.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#cairo-text.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#cairo-text.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="text">
<a name="cairo-text"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="cairo-text.top_of_page"></a>text</span></h2>
<p>text — Rendering text and glyphs</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="cairo-text.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">                    <a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t">cairo_glyph_t</a>;
enum                <a class="link" href="cairo-text.html#cairo-font-slant-t" title="enum cairo_font_slant_t">cairo_font_slant_t</a>;
enum                <a class="link" href="cairo-text.html#cairo-font-weight-t" title="enum cairo_font_weight_t">cairo_font_weight_t</a>;
                    <a class="link" href="cairo-text.html#cairo-text-cluster-t" title="cairo_text_cluster_t">cairo_text_cluster_t</a>;
enum                <a class="link" href="cairo-text.html#cairo-text-cluster-flags-t" title="enum cairo_text_cluster_flags_t">cairo_text_cluster_flags_t</a>;
<span class="returnvalue">void</span>                <a class="link" href="cairo-text.html#cairo-select-font-face" title="cairo_select_font_face ()">cairo_select_font_face</a>              (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *family</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-text.html#cairo-font-slant-t" title="enum cairo_font_slant_t"><span class="type">cairo_font_slant_t</span></a> slant</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-text.html#cairo-font-weight-t" title="enum cairo_font_weight_t"><span class="type">cairo_font_weight_t</span></a> weight</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="cairo-text.html#cairo-set-font-size" title="cairo_set_font_size ()">cairo_set_font_size</a>                 (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> size</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="cairo-text.html#cairo-set-font-matrix" title="cairo_set_font_matrix ()">cairo_set_font_matrix</a>               (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *matrix</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="cairo-text.html#cairo-get-font-matrix" title="cairo_get_font_matrix ()">cairo_get_font_matrix</a>               (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *matrix</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="cairo-text.html#cairo-set-font-options" title="cairo_set_font_options ()">cairo_set_font_options</a>              (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="cairo-cairo-font-options-t.html#cairo-font-options-t" title="cairo_font_options_t"><span class="type">cairo_font_options_t</span></a> *options</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="cairo-text.html#cairo-get-font-options" title="cairo_get_font_options ()">cairo_get_font_options</a>              (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-cairo-font-options-t.html#cairo-font-options-t" title="cairo_font_options_t"><span class="type">cairo_font_options_t</span></a> *options</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="cairo-text.html#cairo-set-font-face" title="cairo_set_font_face ()">cairo_set_font_face</a>                 (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> *font_face</code></em>);
<a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="returnvalue">cairo_font_face_t</span></a> * <a class="link" href="cairo-text.html#cairo-get-font-face" title="cairo_get_font_face ()">cairo_get_font_face</a>                 (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="cairo-text.html#cairo-set-scaled-font" title="cairo_set_scaled_font ()">cairo_set_scaled_font</a>               (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a> *scaled_font</code></em>);
<a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="returnvalue">cairo_scaled_font_t</span></a> * <a class="link" href="cairo-text.html#cairo-get-scaled-font" title="cairo_get_scaled_font ()">cairo_get_scaled_font</a>             (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="cairo-text.html#cairo-show-text" title="cairo_show_text ()">cairo_show_text</a>                     (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *utf8</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="cairo-text.html#cairo-show-glyphs" title="cairo_show_glyphs ()">cairo_show_glyphs</a>                   (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t"><span class="type">cairo_glyph_t</span></a> *glyphs</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> num_glyphs</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="cairo-text.html#cairo-show-text-glyphs" title="cairo_show_text_glyphs ()">cairo_show_text_glyphs</a>              (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *utf8</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> utf8_len</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t"><span class="type">cairo_glyph_t</span></a> *glyphs</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> num_glyphs</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="cairo-text.html#cairo-text-cluster-t" title="cairo_text_cluster_t"><span class="type">cairo_text_cluster_t</span></a> *clusters</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> num_clusters</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-text.html#cairo-text-cluster-flags-t" title="enum cairo_text_cluster_flags_t"><span class="type">cairo_text_cluster_flags_t</span></a> cluster_flags</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="cairo-text.html#cairo-font-extents" title="cairo_font_extents ()">cairo_font_extents</a>                  (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-cairo-scaled-font-t.html#cairo-font-extents-t" title="cairo_font_extents_t"><span class="type">cairo_font_extents_t</span></a> *extents</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="cairo-text.html#cairo-text-extents" title="cairo_text_extents ()">cairo_text_extents</a>                  (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *utf8</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-cairo-scaled-font-t.html#cairo-text-extents-t" title="cairo_text_extents_t"><span class="type">cairo_text_extents_t</span></a> *extents</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="cairo-text.html#cairo-glyph-extents" title="cairo_glyph_extents ()">cairo_glyph_extents</a>                 (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t"><span class="type">cairo_glyph_t</span></a> *glyphs</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> num_glyphs</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-cairo-scaled-font-t.html#cairo-text-extents-t" title="cairo_text_extents_t"><span class="type">cairo_text_extents_t</span></a> *extents</code></em>);
<a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="returnvalue">cairo_font_face_t</span></a> * <a class="link" href="cairo-text.html#cairo-toy-font-face-create" title="cairo_toy_font_face_create ()">cairo_toy_font_face_create</a>          (<em class="parameter"><code>const <span class="type">char</span> *family</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-text.html#cairo-font-slant-t" title="enum cairo_font_slant_t"><span class="type">cairo_font_slant_t</span></a> slant</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-text.html#cairo-font-weight-t" title="enum cairo_font_weight_t"><span class="type">cairo_font_weight_t</span></a> weight</code></em>);
const <span class="returnvalue">char</span> *        <a class="link" href="cairo-text.html#cairo-toy-font-face-get-family" title="cairo_toy_font_face_get_family ()">cairo_toy_font_face_get_family</a>      (<em class="parameter"><code><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> *font_face</code></em>);
<a class="link" href="cairo-text.html#cairo-font-slant-t" title="enum cairo_font_slant_t"><span class="returnvalue">cairo_font_slant_t</span></a>  <a class="link" href="cairo-text.html#cairo-toy-font-face-get-slant" title="cairo_toy_font_face_get_slant ()">cairo_toy_font_face_get_slant</a>       (<em class="parameter"><code><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> *font_face</code></em>);
<a class="link" href="cairo-text.html#cairo-font-weight-t" title="enum cairo_font_weight_t"><span class="returnvalue">cairo_font_weight_t</span></a>  <a class="link" href="cairo-text.html#cairo-toy-font-face-get-weight" title="cairo_toy_font_face_get_weight ()">cairo_toy_font_face_get_weight</a>     (<em class="parameter"><code><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> *font_face</code></em>);
<a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t"><span class="returnvalue">cairo_glyph_t</span></a> *     <a class="link" href="cairo-text.html#cairo-glyph-allocate" title="cairo_glyph_allocate ()">cairo_glyph_allocate</a>                (<em class="parameter"><code><span class="type">int</span> num_glyphs</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="cairo-text.html#cairo-glyph-free" title="cairo_glyph_free ()">cairo_glyph_free</a>                    (<em class="parameter"><code><a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t"><span class="type">cairo_glyph_t</span></a> *glyphs</code></em>);
<a class="link" href="cairo-text.html#cairo-text-cluster-t" title="cairo_text_cluster_t"><span class="returnvalue">cairo_text_cluster_t</span></a> * <a class="link" href="cairo-text.html#cairo-text-cluster-allocate" title="cairo_text_cluster_allocate ()">cairo_text_cluster_allocate</a>      (<em class="parameter"><code><span class="type">int</span> num_clusters</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="cairo-text.html#cairo-text-cluster-free" title="cairo_text_cluster_free ()">cairo_text_cluster_free</a>             (<em class="parameter"><code><a class="link" href="cairo-text.html#cairo-text-cluster-t" title="cairo_text_cluster_t"><span class="type">cairo_text_cluster_t</span></a> *clusters</code></em>);
</pre>
</div>
<div class="refsect1" title="Description">
<a name="cairo-text.description"></a><h2>Description</h2>
<p>
The functions with <span class="emphasis"><em>text</em></span> in their name form cairo's
<em class="firstterm">toy</em> text API.  The toy API takes UTF-8 encoded
text and is limited in its functionality to rendering simple
left-to-right text with no advanced features.  That means for example
that most complex scripts like Hebrew, Arabic, and Indic scripts are
out of question.  No kerning or correct positioning of diacritical marks
either.  The font selection is pretty limited too and doesn't handle the
case that the selected font does not cover the characters in the text.
This set of functions are really that, a toy text API, for testing and
demonstration purposes.  Any serious application should avoid them.
</p>
<p>
The functions with <span class="emphasis"><em>glyphs</em></span> in their name form cairo's
<em class="firstterm">low-level</em> text API.  The low-level API relies on
the user to convert text to a set of glyph indexes and positions.  This
is a very hard problem and is best handled by external libraries, like
the pangocairo that is part of the Pango text layout and rendering library.
Pango is available from <a class="ulink" href="http://www.pango.org/" target="_top">http://www.pango.org/</a>.
</p>
</div>
<div class="refsect1" title="Details">
<a name="cairo-text.details"></a><h2>Details</h2>
<div class="refsect2" title="cairo_glyph_t">
<a name="cairo-glyph-t"></a><h3>cairo_glyph_t</h3>
<pre class="programlisting">typedef struct {
    unsigned long        index;
    double               x;
    double               y;
} cairo_glyph_t;
</pre>
<p>
The <a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t"><span class="type">cairo_glyph_t</span></a> structure holds information about a single glyph
when drawing or measuring text. A font is (in simple terms) a
collection of shapes used to draw text. A glyph is one of these
shapes. There can be multiple glyphs for a single character
(alternates to be used in different contexts, for example), or a
glyph can be a <em class="firstterm">ligature</em> of multiple
characters. Cairo doesn't expose any way of converting input text
into glyphs, so in order to use the Cairo interfaces that take
arrays of glyphs, you must directly access the appropriate
underlying font system.
</p>
<p>
Note that the offsets given by <em class="parameter"><code>x</code></em> and <em class="parameter"><code>y</code></em> are not cumulative. When
drawing or measuring text, each glyph is individually positioned
with respect to the overall origin
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">unsigned <span class="type">long</span> <em class="structfield"><code><a name="cairo-glyph-t.index"></a>index</code></em>;</span></p></td>
<td>glyph index in the font. The exact interpretation of the
     glyph index depends on the font technology being used.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">double</span> <em class="structfield"><code><a name="cairo-glyph-t.x"></a>x</code></em>;</span></p></td>
<td>the offset in the X direction between the origin used for
    drawing or measuring the string and the origin of this glyph.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">double</span> <em class="structfield"><code><a name="cairo-glyph-t.y"></a>y</code></em>;</span></p></td>
<td>the offset in the Y direction between the origin used for
    drawing or measuring the string and the origin of this glyph.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enum cairo_font_slant_t">
<a name="cairo-font-slant-t"></a><h3>enum cairo_font_slant_t</h3>
<pre class="programlisting">typedef enum _cairo_font_slant {
    CAIRO_FONT_SLANT_NORMAL,
    CAIRO_FONT_SLANT_ITALIC,
    CAIRO_FONT_SLANT_OBLIQUE
} cairo_font_slant_t;
</pre>
<p>
Specifies variants of a font face based on their slant.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="CAIRO-FONT-SLANT-NORMAL:CAPS"></a><span class="term"><code class="literal">CAIRO_FONT_SLANT_NORMAL</code></span></p></td>
<td>Upright font style
</td>
</tr>
<tr>
<td><p><a name="CAIRO-FONT-SLANT-ITALIC:CAPS"></a><span class="term"><code class="literal">CAIRO_FONT_SLANT_ITALIC</code></span></p></td>
<td>Italic font style
</td>
</tr>
<tr>
<td><p><a name="CAIRO-FONT-SLANT-OBLIQUE:CAPS"></a><span class="term"><code class="literal">CAIRO_FONT_SLANT_OBLIQUE</code></span></p></td>
<td>Oblique font style
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enum cairo_font_weight_t">
<a name="cairo-font-weight-t"></a><h3>enum cairo_font_weight_t</h3>
<pre class="programlisting">typedef enum _cairo_font_weight {
    CAIRO_FONT_WEIGHT_NORMAL,
    CAIRO_FONT_WEIGHT_BOLD
} cairo_font_weight_t;
</pre>
<p>
Specifies variants of a font face based on their weight.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="CAIRO-FONT-WEIGHT-NORMAL:CAPS"></a><span class="term"><code class="literal">CAIRO_FONT_WEIGHT_NORMAL</code></span></p></td>
<td>Normal font weight
</td>
</tr>
<tr>
<td><p><a name="CAIRO-FONT-WEIGHT-BOLD:CAPS"></a><span class="term"><code class="literal">CAIRO_FONT_WEIGHT_BOLD</code></span></p></td>
<td>Bold font weight
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cairo_text_cluster_t">
<a name="cairo-text-cluster-t"></a><h3>cairo_text_cluster_t</h3>
<pre class="programlisting">typedef struct {
    int        num_bytes;
    int        num_glyphs;
} cairo_text_cluster_t;
</pre>
<p>
The <a class="link" href="cairo-text.html#cairo-text-cluster-t" title="cairo_text_cluster_t"><span class="type">cairo_text_cluster_t</span></a> structure holds information about a single
<em class="firstterm">text cluster</em>.  A text cluster is a minimal
mapping of some glyphs corresponding to some UTF-8 text.
</p>
<p>
For a cluster to be valid, both <em class="parameter"><code>num_bytes</code></em> and <em class="parameter"><code>num_glyphs</code></em> should
be non-negative, and at least one should be non-zero.
Note that clusters with zero glyphs are not as well supported as
normal clusters.  For example, PDF rendering applications typically
ignore those clusters when PDF text is being selected.
</p>
<p>
See <a class="link" href="cairo-text.html#cairo-show-text-glyphs" title="cairo_show_text_glyphs ()"><code class="function">cairo_show_text_glyphs()</code></a> for how clusters are used in advanced
text operations.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><span class="type">int</span> <em class="structfield"><code><a name="cairo-text-cluster-t.num-bytes"></a>num_bytes</code></em>;</span></p></td>
<td>the number of bytes of UTF-8 text covered by cluster
</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">int</span> <em class="structfield"><code><a name="cairo-text-cluster-t.num-glyphs"></a>num_glyphs</code></em>;</span></p></td>
<td>the number of glyphs covered by cluster
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.8</p>
</div>
<hr>
<div class="refsect2" title="enum cairo_text_cluster_flags_t">
<a name="cairo-text-cluster-flags-t"></a><h3>enum cairo_text_cluster_flags_t</h3>
<pre class="programlisting">typedef enum _cairo_text_cluster_flags {
    CAIRO_TEXT_CLUSTER_FLAG_BACKWARD = 0x00000001
} cairo_text_cluster_flags_t;
</pre>
<p>
Specifies properties of a text cluster mapping.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><a name="CAIRO-TEXT-CLUSTER-FLAG-BACKWARD:CAPS"></a><span class="term"><code class="literal">CAIRO_TEXT_CLUSTER_FLAG_BACKWARD</code></span></p></td>
<td>The clusters in the cluster array
map to glyphs in the glyph array from end to start.
</td>
</tr></tbody>
</table></div>
<p class="since">Since 1.8</p>
</div>
<hr>
<div class="refsect2" title="cairo_select_font_face ()">
<a name="cairo-select-font-face"></a><h3>cairo_select_font_face ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cairo_select_font_face              (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *family</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-text.html#cairo-font-slant-t" title="enum cairo_font_slant_t"><span class="type">cairo_font_slant_t</span></a> slant</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-text.html#cairo-font-weight-t" title="enum cairo_font_weight_t"><span class="type">cairo_font_weight_t</span></a> weight</code></em>);</pre>
<p>
Note: The <a class="link" href="cairo-text.html#cairo-select-font-face" title="cairo_select_font_face ()"><code class="function">cairo_select_font_face()</code></a> function call is part of what
the cairo designers call the "toy" text API. It is convenient for
short demos and simple programs, but it is not expected to be
adequate for serious text-using applications.
</p>
<p>
Selects a family and style of font from a simplified description as
a family name, slant and weight. Cairo provides no operation to
list available family names on the system (this is a "toy",
remember), but the standard CSS2 generic family names, ("serif",
"sans-serif", "cursive", "fantasy", "monospace"), are likely to
work as expected.
</p>
<p>
If <em class="parameter"><code>family</code></em> starts with the string "<em class="parameter"><code>cairo</code></em>:", or if no native font
backends are compiled in, cairo will use an internal font family.
The internal font family recognizes many modifiers in the <em class="parameter"><code>family</code></em>
string, most notably, it recognizes the string "monospace".  That is,
the family name "<em class="parameter"><code>cairo</code></em>:monospace" will use the monospace version of
the internal font family.
</p>
<p>
For "real" font selection, see the font-backend-specific
font_face_create functions for the font backend you are using. (For
example, if you are using the freetype-based cairo-ft font backend,
see <a class="link" href="cairo-FreeType-Fonts.html#cairo-ft-font-face-create-for-ft-face" title="cairo_ft_font_face_create_for_ft_face ()"><code class="function">cairo_ft_font_face_create_for_ft_face()</code></a> or
<a class="link" href="cairo-FreeType-Fonts.html#cairo-ft-font-face-create-for-pattern" title="cairo_ft_font_face_create_for_pattern ()"><code class="function">cairo_ft_font_face_create_for_pattern()</code></a>.) The resulting font face
could then be used with <a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-create" title="cairo_scaled_font_create ()"><code class="function">cairo_scaled_font_create()</code></a> and
<a class="link" href="cairo-text.html#cairo-set-scaled-font" title="cairo_set_scaled_font ()"><code class="function">cairo_set_scaled_font()</code></a>.
</p>
<p>
Similarly, when using the "real" font support, you can call
directly into the underlying font system, (such as fontconfig or
freetype), for operations such as listing available fonts, etc.
</p>
<p>
It is expected that most applications will need to use a more
comprehensive font handling and text layout library, (for example,
pango), in conjunction with cairo.
</p>
<p>
If text is drawn without a call to <a class="link" href="cairo-text.html#cairo-select-font-face" title="cairo_select_font_face ()"><code class="function">cairo_select_font_face()</code></a>, (nor
<a class="link" href="cairo-text.html#cairo-set-font-face" title="cairo_set_font_face ()"><code class="function">cairo_set_font_face()</code></a> nor <a class="link" href="cairo-text.html#cairo-set-scaled-font" title="cairo_set_scaled_font ()"><code class="function">cairo_set_scaled_font()</code></a>), the default
family is platform-specific, but is essentially "sans-serif".
Default slant is <a class="link" href="cairo-text.html#CAIRO-FONT-SLANT-NORMAL:CAPS"><code class="literal">CAIRO_FONT_SLANT_NORMAL</code></a>, and default weight is
<a class="link" href="cairo-text.html#CAIRO-FONT-WEIGHT-NORMAL:CAPS"><code class="literal">CAIRO_FONT_WEIGHT_NORMAL</code></a>.
</p>
<p>
This function is equivalent to a call to <a class="link" href="cairo-text.html#cairo-toy-font-face-create" title="cairo_toy_font_face_create ()"><code class="function">cairo_toy_font_face_create()</code></a>
followed by <a class="link" href="cairo-text.html#cairo-set-font-face" title="cairo_set_font_face ()"><code class="function">cairo_set_font_face()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>family</code></em> :</span></p></td>
<td>a font family name, encoded in UTF-8
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>slant</code></em> :</span></p></td>
<td>the slant for the font
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>weight</code></em> :</span></p></td>
<td>the weight for the font
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cairo_set_font_size ()">
<a name="cairo-set-font-size"></a><h3>cairo_set_font_size ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cairo_set_font_size                 (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> size</code></em>);</pre>
<p>
Sets the current font matrix to a scale by a factor of <em class="parameter"><code>size</code></em>, replacing
any font matrix previously set with <a class="link" href="cairo-text.html#cairo-set-font-size" title="cairo_set_font_size ()"><code class="function">cairo_set_font_size()</code></a> or
<a class="link" href="cairo-text.html#cairo-set-font-matrix" title="cairo_set_font_matrix ()"><code class="function">cairo_set_font_matrix()</code></a>. This results in a font size of <em class="parameter"><code>size</code></em> user space
units. (More precisely, this matrix will result in the font's
em-square being a <em class="parameter"><code>size</code></em> by <em class="parameter"><code>size</code></em> square in user space.)
</p>
<p>
If text is drawn without a call to <a class="link" href="cairo-text.html#cairo-set-font-size" title="cairo_set_font_size ()"><code class="function">cairo_set_font_size()</code></a>, (nor
<a class="link" href="cairo-text.html#cairo-set-font-matrix" title="cairo_set_font_matrix ()"><code class="function">cairo_set_font_matrix()</code></a> nor <a class="link" href="cairo-text.html#cairo-set-scaled-font" title="cairo_set_scaled_font ()"><code class="function">cairo_set_scaled_font()</code></a>), the default
font size is 10.0.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
<td>the new font size, in user space units
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cairo_set_font_matrix ()">
<a name="cairo-set-font-matrix"></a><h3>cairo_set_font_matrix ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cairo_set_font_matrix               (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *matrix</code></em>);</pre>
<p>
Sets the current font matrix to <em class="parameter"><code>matrix</code></em>. The font matrix gives a
transformation from the design space of the font (in this space,
the em-square is 1 unit by 1 unit) to user space. Normally, a
simple scale is used (see <a class="link" href="cairo-text.html#cairo-set-font-size" title="cairo_set_font_size ()"><code class="function">cairo_set_font_size()</code></a>), but a more
complex font matrix can be used to shear the font
or stretch it unequally along the two axes
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> describing a transform to be applied to
the current font.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cairo_get_font_matrix ()">
<a name="cairo-get-font-matrix"></a><h3>cairo_get_font_matrix ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cairo_get_font_matrix               (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *matrix</code></em>);</pre>
<p>
Stores the current font matrix into <em class="parameter"><code>matrix</code></em>. See
<a class="link" href="cairo-text.html#cairo-set-font-matrix" title="cairo_set_font_matrix ()"><code class="function">cairo_set_font_matrix()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
<td>return value for the matrix
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cairo_set_font_options ()">
<a name="cairo-set-font-options"></a><h3>cairo_set_font_options ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cairo_set_font_options              (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="cairo-cairo-font-options-t.html#cairo-font-options-t" title="cairo_font_options_t"><span class="type">cairo_font_options_t</span></a> *options</code></em>);</pre>
<p>
Sets a set of custom font rendering options for the <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>.
Rendering options are derived by merging these options with the
options derived from underlying surface; if the value in <em class="parameter"><code>options</code></em>
has a default value (like <a class="link" href="cairo-cairo-t.html#CAIRO-ANTIALIAS-DEFAULT:CAPS"><code class="literal">CAIRO_ANTIALIAS_DEFAULT</code></a>), then the value
from the surface is used.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>options</code></em> :</span></p></td>
<td>font options to use
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cairo_get_font_options ()">
<a name="cairo-get-font-options"></a><h3>cairo_get_font_options ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cairo_get_font_options              (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-cairo-font-options-t.html#cairo-font-options-t" title="cairo_font_options_t"><span class="type">cairo_font_options_t</span></a> *options</code></em>);</pre>
<p>
Retrieves font rendering options set via <a class="link" href="cairo-text.html#cairo-set-font-options" title="cairo_set_font_options ()"><span class="type">cairo_set_font_options</span></a>.
Note that the returned options do not include any options derived
from the underlying surface; they are literally the options
passed to <a class="link" href="cairo-text.html#cairo-set-font-options" title="cairo_set_font_options ()"><code class="function">cairo_set_font_options()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>options</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-font-options-t.html#cairo-font-options-t" title="cairo_font_options_t"><span class="type">cairo_font_options_t</span></a> object into which to store
  the retrieved options. All existing values are overwritten
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cairo_set_font_face ()">
<a name="cairo-set-font-face"></a><h3>cairo_set_font_face ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cairo_set_font_face                 (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> *font_face</code></em>);</pre>
<p>
Replaces the current <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> object in the <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> with
<em class="parameter"><code>font_face</code></em>. The replaced font face in the <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> will be
destroyed if there are no other references to it.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>font_face</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a>, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to restore to the default font
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cairo_get_font_face ()">
<a name="cairo-get-font-face"></a><h3>cairo_get_font_face ()</h3>
<pre class="programlisting"><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="returnvalue">cairo_font_face_t</span></a> * cairo_get_font_face                 (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>);</pre>
<p>
Gets the current font face for a <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the current font face.  This object is owned by
cairo. To keep a reference to it, you must call
<a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-reference" title="cairo_font_face_reference ()"><code class="function">cairo_font_face_reference()</code></a>.

This function never returns <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. If memory cannot be allocated, a
special "nil" <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> object will be returned on which
<a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-status" title="cairo_font_face_status ()"><code class="function">cairo_font_face_status()</code></a> returns <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-NO-MEMORY:CAPS"><code class="literal">CAIRO_STATUS_NO_MEMORY</code></a>. Using
this nil object will cause its error state to propagate to other
objects it is passed to, (for example, calling
<a class="link" href="cairo-text.html#cairo-set-font-face" title="cairo_set_font_face ()"><code class="function">cairo_set_font_face()</code></a> with a nil font will trigger an error that
will shutdown the <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> object).
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cairo_set_scaled_font ()">
<a name="cairo-set-scaled-font"></a><h3>cairo_set_scaled_font ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cairo_set_scaled_font               (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a> *scaled_font</code></em>);</pre>
<p>
Replaces the current font face, font matrix, and font options in
the <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> with those of the <a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a>.  Except for
some translation, the current CTM of the <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> should be the
same as that of the <a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a>, which can be accessed
using <a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-get-ctm" title="cairo_scaled_font_get_ctm ()"><code class="function">cairo_scaled_font_get_ctm()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.2</p>
</div>
<hr>
<div class="refsect2" title="cairo_get_scaled_font ()">
<a name="cairo-get-scaled-font"></a><h3>cairo_get_scaled_font ()</h3>
<pre class="programlisting"><a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="returnvalue">cairo_scaled_font_t</span></a> * cairo_get_scaled_font             (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>);</pre>
<p>
Gets the current scaled font for a <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the current scaled font. This object is owned by
cairo. To keep a reference to it, you must call
<a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-reference" title="cairo_scaled_font_reference ()"><code class="function">cairo_scaled_font_reference()</code></a>.

This function never returns <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. If memory cannot be allocated, a
special "nil" <a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a> object will be returned on which
<a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-status" title="cairo_scaled_font_status ()"><code class="function">cairo_scaled_font_status()</code></a> returns <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-NO-MEMORY:CAPS"><code class="literal">CAIRO_STATUS_NO_MEMORY</code></a>. Using
this nil object will cause its error state to propagate to other
objects it is passed to, (for example, calling
<a class="link" href="cairo-text.html#cairo-set-scaled-font" title="cairo_set_scaled_font ()"><code class="function">cairo_set_scaled_font()</code></a> with a nil font will trigger an error that
will shutdown the <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> object).

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.4</p>
</div>
<hr>
<div class="refsect2" title="cairo_show_text ()">
<a name="cairo-show-text"></a><h3>cairo_show_text ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cairo_show_text                     (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *utf8</code></em>);</pre>
<p>
A drawing operator that generates the shape from a string of UTF-8
characters, rendered according to the current font_face, font_size
(font_matrix), and font_options.
</p>
<p>
This function first computes a set of glyphs for the string of
text. The first glyph is placed so that its origin is at the
current point. The origin of each subsequent glyph is offset from
that of the previous glyph by the advance values of the previous
glyph.
</p>
<p>
After this call the current point is moved to the origin of where
the next glyph would be placed in this same progression. That is,
the current point will be at the origin of the final glyph offset
by its advance values. This allows for easy display of a single
logical string with multiple calls to <a class="link" href="cairo-text.html#cairo-show-text" title="cairo_show_text ()"><code class="function">cairo_show_text()</code></a>.
</p>
<p>
Note: The <a class="link" href="cairo-text.html#cairo-show-text" title="cairo_show_text ()"><code class="function">cairo_show_text()</code></a> function call is part of what the cairo
designers call the "toy" text API. It is convenient for short demos
and simple programs, but it is not expected to be adequate for
serious text-using applications. See <a class="link" href="cairo-text.html#cairo-show-glyphs" title="cairo_show_glyphs ()"><code class="function">cairo_show_glyphs()</code></a> for the
"real" text display API in cairo.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a cairo context
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>utf8</code></em> :</span></p></td>
<td>a NUL-terminated string of text encoded in UTF-8, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cairo_show_glyphs ()">
<a name="cairo-show-glyphs"></a><h3>cairo_show_glyphs ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cairo_show_glyphs                   (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t"><span class="type">cairo_glyph_t</span></a> *glyphs</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> num_glyphs</code></em>);</pre>
<p>
A drawing operator that generates the shape from an array of glyphs,
rendered according to the current font face, font size
(font matrix), and font options.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a cairo context
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>glyphs</code></em> :</span></p></td>
<td>array of glyphs to show
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>num_glyphs</code></em> :</span></p></td>
<td>number of glyphs to show
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cairo_show_text_glyphs ()">
<a name="cairo-show-text-glyphs"></a><h3>cairo_show_text_glyphs ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cairo_show_text_glyphs              (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *utf8</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> utf8_len</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t"><span class="type">cairo_glyph_t</span></a> *glyphs</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> num_glyphs</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="cairo-text.html#cairo-text-cluster-t" title="cairo_text_cluster_t"><span class="type">cairo_text_cluster_t</span></a> *clusters</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> num_clusters</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-text.html#cairo-text-cluster-flags-t" title="enum cairo_text_cluster_flags_t"><span class="type">cairo_text_cluster_flags_t</span></a> cluster_flags</code></em>);</pre>
<p>
This operation has rendering effects similar to <a class="link" href="cairo-text.html#cairo-show-glyphs" title="cairo_show_glyphs ()"><code class="function">cairo_show_glyphs()</code></a>
but, if the target surface supports it, uses the provided text and
cluster mapping to embed the text for the glyphs shown in the output.
If the target does not support the extended attributes, this function
acts like the basic <a class="link" href="cairo-text.html#cairo-show-glyphs" title="cairo_show_glyphs ()"><code class="function">cairo_show_glyphs()</code></a> as if it had been passed
<em class="parameter"><code>glyphs</code></em> and <em class="parameter"><code>num_glyphs</code></em>.
</p>
<p>
The mapping between <em class="parameter"><code>utf8</code></em> and <em class="parameter"><code>glyphs</code></em> is provided by an array of
<em class="firstterm">clusters</em>.  Each cluster covers a number of
text bytes and glyphs, and neighboring clusters cover neighboring
areas of <em class="parameter"><code>utf8</code></em> and <em class="parameter"><code>glyphs</code></em>.  The clusters should collectively cover <em class="parameter"><code>utf8</code></em>
and <em class="parameter"><code>glyphs</code></em> in entirety.
</p>
<p>
The first cluster always covers bytes from the beginning of <em class="parameter"><code>utf8</code></em>.
If <em class="parameter"><code>cluster_flags</code></em> do not have the <a class="link" href="cairo-text.html#CAIRO-TEXT-CLUSTER-FLAG-BACKWARD:CAPS"><code class="literal">CAIRO_TEXT_CLUSTER_FLAG_BACKWARD</code></a>
set, the first cluster also covers the beginning
of <em class="parameter"><code>glyphs</code></em>, otherwise it covers the end of the <em class="parameter"><code>glyphs</code></em> array and
following clusters move backward.
</p>
<p>
See <a class="link" href="cairo-text.html#cairo-text-cluster-t" title="cairo_text_cluster_t"><span class="type">cairo_text_cluster_t</span></a> for constraints on valid clusters.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a cairo context
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>utf8</code></em> :</span></p></td>
<td>a string of text encoded in UTF-8
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>utf8_len</code></em> :</span></p></td>
<td>length of <em class="parameter"><code>utf8</code></em> in bytes, or -1 if it is NUL-terminated
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>glyphs</code></em> :</span></p></td>
<td>array of glyphs to show
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>num_glyphs</code></em> :</span></p></td>
<td>number of glyphs to show
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>clusters</code></em> :</span></p></td>
<td>array of cluster mapping information
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>num_clusters</code></em> :</span></p></td>
<td>number of clusters in the mapping
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cluster_flags</code></em> :</span></p></td>
<td>cluster mapping flags
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.8</p>
</div>
<hr>
<div class="refsect2" title="cairo_font_extents ()">
<a name="cairo-font-extents"></a><h3>cairo_font_extents ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cairo_font_extents                  (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-cairo-scaled-font-t.html#cairo-font-extents-t" title="cairo_font_extents_t"><span class="type">cairo_font_extents_t</span></a> *extents</code></em>);</pre>
<p>
Gets the font extents for the currently selected font.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>extents</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-scaled-font-t.html#cairo-font-extents-t" title="cairo_font_extents_t"><span class="type">cairo_font_extents_t</span></a> object into which the results
will be stored.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cairo_text_extents ()">
<a name="cairo-text-extents"></a><h3>cairo_text_extents ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cairo_text_extents                  (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *utf8</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-cairo-scaled-font-t.html#cairo-text-extents-t" title="cairo_text_extents_t"><span class="type">cairo_text_extents_t</span></a> *extents</code></em>);</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,
(as it would be drawn by <a class="link" href="cairo-text.html#cairo-show-text" title="cairo_show_text ()"><code class="function">cairo_show_text()</code></a>). Additionally, the
x_advance and y_advance values indicate the amount by which the
current point would be advanced by <a class="link" href="cairo-text.html#cairo-show-text" title="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>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>utf8</code></em> :</span></p></td>
<td>a NUL-terminated string of text encoded in UTF-8, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>extents</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-scaled-font-t.html#cairo-text-extents-t" title="cairo_text_extents_t"><span class="type">cairo_text_extents_t</span></a> object into which the results
will be stored
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cairo_glyph_extents ()">
<a name="cairo-glyph-extents"></a><h3>cairo_glyph_extents ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cairo_glyph_extents                 (<em class="parameter"><code><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t"><span class="type">cairo_glyph_t</span></a> *glyphs</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> num_glyphs</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-cairo-scaled-font-t.html#cairo-text-extents-t" title="cairo_text_extents_t"><span class="type">cairo_text_extents_t</span></a> *extents</code></em>);</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 class="link" href="cairo-text.html#cairo-show-glyphs" title="cairo_show_glyphs ()"><code class="function">cairo_show_glyphs()</code></a>).
Additionally, the x_advance and y_advance values indicate the
amount by which the current point would be advanced by
<a class="link" href="cairo-text.html#cairo-show-glyphs" title="cairo_show_glyphs ()"><code class="function">cairo_show_glyphs()</code></a>.
</p>
<p>
Note that whitespace glyphs do not contribute to the size of the
rectangle (extents.width and extents.height).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>glyphs</code></em> :</span></p></td>
<td>an array of <a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t"><span class="type">cairo_glyph_t</span></a> objects
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>num_glyphs</code></em> :</span></p></td>
<td>the number of elements in <em class="parameter"><code>glyphs</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>extents</code></em> :</span></p></td>
<td>a <a class="link" href="cairo-cairo-scaled-font-t.html#cairo-text-extents-t" title="cairo_text_extents_t"><span class="type">cairo_text_extents_t</span></a> object into which the results
will be stored
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="cairo_toy_font_face_create ()">
<a name="cairo-toy-font-face-create"></a><h3>cairo_toy_font_face_create ()</h3>
<pre class="programlisting"><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="returnvalue">cairo_font_face_t</span></a> * cairo_toy_font_face_create          (<em class="parameter"><code>const <span class="type">char</span> *family</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-text.html#cairo-font-slant-t" title="enum cairo_font_slant_t"><span class="type">cairo_font_slant_t</span></a> slant</code></em>,
                                                         <em class="parameter"><code><a class="link" href="cairo-text.html#cairo-font-weight-t" title="enum cairo_font_weight_t"><span class="type">cairo_font_weight_t</span></a> weight</code></em>);</pre>
<p>
Creates a font face from a triplet of family, slant, and weight.
These font faces are used in implementation of the the <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a> "toy"
font API.
</p>
<p>
If <em class="parameter"><code>family</code></em> is the zero-length string "", the platform-specific default
family is assumed.  The default family then can be queried using
<a class="link" href="cairo-text.html#cairo-toy-font-face-get-family" title="cairo_toy_font_face_get_family ()"><code class="function">cairo_toy_font_face_get_family()</code></a>.
</p>
<p>
The <a class="link" href="cairo-text.html#cairo-select-font-face" title="cairo_select_font_face ()"><code class="function">cairo_select_font_face()</code></a> function uses this to create font faces.
See that function for limitations and other details of toy font faces.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>family</code></em> :</span></p></td>
<td>a font family name, encoded in UTF-8
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>slant</code></em> :</span></p></td>
<td>the slant for the font
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>weight</code></em> :</span></p></td>
<td>the weight for the font
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a newly created <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a>. Free with
 <a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-destroy" title="cairo_font_face_destroy ()"><code class="function">cairo_font_face_destroy()</code></a> when you are done using it.

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.8</p>
</div>
<hr>
<div class="refsect2" title="cairo_toy_font_face_get_family ()">
<a name="cairo-toy-font-face-get-family"></a><h3>cairo_toy_font_face_get_family ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *        cairo_toy_font_face_get_family      (<em class="parameter"><code><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> *font_face</code></em>);</pre>
<p>
Gets the familly name of a toy font.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>font_face</code></em> :</span></p></td>
<td>A toy font face
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The family name.  This string is owned by the font face
and remains valid as long as the font face is alive (referenced).

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.8</p>
</div>
<hr>
<div class="refsect2" title="cairo_toy_font_face_get_slant ()">
<a name="cairo-toy-font-face-get-slant"></a><h3>cairo_toy_font_face_get_slant ()</h3>
<pre class="programlisting"><a class="link" href="cairo-text.html#cairo-font-slant-t" title="enum cairo_font_slant_t"><span class="returnvalue">cairo_font_slant_t</span></a>  cairo_toy_font_face_get_slant       (<em class="parameter"><code><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> *font_face</code></em>);</pre>
<p>
Gets the slant a toy font.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>font_face</code></em> :</span></p></td>
<td>A toy font face
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The slant value

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.8</p>
</div>
<hr>
<div class="refsect2" title="cairo_toy_font_face_get_weight ()">
<a name="cairo-toy-font-face-get-weight"></a><h3>cairo_toy_font_face_get_weight ()</h3>
<pre class="programlisting"><a class="link" href="cairo-text.html#cairo-font-weight-t" title="enum cairo_font_weight_t"><span class="returnvalue">cairo_font_weight_t</span></a>  cairo_toy_font_face_get_weight     (<em class="parameter"><code><a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a> *font_face</code></em>);</pre>
<p>
Gets the weight a toy font.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>font_face</code></em> :</span></p></td>
<td>A toy font face
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The weight value

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.8</p>
</div>
<hr>
<div class="refsect2" title="cairo_glyph_allocate ()">
<a name="cairo-glyph-allocate"></a><h3>cairo_glyph_allocate ()</h3>
<pre class="programlisting"><a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t"><span class="returnvalue">cairo_glyph_t</span></a> *     cairo_glyph_allocate                (<em class="parameter"><code><span class="type">int</span> num_glyphs</code></em>);</pre>
<p>
Allocates an array of <a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t"><span class="type">cairo_glyph_t</span></a>'s.
This function is only useful in implementations of
<a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-text-to-glyphs-func-t" title="cairo_user_scaled_font_text_to_glyphs_func_t ()"><span class="type">cairo_user_scaled_font_text_to_glyphs_func_t</span></a> where the user
needs to allocate an array of glyphs that cairo will free.
For all other uses, user can use their own allocation method
for glyphs.
</p>
<p>
This function returns <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>num_glyphs</code></em> is not positive,
or if out of memory.  That means, the <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> return value
signals out-of-memory only if <em class="parameter"><code>num_glyphs</code></em> was positive.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>num_glyphs</code></em> :</span></p></td>
<td>number of glyphs to allocate
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the newly allocated array of glyphs that should be
         freed using <a class="link" href="cairo-text.html#cairo-glyph-free" title="cairo_glyph_free ()"><code class="function">cairo_glyph_free()</code></a>

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.8</p>
</div>
<hr>
<div class="refsect2" title="cairo_glyph_free ()">
<a name="cairo-glyph-free"></a><h3>cairo_glyph_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cairo_glyph_free                    (<em class="parameter"><code><a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t"><span class="type">cairo_glyph_t</span></a> *glyphs</code></em>);</pre>
<p>
Frees an array of <a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t"><span class="type">cairo_glyph_t</span></a>'s allocated using <a class="link" href="cairo-text.html#cairo-glyph-allocate" title="cairo_glyph_allocate ()"><code class="function">cairo_glyph_allocate()</code></a>.
This function is only useful to free glyph array returned
by <a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-text-to-glyphs" title="cairo_scaled_font_text_to_glyphs ()"><code class="function">cairo_scaled_font_text_to_glyphs()</code></a> where cairo returns
an array of glyphs that the user will free.
For all other uses, user can use their own allocation method
for glyphs.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>glyphs</code></em> :</span></p></td>
<td>array of glyphs to free, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr></tbody>
</table></div>
<p class="since">Since 1.8</p>
</div>
<hr>
<div class="refsect2" title="cairo_text_cluster_allocate ()">
<a name="cairo-text-cluster-allocate"></a><h3>cairo_text_cluster_allocate ()</h3>
<pre class="programlisting"><a class="link" href="cairo-text.html#cairo-text-cluster-t" title="cairo_text_cluster_t"><span class="returnvalue">cairo_text_cluster_t</span></a> * cairo_text_cluster_allocate      (<em class="parameter"><code><span class="type">int</span> num_clusters</code></em>);</pre>
<p>
Allocates an array of <a class="link" href="cairo-text.html#cairo-text-cluster-t" title="cairo_text_cluster_t"><span class="type">cairo_text_cluster_t</span></a>'s.
This function is only useful in implementations of
<a class="link" href="cairo-User-Fonts.html#cairo-user-scaled-font-text-to-glyphs-func-t" title="cairo_user_scaled_font_text_to_glyphs_func_t ()"><span class="type">cairo_user_scaled_font_text_to_glyphs_func_t</span></a> where the user
needs to allocate an array of text clusters that cairo will free.
For all other uses, user can use their own allocation method
for text clusters.
</p>
<p>
This function returns <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>num_clusters</code></em> is not positive,
or if out of memory.  That means, the <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> return value
signals out-of-memory only if <em class="parameter"><code>num_clusters</code></em> was positive.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>num_clusters</code></em> :</span></p></td>
<td>number of text_clusters to allocate
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the newly allocated array of text clusters that should be
         freed using <a class="link" href="cairo-text.html#cairo-text-cluster-free" title="cairo_text_cluster_free ()"><code class="function">cairo_text_cluster_free()</code></a>

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.8</p>
</div>
<hr>
<div class="refsect2" title="cairo_text_cluster_free ()">
<a name="cairo-text-cluster-free"></a><h3>cairo_text_cluster_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                cairo_text_cluster_free             (<em class="parameter"><code><a class="link" href="cairo-text.html#cairo-text-cluster-t" title="cairo_text_cluster_t"><span class="type">cairo_text_cluster_t</span></a> *clusters</code></em>);</pre>
<p>
Frees an array of <span class="type">cairo_text_cluster</span>'s allocated using <a class="link" href="cairo-text.html#cairo-text-cluster-allocate" title="cairo_text_cluster_allocate ()"><code class="function">cairo_text_cluster_allocate()</code></a>.
This function is only useful to free text cluster array returned
by <a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-text-to-glyphs" title="cairo_scaled_font_text_to_glyphs ()"><code class="function">cairo_scaled_font_text_to_glyphs()</code></a> where cairo returns
an array of text clusters that the user will free.
For all other uses, user can use their own allocation method
for text clusters.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>clusters</code></em> :</span></p></td>
<td>array of text clusters to free, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr></tbody>
</table></div>
<p class="since">Since 1.8</p>
</div>
</div>
<div class="refsect1" title="See Also">
<a name="cairo-text.see-also"></a><h2>See Also</h2>
<a class="link" href="cairo-cairo-font-face-t.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a>, <a class="link" href="cairo-cairo-scaled-font-t.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a>, <a class="link" href="cairo-Paths.html#cairo-text-path" title="cairo_text_path ()"><code class="function">cairo_text_path()</code></a>,
           <a class="link" href="cairo-Paths.html#cairo-glyph-path" title="cairo_glyph_path ()"><code class="function">cairo_glyph_path()</code></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15</div>
</body>
</html>