Source

pygame / docs / ref / freetype.html

Full commit
  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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>pygame.freetype &mdash; Pygame v1.9.2 documentation</title>
    <link rel="stylesheet" href="../_static/pygame.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '1.9.2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="shortcut icon" href="../_static/pygame.ico"/>
    <link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" />
    <link rel="next" title="pygame.gfxdraw" href="gfxdraw.html" />
    <link rel="prev" title="pygame.font" href="font.html" /> 
  </head>
  <body>  

    <div class="document">

  <div class="header">
    <table>
      <tr>
	<td class="logo">
	  <a href="http://www.pygame.org/">
	    <img src="../_static/pygame_tiny.png"/>
	  </a>
	  <h5>pygame documentation</h5>
	</td>
	<td class="pagelinks">
	  <p class="top">
	    ||
	    <a href="http://www.pygame.org/">Pygame Home</a> ||
	    <a href="../index.html">Help Contents</a> ||
	    <a href="../genindex.html">Reference Index</a> ||
	  </p>
	  <p class="bottom">
	    <a href="camera.html">camera</a> || 
	    <a href="cdrom.html">cdrom</a> || 
	    <a href="color.html">Color</a> || 
	    <a href="cursors.html">cursors</a> || 
	    <a href="display.html">display</a> || 
	    <a href="draw.html">draw</a> || 
	    <a href="event.html">event</a> || 
	    <a href="examples.html">examples</a> || 
	    <a href="font.html">font</a> || 
	    <a href="freetype.html">freetype</a> || 
	    <a href="gfxdraw.html">gfxdraw</a> || 
	    <a href="image.html">image</a> || 
	    <a href="joystick.html">joystick</a> || 
	    <a href="key.html">key</a> || 
	    <a href="locals.html">locals</a> || 
	    <a href="mask.html">mask</a> || 
	    <a href="math.html">math</a> || 
	    <a href="midi.html">midi</a> || 
	    <a href="mixer.html">mixer</a> || 
	    <a href="mouse.html">mouse</a> || 
	    <a href="movie.html">movie</a> || 
	    <a href="music.html">music</a> || 
	    <a href="overlay.html">Overlay</a> || 
	    <a href="pixelarray.html">PixelArray</a> || 
	    <a href="pixelcopy.html">pixelcopy</a> || 
	    <a href="pygame.html">pygame</a> || 
	    <a href="rect.html">Rect</a> || 
	    <a href="scrap.html">scrap</a> || 
	    <a href="sndarray.html">sndarray</a> || 
	    <a href="sprite.html">sprite</a> || 
	    <a href="surface.html">Surface</a> || 
	    <a href="surfarray.html">surfarray</a> || 
	    <a href="tests.html">tests</a> || 
	    <a href="time.html">time</a> || 
	    <a href="transform.html">transform</a> || 
	    <a href="pygame.html#module-pygame.version">version</a>
	  </p>
	</td>
      </tr>
    </table>
  </div>

      <div class="documentwrapper">
          <div class="body">
            
  <div class="sectionwrapper">
<div class="section" id="module-pygame.freetype">
<span id="pygame-freetype"></span><dl class="definition module">
<dt class="title module">
<tt class="docutils literal"><span class="pre">pygame.freetype</span></tt></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Enhanced Pygame module for loading and rendering font faces</span></div>
</div>
<table border="1" class="toc docutils">
<colgroup>
<col width="37%" />
<col width="1%" />
<col width="62%" />
</colgroup>
<tbody valign="top">
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.get_error">pygame.freetype.get_error</a></td>
<td></td>
<td>Get the latest error</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.get_version">pygame.freetype.get_version</a></td>
<td></td>
<td>Get the FreeType version</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.init">pygame.freetype.init</a></td>
<td></td>
<td>Initialize the underlying FreeType 2 library.</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.quit">pygame.freetype.quit</a></td>
<td></td>
<td>Shuts down the underlying FreeType 2 library.</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.was_init">pygame.freetype.was_init</a></td>
<td></td>
<td>Returns whether the the FreeType 2 library is initialized.</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.get_default_resolution">pygame.freetype.get_default_resolution</a></td>
<td></td>
<td>Return the default pixel size in dots per inch</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.set_default_resolution">pygame.freetype.set_default_resolution</a></td>
<td></td>
<td>Set the default pixel size in dots per inch for the module</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.get_default_font">pygame.freetype.get_default_font</a></td>
<td></td>
<td>Get the filename of the default font</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face">pygame.freetype.Face</a></td>
<td></td>
<td>Creates a new Face instance from a supported font file.</td>
</tr>
</tbody>
</table>
<p>&#8212; Note that some features may change before a formal release</p>
<p>This module allows for rendering all face formats supported by FreeType, namely
<tt class="docutils literal"><span class="pre">TTF</span></tt>, Type1, <tt class="docutils literal"><span class="pre">CFF</span></tt>, OpenType, <tt class="docutils literal"><span class="pre">SFNT</span></tt>, <tt class="docutils literal"><span class="pre">PCF</span></tt>, <tt class="docutils literal"><span class="pre">FNT</span></tt>, <tt class="docutils literal"><span class="pre">BDF</span></tt>, <tt class="docutils literal"><span class="pre">PFR</span></tt>
and Type42 faces. It can render any UTF-32 character in a font file.</p>
<p>This module is optional, and replaces all of the functionality of the original
&#8216;font&#8217; module, whilst expanding it. This module depends in no way on the
SDL_ttf library.</p>
<p>You should test that <a class="tooltip reference internal" href="#module-pygame.freetype" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.freetype</span></tt><span class="tooltip-content">Enhanced Pygame module for loading and rendering font faces</span></a> is initialized before attempting to
use the module; if the module is available and loaded, it will be automatically
initialized by <tt class="docutils literal"><span class="pre">pygame.init()</span></tt></p>
<p>Most of the work done with faces is done by using the actual Face objects. The
module by itself only has routines to initialize itself and create Face objects
with <tt class="docutils literal"><span class="pre">pygame.freetype.Face()</span></tt>.</p>
<p>You can load faces from the system by using the <tt class="docutils literal"><span class="pre">pygame.freetype.SysFont()</span></tt>
function. There are a few other functions to help lookup the system fonts.</p>
<p>For now undefined character codes are replaced with the <tt class="docutils literal"><span class="pre">undefined</span> <span class="pre">character</span></tt>.
How undefined codes are handled may become configurable in a future release.</p>
<p>Pygame comes with a builtin default font. This can always be accessed by
passing None as the font name to the Face constructor.</p>
<p>New in Pygame 1.9.2</p>
<dl class="definition function">
<dt class="title" id="pygame.freetype.get_error">
<tt class="descclassname">pygame.freetype.</tt><tt class="descname">get_error</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.get_error" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Get the latest error</span></div>
<div class="line"><span class="signature">get_error() -&gt; str</span></div>
</div>
<p>Returns the description of the last error which occurred in the FreeType
library, or None if no errors have occurred.</p>
</dd></dl>

<dl class="definition function">
<dt class="title" id="pygame.freetype.get_version">
<tt class="descclassname">pygame.freetype.</tt><tt class="descname">get_version</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.get_version" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Get the FreeType version</span></div>
<div class="line"><span class="signature">get_version() -&gt; (int, int, int)</span></div>
</div>
<p>Gets the version of the FreeType2 library which was used to build the
&#8216;freetype&#8217; module.</p>
<p>Note that the FreeType module depends on the FreeType 2 library, and will
not compile with the original FreeType 1.0, hence the first element of the
tuple will always be 2.</p>
</dd></dl>

<dl class="definition function">
<dt class="title" id="pygame.freetype.init">
<tt class="descclassname">pygame.freetype.</tt><tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.init" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Initialize the underlying FreeType 2 library.</span></div>
<div class="line"><span class="signature">init(cache_size=64, resolution=72) -&gt; None</span></div>
</div>
<p>This function initializes the underlying FreeType 2 library and must be
called before trying to use any of the functionality of the &#8216;freetype&#8217;
module.</p>
<p>However, if the module is available, this function will be automatically
called by <tt class="docutils literal"><span class="pre">pygame.init()</span></tt>. It is safe to call this function more than
once.</p>
<p>Optionally, you may specify a default size for the Glyph cache: this is the
maximum amount of glyphs that will be cached at any given time by the
module. Exceedingly small values will be automatically tuned for
performance. Also a default pixel resolution, in dots per inch, can
be given to adjust face scaling.</p>
</dd></dl>

<dl class="definition function">
<dt class="title" id="pygame.freetype.quit">
<tt class="descclassname">pygame.freetype.</tt><tt class="descname">quit</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.quit" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Shuts down the underlying FreeType 2 library.</span></div>
<div class="line"><span class="signature">quit() -&gt; None</span></div>
</div>
<p>This function de-initializes the &#8216;freetype&#8217; module. After calling this
function, you should not invoke any class, method or function related to the
&#8216;freetype&#8217; module as they are likely to fail or might give unpredictable
results. It is safe to call this function even if the module hasn&#8217;t been
initialized yet.</p>
</dd></dl>

<dl class="definition function">
<dt class="title" id="pygame.freetype.was_init">
<tt class="descclassname">pygame.freetype.</tt><tt class="descname">was_init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.was_init" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Returns whether the the FreeType 2 library is initialized.</span></div>
<div class="line"><span class="signature">was_init() -&gt; bool</span></div>
</div>
<p>Returns whether the the FreeType 2 library is initialized.</p>
</dd></dl>

<dl class="definition function">
<dt class="title" id="pygame.freetype.get_default_resolution">
<tt class="descclassname">pygame.freetype.</tt><tt class="descname">get_default_resolution</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.get_default_resolution" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Return the default pixel size in dots per inch</span></div>
<div class="line"><span class="signature">get_default_resolution() -&gt; long</span></div>
</div>
<p>Returns the default pixel size, in dots per inch for the module. At
initial module load time the value is 72.</p>
</dd></dl>

<dl class="definition function">
<dt class="title" id="pygame.freetype.set_default_resolution">
<tt class="descclassname">pygame.freetype.</tt><tt class="descname">set_default_resolution</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.set_default_resolution" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Set the default pixel size in dots per inch for the module</span></div>
<div class="line"><span class="signature">set_default_resolution([resolution]) -&gt; None</span></div>
</div>
<p>Set the default pixel size, in dots per inch, for the module. If the
optional argument is omitted or zero the resolution is reset to 72.</p>
</dd></dl>

<dl class="definition function">
<dt class="title" id="pygame.freetype.get_default_font">
<tt class="descclassname">pygame.freetype.</tt><tt class="descname">get_default_font</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.get_default_font" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Get the filename of the default font</span></div>
<div class="line"><span class="signature">get_default_font() -&gt; string</span></div>
</div>
<p>Return the filename of the system font. This is not the full path to the
file. This file can usually be found in the same directory as the font
module, but it can also be bundled in separate archives.</p>
</dd></dl>

<dl class="definition class">
<dt class="title" id="pygame.freetype.Face">
<em class="property">class </em><tt class="descclassname">pygame.freetype.</tt><tt class="descname">Face</tt><a class="headerlink" href="#pygame.freetype.Face" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Creates a new Face instance from a supported font file.</span></div>
<div class="line"><span class="signature">Face(file, style=STYLE_NONE, ptsize=-1, face_index=0, vertical=0, ucs4=0, resolution=0) -&gt; Face</span></div>
</div>
<table border="1" class="toc docutils">
<colgroup>
<col width="39%" />
<col width="1%" />
<col width="60%" />
</colgroup>
<tbody valign="top">
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.name">pygame.freetype.Face.name</a></td>
<td></td>
<td>Gets the name of the font face.</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.path">pygame.freetype.Face.path</a></td>
<td></td>
<td>Gets the path of the font file</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.get_rect">pygame.freetype.Face.get_rect</a></td>
<td></td>
<td>Gets the size and offset of rendered text</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.get_metrics">pygame.freetype.Face.get_metrics</a></td>
<td></td>
<td>Gets glyph metrics for the face&#8217;s characters</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.height">pygame.freetype.Face.height</a></td>
<td></td>
<td>Gets the unscaled height of the face in font units</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.ascender">pygame.freetype.Face.ascender</a></td>
<td></td>
<td>get the unscaled ascent of the face in font units</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.descender">pygame.freetype.Face.descender</a></td>
<td></td>
<td>get the unscaled descent of the face in font units</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.get_sized_ascender">pygame.freetype.Face.get_sized_ascender</a></td>
<td></td>
<td>Gets the scaled ascent the face in pixels</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.get_sized_descender">pygame.freetype.Face.get_sized_descender</a></td>
<td></td>
<td>Gets the scaled descent the face in pixels</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.get_sized_height">pygame.freetype.Face.get_sized_height</a></td>
<td></td>
<td>Gets the scaled height of the face in pixels</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.get_sized_glyph_height">pygame.freetype.Face.get_sized_glyph_height</a></td>
<td></td>
<td>Gets the scaled height of the face in pixels</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.render">pygame.freetype.Face.render</a></td>
<td></td>
<td>Renders text on a surface</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.render_to">pygame.freetype.Face.render_to</a></td>
<td></td>
<td>Renders text to an existing surface</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.render_raw">pygame.freetype.Face.render_raw</a></td>
<td></td>
<td>Renders text as a string of bytes</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.render_raw_to">pygame.freetype.Face.render_raw_to</a></td>
<td></td>
<td>Renders text as a string of ints to an array</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.style">pygame.freetype.Face.style</a></td>
<td></td>
<td>Gets or sets the face&#8217;s style</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.underline">pygame.freetype.Face.underline</a></td>
<td></td>
<td>Gets or sets the face&#8217;s underline style</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.strong">pygame.freetype.Face.strong</a></td>
<td></td>
<td>Gets or sets the face&#8217;s strong style</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.oblique">pygame.freetype.Face.oblique</a></td>
<td></td>
<td>Gets or sets the face&#8217;s oblique style</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.wide">pygame.freetype.Face.wide</a></td>
<td></td>
<td>Gets or sets the face&#8217;s wide style</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.strength">pygame.freetype.Face.strength</a></td>
<td></td>
<td>Gets or sets the strength of the strong or wide styles</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.underline_adjustment">pygame.freetype.Face.underline_adjustment</a></td>
<td></td>
<td>Gets or sets an adjustment factor for the underline position</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.fixed_width">pygame.freetype.Face.fixed_width</a></td>
<td></td>
<td>Gets whether the face is fixed-width</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.antialiased">pygame.freetype.Face.antialiased</a></td>
<td></td>
<td>Face antialiasing mode</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.kerning">pygame.freetype.Face.kerning</a></td>
<td></td>
<td>Character kerning mode</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.vertical">pygame.freetype.Face.vertical</a></td>
<td></td>
<td>Face vertical mode</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.origin">pygame.freetype.Face.origin</a></td>
<td></td>
<td>Face render to text origin mode</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.pad">pygame.freetype.Face.pad</a></td>
<td></td>
<td>padded boundary mode</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.ucs4">pygame.freetype.Face.ucs4</a></td>
<td></td>
<td>Enables UCS-4 mode</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.resolution">pygame.freetype.Face.resolution</a></td>
<td></td>
<td>Output pixel resolution in dots per inch</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.set_transform">pygame.freetype.Face.set_transform</a></td>
<td></td>
<td>assign a glyph transformation matrix</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.delete_transform">pygame.freetype.Face.delete_transform</a></td>
<td></td>
<td>delete a glyph transformation matrix</td>
</tr>
<tr><td><a class="toc reference external" href="freetype.html#pygame.freetype.Face.get_transform">pygame.freetype.Face.get_transform</a></td>
<td></td>
<td>return the user assigned transformation matrix, or None</td>
</tr>
</tbody>
</table>
<p>&#8216;file&#8217; can be either a string representing the font&#8217;s filename, a file-like
object containing the font, or None; in this last case the default, built-in
font will be used.</p>
<p>Optionally, a *ptsize* argument may be specified to set the default size in
points which will be used to render the face. Such size can also be
specified manually on each method call. Because of the way the caching
system works, specifying a default size on the constructor doesn&#8217;t imply a
performance gain over manually passing the size on each function call.</p>
<p>If the font file has more than one face, the *index* argument may be
specified to specify which face index to load. Defaults to 0; face loading
will fail if the given index is not contained in the font.</p>
<p>The &#8216;style&#8217; argument will set the default style (oblique, underline, strong)
used to draw this face. This style may be overriden on any <tt class="docutils literal"><span class="pre">Face.render()</span></tt>
call.</p>
<p>The optional vertical argument, an integer, sets the default orientation
for the face: 0 (False) for horizontal, any other value (True) for vertical.
See <a class="reference internal" href="#pygame.freetype.Face.vertical" title="pygame.freetype.Face.vertical"><tt class="xref py py-attr docutils literal"><span class="pre">Face.vertical</span></tt></a>.</p>
<p>The optional ucs4 argument, an integer, sets the default text translation
mode: 0 (False) recognize UTF-16 surrogate pairs, any other value (True),
to treat unicode text as UCS-4, with no surrogate pairs. See
<a class="reference internal" href="#pygame.freetype.Face.ucs4" title="pygame.freetype.Face.ucs4"><tt class="xref py py-attr docutils literal"><span class="pre">Face.ucs4</span></tt></a>.</p>
<p>The optional resolution argument sets the pixel size, in dots per inch,
to use for scaling glyphs for this Face instance. If 0 then the default
module value, set by <tt class="xref py py-meth docutils literal"><span class="pre">freetype.init()</span></tt>, is used. The Face object&#8217;s
resolution can only be changed by reinitializing the instance.</p>
<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.name">
<tt class="descname">name</tt><a class="headerlink" href="#pygame.freetype.Face.name" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Gets the name of the font face.</span></div>
<div class="line"><span class="signature">name -&gt; string</span></div>
</div>
<p>Read only. Returns the real (long) name of the font type face, as
specified on the font file.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.path">
<tt class="descname">path</tt><a class="headerlink" href="#pygame.freetype.Face.path" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Gets the path of the font file</span></div>
<div class="line"><span class="signature">path -&gt; unicode</span></div>
</div>
<p>Read only. Returns the path of the loaded font file</p>
</dd></dl>

<dl class="definition method">
<dt class="title" id="pygame.freetype.Face.get_rect">
<tt class="descname">get_rect</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Face.get_rect" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Gets the size and offset of rendered text</span></div>
<div class="line"><span class="signature">get_rect(text, style=STYLE_DEFAULT, rotation=0, ptsize=default) -&gt; rect</span></div>
</div>
<p>Gets the final dimensions and origin, in pixels, of &#8216;text&#8217; using the
current point size, style, rotation and orientation. These are either
taken from the arguments, if given, else from the default values set
for the face object.</p>
<p>Returns a rect containing the width and height of the text&#8217;s bounding
box and the position of the text&#8217;s origin. The origin can be used
to align separately rendered pieces of text. It gives the baseline
position and bearing at the start of the text.</p>
<p>If text is a char (byte) string, then its encoding is assumed to be
<tt class="docutils literal"><span class="pre">LATIN1</span></tt>.</p>
</dd></dl>

<dl class="definition method">
<dt class="title" id="pygame.freetype.Face.get_metrics">
<tt class="descname">get_metrics</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Face.get_metrics" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Gets glyph metrics for the face&#8217;s characters</span></div>
<div class="line"><span class="signature">get_metrics(text, ptsize=default) -&gt; [(...), ...]</span></div>
</div>
<p>Returns the glyph metrics for each character in &#8216;text&#8217;.</p>
<p>The glyph metrics are returned inside a list; each character will be
represented as a tuple inside the list with the following values:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">(</span><span class="n">min_x</span><span class="p">,</span> <span class="n">max_x</span><span class="p">,</span> <span class="n">min_y</span><span class="p">,</span> <span class="n">max_y</span><span class="p">,</span> <span class="n">horizontal_advance_x</span><span class="p">,</span> <span class="n">horizontal_advance_y</span><span class="p">)</span>
</pre></div>
</div>
<p>The bounding box min_x, max_y, min_y, and max_y values are returned as
grid-fitted pixel coordinates of type int. The advance values are
float values.</p>
<p>The calculations are done using the face&#8217;s default size in points.
Optionally you may specify another point size to use.</p>
<p>The metrics are adjusted for the current rotation, strong, and oblique
settings.</p>
<p>If text is a char (byte) string, then its encoding is assumed to be
<tt class="docutils literal"><span class="pre">LATIN1</span></tt>.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.height">
<tt class="descname">height</tt><a class="headerlink" href="#pygame.freetype.Face.height" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Gets the unscaled height of the face in font units</span></div>
<div class="line"><span class="signature">height -&gt; int</span></div>
</div>
<p>Read only. Gets the height of the face. This is the average value of all
glyphs in the face.</p>
</dd></dl>

<dl class="definition method">
<dt class="title" id="pygame.freetype.Face.ascender">
<tt class="descname">ascender</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Face.ascender" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">get the unscaled ascent of the face in font units</span></div>
<div class="line"><span class="signature">ascender -&gt; int</span></div>
</div>
<p>Read only. Return the number of units from the face&#8217;s baseline to
the top of the bounding box.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.descender">
<tt class="descname">descender</tt><a class="headerlink" href="#pygame.freetype.Face.descender" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">get the unscaled descent of the face in font units</span></div>
<div class="line"><span class="signature">descender -&gt; int</span></div>
</div>
<p>Read only. Return the height in font units for the face descent.
The descent is the number of units from the face&#8217;s baseline to the
bottom of the bounding box.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.get_sized_ascender">
<tt class="descname">get_sized_ascender</tt><a class="headerlink" href="#pygame.freetype.Face.get_sized_ascender" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Gets the scaled ascent the face in pixels</span></div>
<div class="line"><span class="signature">get_sized_ascender() -&gt; int</span></div>
</div>
<p>Return the number of units from the face&#8217;s baseline to the top of the
bounding box. It is not adjusted for strong or rotation.</p>
</dd></dl>

<dl class="definition method">
<dt class="title" id="pygame.freetype.Face.get_sized_descender">
<tt class="descname">get_sized_descender</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Face.get_sized_descender" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Gets the scaled descent the face in pixels</span></div>
<div class="line"><span class="signature">get_sized_descender() -&gt; int</span></div>
</div>
<p>Return the number of pixels from the face&#8217;s baseline to the top of the
bounding box. It is not adjusted for strong or rotation.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.get_sized_height">
<tt class="descname">get_sized_height</tt><a class="headerlink" href="#pygame.freetype.Face.get_sized_height" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Gets the scaled height of the face in pixels</span></div>
<div class="line"><span class="signature">get_sized_height() -&gt; int</span></div>
</div>
<p>Read only. Gets the height of the face. This is the average value of all
glyphs in the face. It is not adjusted for strong or rotation.</p>
</dd></dl>

<dl class="definition method">
<dt class="title" id="pygame.freetype.Face.get_sized_glyph_height">
<tt class="descname">get_sized_glyph_height</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Face.get_sized_glyph_height" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Gets the scaled height of the face in pixels</span></div>
<div class="line"><span class="signature">get_sized_glyph_height() -&gt; int</span></div>
</div>
<p>Return the glyph bounding box height of the face in pixels.
This is the average value of all glyphs in the face.
It is not adjusted for strong or rotation.</p>
</dd></dl>

<dl class="definition method">
<dt class="title" id="pygame.freetype.Face.render">
<tt class="descname">render</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Face.render" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Renders text on a surface</span></div>
<div class="line"><span class="signature">render(text, fgcolor, bgcolor=None, style=STYLE_DEFAULT, rotation=0, ptsize=default) -&gt; (Surface, Rect)</span></div>
</div>
<p>Renturns a new <a class="tooltip reference internal" href="surface.html#pygame.Surface" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.Surface</span></tt><span class="tooltip-content">pygame object for representing images</span></a>, with the text rendered to it
in the color given by &#8216;fgcolor&#8217;. If <tt class="docutils literal"><span class="pre">bgcolor</span></tt> is given, the surface
will be filled with this color. If no background color is given,
the surface is filled with zero alpha opacity. Normally the returned
surface has a 32 bit pixel size. However, if <tt class="docutils literal"><span class="pre">bgcolor</span></tt> is <tt class="xref docutils literal"><span class="pre">None</span></tt>
and antialiasing is disabled a two color 8 bit surface with colorkey
set for the background color is returned.</p>
<p>The return value is a tuple: the new surface and the bounding
rectangle giving the size and origin of the rendered text.</p>
<p>If an empty string is passed for text then the returned Rect is zero
width and the height of the face. If dest is None the returned surface is
the same dimensions as the boundary rect. The rect will test False.</p>
<p>The rendering is done using the face&#8217;s default size in points and its
default style, without any rotation, and taking into account faces which
are set to be drawn vertically via the <a class="reference internal" href="#pygame.freetype.Face.vertical" title="pygame.freetype.Face.vertical"><tt class="xref py py-meth docutils literal"><span class="pre">Face.vertical()</span></tt></a> attribute.
Optionally you may specify another point size to use via the &#8216;ptsize&#8217;
argument, a text rotation via the &#8216;rotation&#8217; argument, or a new text
style via the &#8216;style&#8217; argument.</p>
<p>If text is a char (byte) string, then its encoding is assumed to be
<tt class="docutils literal"><span class="pre">LATIN1</span></tt>.</p>
</dd></dl>

<dl class="definition method">
<dt class="title" id="pygame.freetype.Face.render_to">
<tt class="descname">render_to</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Face.render_to" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Renders text to an existing surface</span></div>
<div class="line"><span class="signature">render(surf, dest, text, fgcolor, bgcolor=None, style=STYLE_DEFAULT, rotation=0, ptsize=default) -&gt; Rect</span></div>
</div>
<p>Renders the string &#8216;text&#8217; to a <a class="tooltip reference internal" href="surface.html#pygame.Surface" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.Surface</span></tt><span class="tooltip-content">pygame object for representing images</span></a> &#8216;surf&#8217;,
using the color &#8216;fgcolor&#8217;.</p>
<p>Argument &#8216;dest&#8217; is an (x, y) surface coordinate pair. If either x
or y is not an integer it is converted to one if possible.
Any sequence, including Rect, for which the first two elements are
positions x and y is accepted.</p>
<p>If a background color is given, the surface is first filled with that
color. The text is blitted next. Both the background fill and text
rendering involve full alpha blits. That is, the alpha values of
both the foreground and background colors, as well as those of the
destination surface if it has per-pixel alpha.</p>
<p>The return value is a rectangle giving the size and position of the
rendered text within the surface.</p>
<p>If an empty string is passed for text then the returned Rect is zero
width and the height of the face. The rect will test False.</p>
<p>By default, the point size and style set for the face are used
if not passed as arguments. The text is unrotated unless a non-zero
rotation value is given.</p>
<p>If text is a char (byte) string, then its encoding is assumed to be
<tt class="docutils literal"><span class="pre">LATIN1</span></tt>.</p>
</dd></dl>

<dl class="definition method">
<dt class="title" id="pygame.freetype.Face.render_raw">
<tt class="descname">render_raw</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Face.render_raw" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Renders text as a string of bytes</span></div>
<div class="line"><span class="signature">render_raw(text, style=STYLE_DEFAULT, rotation=0, ptsize=default, invert=False) -&gt; (bytes, (int, int))</span></div>
</div>
<p>Like <tt class="docutils literal"><span class="pre">Face.render()</span></tt> but the tuple returned is an 8 bit
monochrome string of bytes and its size. The forground color is 255, the
background 0, useful as an alpha mask for a foreground pattern.</p>
</dd></dl>

<dl class="definition method">
<dt class="title" id="pygame.freetype.Face.render_raw_to">
<tt class="descname">render_raw_to</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Face.render_raw_to" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Renders text as a string of ints to an array</span></div>
<div class="line"><span class="signature">render_raw_to(array, text, dest=None, style=STYLE_DEFAULT, rotation=0, ptsize=default, invert=False) -&gt; (int, int)</span></div>
</div>
<p>Render to an array object exposing an array struct interface. The array
must be two dimensional with integer items. The default dest value, None,
is equivalent to (0, 0).</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.style">
<tt class="descname">style</tt><a class="headerlink" href="#pygame.freetype.Face.style" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Gets or sets the face&#8217;s style</span></div>
<div class="line"><span class="signature">style -&gt; int</span></div>
</div>
<p>Gets or sets the default style of the Face. This default style will be
used for all text rendering and size calculations unless overriden
specifically in the `render()` or `get_size()` calls. The style value
may be a bitwise <tt class="docutils literal"><span class="pre">OR</span></tt> of one or more of the following constants:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">STYLE_NONE</span>
<span class="n">STYLE_UNDERLINE</span>
<span class="n">STYLE_OBLIQUE</span>
<span class="n">STYLE_STRONG</span>
<span class="n">STYLE_WIDE</span>
</pre></div>
</div>
<p>These constants may be found on the FreeType constants module.
Optionally, the default style can be modified or obtained accessing the
individual style attributes (underline, oblique, strong).</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.underline">
<tt class="descname">underline</tt><a class="headerlink" href="#pygame.freetype.Face.underline" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Gets or sets the face&#8217;s underline style</span></div>
<div class="line"><span class="signature">underline -&gt; bool</span></div>
</div>
<p>Gets or sets whether the face will be underlined when drawing text. This
default style value will be used for all text rendering and size
calculations unless overriden specifically in the `render()` or
`get_size()` calls, via the &#8216;style&#8217; parameter.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.strong">
<tt class="descname">strong</tt><a class="headerlink" href="#pygame.freetype.Face.strong" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Gets or sets the face&#8217;s strong style</span></div>
<div class="line"><span class="signature">strong -&gt; bool</span></div>
</div>
<p>Gets or sets whether the face will be bold when drawing text. This
default style value will be used for all text rendering and size
calculations unless overriden specifically in the `render()` or
`get_size()` calls, via the &#8216;style&#8217; parameter.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.oblique">
<tt class="descname">oblique</tt><a class="headerlink" href="#pygame.freetype.Face.oblique" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Gets or sets the face&#8217;s oblique style</span></div>
<div class="line"><span class="signature">oblique -&gt; bool</span></div>
</div>
<p>Gets or sets whether the face will be rendered as oblique. This
default style value will be used for all text rendering and size
calculations unless overriden specifically in the `render()` or
`get_size()` calls, via the &#8216;style&#8217; parameter.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.wide">
<tt class="descname">wide</tt><a class="headerlink" href="#pygame.freetype.Face.wide" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Gets or sets the face&#8217;s wide style</span></div>
<div class="line"><span class="signature">wide -&gt; bool</span></div>
</div>
<p>Gets or sets whether the face will be stretched horizontally
when drawing text. It produces a result simular to font.Font&#8217;s
bold. This style is only available for unrotated text.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.strength">
<tt class="descname">strength</tt><a class="headerlink" href="#pygame.freetype.Face.strength" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Gets or sets the strength of the strong or wide styles</span></div>
<div class="line"><span class="signature">strength -&gt; float</span></div>
</div>
<p>The amount by which a face glyph&#8217;s size is enlarged for the
strong or wide transformations, as a fraction of the untransformed
size. For the wide style only the horizontal dimension is
increased. For strong text both the horizontal and vertical
dimensions are enlarged. A wide style of strength 1/12 is
equivalent to the font.Font bold style. The default is 1/36.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.underline_adjustment">
<tt class="descname">underline_adjustment</tt><a class="headerlink" href="#pygame.freetype.Face.underline_adjustment" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Gets or sets an adjustment factor for the underline position</span></div>
<div class="line"><span class="signature">underline_adjustment -&gt; float</span></div>
</div>
<p>Gets or sets a factor which, when positive, is multiplied with the
face&#8217;s underline offset to adjust the underline position. A negative
value turns an underline into a strikethrough or overline. It is
multiplied with the ascender. Accepted values are between -2.0 and 2.0
inclusive. A value of 0.5 closely matches Tango underlining. A value of
1.0 mimics SDL_ttf.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.fixed_width">
<tt class="descname">fixed_width</tt><a class="headerlink" href="#pygame.freetype.Face.fixed_width" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Gets whether the face is fixed-width</span></div>
<div class="line"><span class="signature">fixed_width -&gt; bool</span></div>
</div>
<p>Read only. Returns whether this Face is a fixed-width (bitmap) face.</p>
<p>Note that scalable faces whose glyphs are all the same width (i.e.
monospace <tt class="docutils literal"><span class="pre">TTF</span></tt> fonts used for programming) are not considered fixed
width.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.antialiased">
<tt class="descname">antialiased</tt><a class="headerlink" href="#pygame.freetype.Face.antialiased" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Face antialiasing mode</span></div>
<div class="line"><span class="signature">antialiased -&gt; bool</span></div>
</div>
<p>Gets or sets the face&#8217;s antialiasing mode. This defaults to <tt class="xref docutils literal"><span class="pre">True</span></tt> on
all faces, which are rendered with full 8 bit blending.</p>
<p>Setting this to <tt class="xref docutils literal"><span class="pre">False</span></tt> will enable monochrome rendering. This should
provide a small speed gain and reduce cache memory size.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.kerning">
<tt class="descname">kerning</tt><a class="headerlink" href="#pygame.freetype.Face.kerning" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Character kerning mode</span></div>
<div class="line"><span class="signature">kerning -&gt; bool</span></div>
</div>
<p>Gets or sets the face&#8217;s kerning mode. This defaults to False on all
faces, which will be rendered by default without kerning.</p>
<p>Setting this to true will change all rendering methods to do kerning
between character pairs for surface size calculation and all
render operations.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.vertical">
<tt class="descname">vertical</tt><a class="headerlink" href="#pygame.freetype.Face.vertical" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Face vertical mode</span></div>
<div class="line"><span class="signature">vertical -&gt; bool</span></div>
</div>
<p>Gets or sets whether the face is a vertical face such as faces in fonts
representing Kanji glyphs or other styles of vertical writing.</p>
<p>Changing this attribute will cause the face to be rendering vertically,
and affects all other methods which manage glyphs or text layouts to use
vertical metrics accordingly.</p>
<p>Note that the FreeType library doesn&#8217;t automatically detect whether a
face contains glyphs which are always supposed to be drawn vertically, so
this attribute must be set manually by the user.</p>
<p>Also note that several face formats (specially bitmap based ones) don&#8217;t
contain the necessary metrics to draw glyphs vertically, so drawing in
those cases will give unspecified results.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.origin">
<tt class="descname">origin</tt><a class="headerlink" href="#pygame.freetype.Face.origin" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Face render to text origin mode</span></div>
<div class="line"><span class="signature">vertical -&gt; bool</span></div>
</div>
<p>If set True, then when rendering to an existing surface, the position
is taken to be that of the text origin. Otherwise the render position is
the top-left corner of the text bounding box.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.pad">
<tt class="descname">pad</tt><a class="headerlink" href="#pygame.freetype.Face.pad" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">padded boundary mode</span></div>
<div class="line"><span class="signature">pad -&gt; bool</span></div>
</div>
<p>If set True, then the text boundary rectangle will be inflated to match
that of font.Font. Otherwise, the boundary rectangle is just large
enough for the text.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.ucs4">
<tt class="descname">ucs4</tt><a class="headerlink" href="#pygame.freetype.Face.ucs4" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Enables UCS-4 mode</span></div>
<div class="line"><span class="signature">ucs4 -&gt; bool</span></div>
</div>
<p>Gets or sets the decoding of Unicode textdecoding. By default, the
freetype module performs UTF-16 surrogate pair decoding on Unicode text.
This allows 32-bit escape sequences (&#8216;Uxxxxxxxx&#8217;) between 0x10000 and
0x10FFFF to represent their corresponding UTF-32 code points on Python
interpreters built with a UCS-2 unicode type (on Windows, for instance).
It also means character values within the UTF-16 surrogate area (0xD800
to 0xDFFF) are considered part of a surrogate pair. A malformed surrogate
pair will raise an UnicodeEncodeError. Setting ucs4 True turns surrogate
pair decoding off, letting interpreters with a UCS-4 unicode type access
the full UCS-4 character range.</p>
</dd></dl>

<dl class="definition attribute">
<dt class="title" id="pygame.freetype.Face.resolution">
<tt class="descname">resolution</tt><a class="headerlink" href="#pygame.freetype.Face.resolution" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">Output pixel resolution in dots per inch</span></div>
<div class="line"><span class="signature">resolution -&gt; int</span></div>
</div>
<p>Gets the pixel size used in scaling face glyphs for this Face instance.</p>
</dd></dl>

<dl class="definition method">
<dt class="title" id="pygame.freetype.Face.set_transform">
<tt class="descname">set_transform</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Face.set_transform" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">assign a glyph transformation matrix</span></div>
<div class="line"><span class="signature">set_transform(xx, xy, yx, yy) -&gt; None</span></div>
</div>
<p>Set a transform matrix for the face. If None, no matrix assigned.
The arguments can be any numeric type that can be converted
to a double. The matrix is applied after the strong transformation,
but before oblique and rotation.</p>
</dd></dl>

<dl class="definition method">
<dt class="title" id="pygame.freetype.Face.delete_transform">
<tt class="descname">delete_transform</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Face.delete_transform" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">delete a glyph transformation matrix</span></div>
<div class="line"><span class="signature">set_transform(xx, xy, yx, yy) -&gt; None</span></div>
</div>
<p>Remove the transformation matrix, if any.</p>
</dd></dl>

<dl class="definition method">
<dt class="title" id="pygame.freetype.Face.get_transform">
<tt class="descname">get_transform</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.freetype.Face.get_transform" title="Permalink to this definition"></a></dt>
<dd><div class="line-block">
<div class="line"><span class="summaryline">return the user assigned transformation matrix, or None</span></div>
<div class="line"><span class="signature">get_transform() -&gt; (double, double, double, double) or None</span></div>
</div>
<p>Return the transform matrix for the face. If None, no matrix is assigned.</p>
</dd></dl>

</dd></dl>

</dd></dl>

</div>

  </div>
          </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="gfxdraw.html" title="pygame.gfxdraw"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="font.html" title="pygame.font"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">Pygame v1.9.2 documentation</a> &raquo;</li>
    <script type="text/javascript" src="jquery.plugin.docscomments.js"></script>

      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2011, Pygame Developers.
    </div>
  </body>
</html>