1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml">
6
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
<title>pygame.font — Pygame v1.9.2 documentation</title>
9
<link rel="stylesheet" href="../_static/pygame.css" type="text/css" />
10
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
11
<script type="text/javascript">
12
var DOCUMENTATION_OPTIONS = {
15
COLLAPSE_INDEX: false,
20
<script type="text/javascript" src="../_static/jquery.js"></script>
21
<script type="text/javascript" src="../_static/underscore.js"></script>
22
<script type="text/javascript" src="../_static/doctools.js"></script>
23
<link rel="shortcut icon" href="../_static/pygame.ico"/>
24
<link rel="top" title="Pygame v1.9.2 documentation" href="../index.html" />
25
<link rel="next" title="pygame.freetype" href="freetype.html" />
26
<link rel="prev" title="pygame.examples" href="examples.html" />
30
<div class="document">
36
<a href="http://www.pygame.org/">
37
<img src="../_static/pygame_tiny.png"/>
39
<h5>pygame documentation</h5>
41
<td class="pagelinks">
44
<a href="http://www.pygame.org/">Pygame Home</a> ||
45
<a href="../index.html">Help Contents</a> ||
46
<a href="../genindex.html">Reference Index</a> ||
49
<a href="camera.html">camera</a> ||
50
<a href="cdrom.html">cdrom</a> ||
51
<a href="color.html">Color</a> ||
52
<a href="cursors.html">cursors</a> ||
53
<a href="display.html">display</a> ||
54
<a href="draw.html">draw</a> ||
55
<a href="event.html">event</a> ||
56
<a href="examples.html">examples</a> ||
57
<a href="font.html">font</a> ||
58
<a href="freetype.html">freetype</a> ||
59
<a href="gfxdraw.html">gfxdraw</a> ||
60
<a href="image.html">image</a> ||
61
<a href="joystick.html">joystick</a> ||
62
<a href="key.html">key</a> ||
63
<a href="locals.html">locals</a> ||
64
<a href="mask.html">mask</a> ||
65
<a href="math.html">math</a> ||
66
<a href="midi.html">midi</a> ||
67
<a href="mixer.html">mixer</a> ||
68
<a href="mouse.html">mouse</a> ||
69
<a href="movie.html">movie</a> ||
70
<a href="music.html">music</a> ||
71
<a href="overlay.html">Overlay</a> ||
72
<a href="pixelarray.html">PixelArray</a> ||
73
<a href="pixelcopy.html">pixelcopy</a> ||
74
<a href="pygame.html">pygame</a> ||
75
<a href="rect.html">Rect</a> ||
76
<a href="scrap.html">scrap</a> ||
77
<a href="sndarray.html">sndarray</a> ||
78
<a href="sprite.html">sprite</a> ||
79
<a href="surface.html">Surface</a> ||
80
<a href="surfarray.html">surfarray</a> ||
81
<a href="tests.html">tests</a> ||
82
<a href="time.html">time</a> ||
83
<a href="transform.html">transform</a> ||
84
<a href="pygame.html#module-pygame.version">version</a>
91
<div class="documentwrapper">
94
<div class="sectionwrapper">
95
<div class="section" id="module-pygame.font">
96
<span id="pygame-font"></span><dl class="definition module">
97
<dt class="title module">
98
<tt class="docutils literal"><span class="pre">pygame.font</span></tt></dt>
99
<dd><div class="line-block">
100
<div class="line"><span class="summaryline">pygame module for loading and rendering fonts</span></div>
102
<table border="1" class="toc docutils">
109
<tr><td><a class="toc reference external" href="font.html#pygame.font.init">pygame.font.init</a></td>
111
<td>initialize the font module</td>
113
<tr><td><a class="toc reference external" href="font.html#pygame.font.quit">pygame.font.quit</a></td>
115
<td>uninitialize the font module</td>
117
<tr><td><a class="toc reference external" href="font.html#pygame.font.get_init">pygame.font.get_init</a></td>
119
<td>true if the font module is initialized</td>
121
<tr><td><a class="toc reference external" href="font.html#pygame.font.get_default_font">pygame.font.get_default_font</a></td>
123
<td>get the filename of the default font</td>
125
<tr><td><a class="toc reference external" href="font.html#pygame.font.get_fonts">pygame.font.get_fonts</a></td>
127
<td>get all available fonts</td>
129
<tr><td><a class="toc reference external" href="font.html#pygame.font.match_font">pygame.font.match_font</a></td>
131
<td>find a specific font on the system</td>
133
<tr><td><a class="toc reference external" href="font.html#pygame.font.SysFont">pygame.font.SysFont</a></td>
135
<td>create a Font object from the system fonts</td>
137
<tr><td><a class="toc reference external" href="font.html#pygame.font.Font">pygame.font.Font</a></td>
139
<td>create a new Font object from a file</td>
143
<p>The font module allows for rendering TrueType fonts into a new Surface object.
144
It accepts any UCS-2 character (‘u0001’ to ‘uFFFF’). This module is optional
145
and requires SDL_ttf as a dependency. You should test that <a class="tooltip reference internal" href="#module-pygame.font" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.font</span></tt><span class="tooltip-content">pygame module for loading and rendering fonts</span></a>
146
is available and initialized before attempting to use the module.</p>
147
<p>Most of the work done with fonts are done by using the actual Font objects. The
148
module by itself only has routines to initialize the module and create Font
149
objects with <tt class="docutils literal"><span class="pre">pygame.font.Font()</span></tt>.</p>
150
<p>You can load fonts from the system by using the <tt class="docutils literal"><span class="pre">pygame.font.SysFont()</span></tt>
151
function. There are a few other functions to help lookup the system fonts.</p>
152
<p>Pygame comes with a builtin default font. This can always be accessed by
153
passing None as the font name.</p>
154
<p>To use the <a class="tooltip reference internal" href="freetype.html#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 computer fonts</span></a> based <tt class="xref py py-mod docutils literal"><span class="pre">pygame.ftfont</span></tt> as
155
<a class="tooltip reference internal" href="#module-pygame.font" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.font</span></tt><span class="tooltip-content">pygame module for loading and rendering fonts</span></a> define the enviroment variable PYGAME_FREETYPE before the
156
first import of <a class="tooltip reference internal" href="pygame.html#module-pygame" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame</span></tt><span class="tooltip-content">the top level pygame package</span></a>. <tt class="xref py py-mod docutils literal"><span class="pre">pygame.ftfont</span></tt> is a <a class="tooltip reference internal" href="#module-pygame.font" title=""><tt class="xref py py-mod docutils literal"><span class="pre">pygame.font</span></tt><span class="tooltip-content">pygame module for loading and rendering fonts</span></a>
157
compatible module that passes all but one of the font module unit tests:
158
it does not have the UCS-2 limitation of the SDL_ttf based font module, so
159
fails to raise an exception for a code point greater than ‘uFFFF’. If
160
<a class="tooltip reference internal" href="freetype.html#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 computer fonts</span></a> is unavailable then the SDL_ttf font module will be
162
<dl class="definition function">
163
<dt class="title" id="pygame.font.init">
164
<tt class="descclassname">pygame.font.</tt><tt class="descname">init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.init" title="Permalink to this definition">¶</a></dt>
165
<dd><div class="line-block">
166
<div class="line"><span class="summaryline">initialize the font module</span></div>
167
<div class="line"><span class="signature">init() -> None</span></div>
169
<p>This method is called automatically by <tt class="docutils literal"><span class="pre">pygame.init()</span></tt>. It initializes the
170
font module. The module must be initialized before any other functions will
172
<p>It is safe to call this function more than once.</p>
175
<dl class="definition function">
176
<dt class="title" id="pygame.font.quit">
177
<tt class="descclassname">pygame.font.</tt><tt class="descname">quit</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.quit" title="Permalink to this definition">¶</a></dt>
178
<dd><div class="line-block">
179
<div class="line"><span class="summaryline">uninitialize the font module</span></div>
180
<div class="line"><span class="signature">quit() -> None</span></div>
182
<p>Manually uninitialize SDL_ttf’s font system. This is called automatically by
183
<tt class="docutils literal"><span class="pre">pygame.quit()</span></tt>.</p>
184
<p>It is safe to call this function even if font is currently not initialized.</p>
187
<dl class="definition function">
188
<dt class="title" id="pygame.font.get_init">
189
<tt class="descclassname">pygame.font.</tt><tt class="descname">get_init</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.get_init" title="Permalink to this definition">¶</a></dt>
190
<dd><div class="line-block">
191
<div class="line"><span class="summaryline">true if the font module is initialized</span></div>
192
<div class="line"><span class="signature">get_init() -> bool</span></div>
194
<p>Test if the font module is initialized or not.</p>
197
<dl class="definition function">
198
<dt class="title" id="pygame.font.get_default_font">
199
<tt class="descclassname">pygame.font.</tt><tt class="descname">get_default_font</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.get_default_font" title="Permalink to this definition">¶</a></dt>
200
<dd><div class="line-block">
201
<div class="line"><span class="summaryline">get the filename of the default font</span></div>
202
<div class="line"><span class="signature">get_default_font() -> string</span></div>
204
<p>Return the filename of the system font. This is not the full path to the
205
file. This file can usually be found in the same directory as the font
206
module, but it can also be bundled in separate archives.</p>
209
<dl class="definition function">
210
<dt class="title" id="pygame.font.get_fonts">
211
<tt class="descclassname">pygame.font.</tt><tt class="descname">get_fonts</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.get_fonts" title="Permalink to this definition">¶</a></dt>
212
<dd><div class="line-block">
213
<div class="line"><span class="summaryline">get all available fonts</span></div>
214
<div class="line"><span class="signature">get_fonts() -> list of strings</span></div>
216
<p>Returns a list of all the fonts available on the system. The names of the
217
fonts will be set to lowercase with all spaces and punctuation removed. This
218
works on most systems, but some will return an empty list if they cannot
222
<dl class="definition function">
223
<dt class="title" id="pygame.font.match_font">
224
<tt class="descclassname">pygame.font.</tt><tt class="descname">match_font</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.match_font" title="Permalink to this definition">¶</a></dt>
225
<dd><div class="line-block">
226
<div class="line"><span class="summaryline">find a specific font on the system</span></div>
227
<div class="line"><span class="signature">match_font(name, bold=False, italic=False) -> path</span></div>
229
<p>Returns the full path to a font file on the system. If bold or italic are
230
set to true, this will attempt to find the correct family of font.</p>
231
<p>The font name can actually be a comma separated list of font names to try.
232
If none of the given names are found, None is returned.</p>
234
<div class="highlight-python"><div class="highlight"><pre><span class="k">print</span> <span class="n">pygame</span><span class="o">.</span><span class="n">font</span><span class="o">.</span><span class="n">match_font</span><span class="p">(</span><span class="s">'bitstreamverasans'</span><span class="p">)</span>
235
<span class="c"># output is: /usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf</span>
236
<span class="c"># (but only if you have Vera on your system)</span>
241
<dl class="definition function">
242
<dt class="title" id="pygame.font.SysFont">
243
<tt class="descclassname">pygame.font.</tt><tt class="descname">SysFont</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.SysFont" title="Permalink to this definition">¶</a></dt>
244
<dd><div class="line-block">
245
<div class="line"><span class="summaryline">create a Font object from the system fonts</span></div>
246
<div class="line"><span class="signature">SysFont(name, size, bold=False, italic=False) -> Font</span></div>
248
<p>Return a new Font object that is loaded from the system fonts. The font will
249
match the requested bold and italic flags. If a suitable system font is not
250
found this will fallback on loading the default pygame font. The font name
251
can be a comma separated list of font names to look for.</p>
254
<dl class="definition class">
255
<dt class="title" id="pygame.font.Font">
256
<em class="property">class </em><tt class="descclassname">pygame.font.</tt><tt class="descname">Font</tt><a class="headerlink" href="#pygame.font.Font" title="Permalink to this definition">¶</a></dt>
257
<dd><div class="line-block">
258
<div class="line"><span class="summaryline">create a new Font object from a file</span></div>
259
<div class="line"><span class="signature">Font(filename, size) -> Font</span></div>
260
<div class="line"><span class="signature">Font(object, size) -> Font</span></div>
262
<table border="1" class="toc docutils">
269
<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.render">pygame.font.Font.render</a></td>
271
<td>draw text on a new Surface</td>
273
<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.size">pygame.font.Font.size</a></td>
275
<td>determine the amount of space needed to render text</td>
277
<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.set_underline">pygame.font.Font.set_underline</a></td>
279
<td>control if text is rendered with an underline</td>
281
<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.get_underline">pygame.font.Font.get_underline</a></td>
283
<td>check if text will be rendered with an underline</td>
285
<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.set_bold">pygame.font.Font.set_bold</a></td>
287
<td>enable fake rendering of bold text</td>
289
<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.get_bold">pygame.font.Font.get_bold</a></td>
291
<td>check if text will be rendered bold</td>
293
<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.set_italic">pygame.font.Font.set_italic</a></td>
295
<td>enable fake rendering of italic text</td>
297
<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.metrics">pygame.font.Font.metrics</a></td>
299
<td>Gets the metrics for each character in the pased string.</td>
301
<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.get_italic">pygame.font.Font.get_italic</a></td>
303
<td>check if the text will be rendered italic</td>
305
<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.get_linesize">pygame.font.Font.get_linesize</a></td>
307
<td>get the line space of the font text</td>
309
<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.get_height">pygame.font.Font.get_height</a></td>
311
<td>get the height of the font</td>
313
<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.get_ascent">pygame.font.Font.get_ascent</a></td>
315
<td>get the ascent of the font</td>
317
<tr><td><a class="toc reference external" href="font.html#pygame.font.Font.get_descent">pygame.font.Font.get_descent</a></td>
319
<td>get the descent of the font</td>
323
<p>Load a new font from a given filename or a python file object. The size is
324
the height of the font in pixels. If the filename is None the Pygame default
325
font will be loaded. If a font cannot be loaded from the arguments given an
326
exception will be raised. Once the font is created the size cannot be
328
<p>Font objects are mainly used to render text into new Surface objects. The
329
render can emulate bold or italic features, but it is better to load from a
330
font with actual italic or bold glyphs. The rendered text can be regular
331
strings or unicode.</p>
332
<dl class="definition method">
333
<dt class="title" id="pygame.font.Font.render">
334
<tt class="descname">render</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.render" title="Permalink to this definition">¶</a></dt>
335
<dd><div class="line-block">
336
<div class="line"><span class="summaryline">draw text on a new Surface</span></div>
337
<div class="line"><span class="signature">render(text, antialias, color, background=None) -> Surface</span></div>
339
<p>This creates a new Surface with the specified text rendered on it. Pygame
340
provides no way to directly draw text on an existing Surface: instead you
341
must use <tt class="docutils literal"><span class="pre">Font.render()</span></tt> to create an image (Surface) of the text, then
342
blit this image onto another Surface.</p>
343
<p>The text can only be a single line: newline characters are not rendered.
344
Null characters (‘x00’) raise a TypeError. Both Unicode and char (byte)
345
strings are accepted. For Unicode strings only UCS-2 characters (‘u0001’
346
to ‘uFFFF’) are recognized. Anything greater raises a UnicodeError. For
347
char strings a <tt class="docutils literal"><span class="pre">LATIN1</span></tt> encoding is assumed. The antialias argument is
348
a boolean: if true the characters will have smooth edges. The color
349
argument is the color of the text [e.g.: (0,0,255) for blue]. The
350
optional background argument is a color to use for the text background.
351
If no background is passed the area outside the text will be transparent.</p>
352
<p>The Surface returned will be of the dimensions required to hold the text.
353
(the same as those returned by Font.size()). If an empty string is passed
354
for the text, a blank surface will be returned that is one pixel wide and
355
the height of the font.</p>
356
<p>Depending on the type of background and antialiasing used, this returns
357
different types of Surfaces. For performance reasons, it is good to know
358
what type of image will be used. If antialiasing is not used, the return
359
image will always be an 8bit image with a two color palette. If the
360
background is transparent a colorkey will be set. Antialiased images are
361
rendered to 24-bit <tt class="docutils literal"><span class="pre">RGB</span></tt> images. If the background is transparent a
362
pixel alpha will be included.</p>
363
<p>Optimization: if you know that the final destination for the text (on the
364
screen) will always have a solid background, and the text is antialiased,
365
you can improve performance by specifying the background color. This will
366
cause the resulting image to maintain transparency information by
367
colorkey rather than (much less efficient) alpha values.</p>
368
<p>If you render ‘n’ a unknown char will be rendered. Usually a rectangle.
369
Instead you need to handle new lines yourself.</p>
370
<p>Font rendering is not thread safe: only a single thread can render text
374
<dl class="definition method">
375
<dt class="title" id="pygame.font.Font.size">
376
<tt class="descname">size</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.size" title="Permalink to this definition">¶</a></dt>
377
<dd><div class="line-block">
378
<div class="line"><span class="summaryline">determine the amount of space needed to render text</span></div>
379
<div class="line"><span class="signature">size(text) -> (width, height)</span></div>
381
<p>Returns the dimensions needed to render the text. This can be used to
382
help determine the positioning needed for text before it is rendered. It
383
can also be used for wordwrapping and other layout effects.</p>
384
<p>Be aware that most fonts use kerning which adjusts the widths for
385
specific letter pairs. For example, the width for “ae” will not always
386
match the width for “a” + “e”.</p>
389
<dl class="definition method">
390
<dt class="title" id="pygame.font.Font.set_underline">
391
<tt class="descname">set_underline</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.set_underline" title="Permalink to this definition">¶</a></dt>
392
<dd><div class="line-block">
393
<div class="line"><span class="summaryline">control if text is rendered with an underline</span></div>
394
<div class="line"><span class="signature">set_underline(bool) -> None</span></div>
396
<p>When enabled, all rendered fonts will include an underline. The underline
397
is always one pixel thick, regardless of font size. This can be mixed
398
with the bold and italic modes.</p>
401
<dl class="definition method">
402
<dt class="title" id="pygame.font.Font.get_underline">
403
<tt class="descname">get_underline</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.get_underline" title="Permalink to this definition">¶</a></dt>
404
<dd><div class="line-block">
405
<div class="line"><span class="summaryline">check if text will be rendered with an underline</span></div>
406
<div class="line"><span class="signature">get_underline() -> bool</span></div>
408
<p>Return True when the font underline is enabled.</p>
411
<dl class="definition method">
412
<dt class="title" id="pygame.font.Font.set_bold">
413
<tt class="descname">set_bold</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.set_bold" title="Permalink to this definition">¶</a></dt>
414
<dd><div class="line-block">
415
<div class="line"><span class="summaryline">enable fake rendering of bold text</span></div>
416
<div class="line"><span class="signature">set_bold(bool) -> None</span></div>
418
<p>Enables the bold rendering of text. This is a fake stretching of the font
419
that doesn’t look good on many font types. If possible load the font from
420
a real bold font file. While bold, the font will have a different width
421
than when normal. This can be mixed with the italic and underline modes.</p>
424
<dl class="definition method">
425
<dt class="title" id="pygame.font.Font.get_bold">
426
<tt class="descname">get_bold</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.get_bold" title="Permalink to this definition">¶</a></dt>
427
<dd><div class="line-block">
428
<div class="line"><span class="summaryline">check if text will be rendered bold</span></div>
429
<div class="line"><span class="signature">get_bold() -> bool</span></div>
431
<p>Return True when the font bold rendering mode is enabled.</p>
434
<dl class="definition method">
435
<dt class="title" id="pygame.font.Font.set_italic">
436
<tt class="descname">set_italic</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.set_italic" title="Permalink to this definition">¶</a></dt>
437
<dd><div class="line-block">
438
<div class="line"><span class="summaryline">enable fake rendering of italic text</span></div>
439
<div class="line"><span class="signature">set_italic(bool) -> None</span></div>
441
<p>Enables fake rendering of italic text. This is a fake skewing of the font
442
that doesn’t look good on many font types. If possible load the font from
443
a real italic font file. While italic the font will have a different
444
width than when normal. This can be mixed with the bold and underline
448
<dl class="definition method">
449
<dt class="title" id="pygame.font.Font.metrics">
450
<tt class="descname">metrics</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.metrics" title="Permalink to this definition">¶</a></dt>
451
<dd><div class="line-block">
452
<div class="line"><span class="summaryline">Gets the metrics for each character in the pased string.</span></div>
453
<div class="line"><span class="signature">metrics(text) -> list</span></div>
455
<p>The list contains tuples for each character, which contain the minimum
456
<tt class="docutils literal"><span class="pre">X</span></tt> offset, the maximum <tt class="docutils literal"><span class="pre">X</span></tt> offset, the minimum <tt class="docutils literal"><span class="pre">Y</span></tt> offset, the
457
maximum <tt class="docutils literal"><span class="pre">Y</span></tt> offset and the advance offset (bearing plus width) of the
458
character. [(minx, maxx, miny, maxy, advance), (minx, maxx, miny, maxy,
459
advance), ...]. None is entered in the list for each unrecognized
463
<dl class="definition method">
464
<dt class="title" id="pygame.font.Font.get_italic">
465
<tt class="descname">get_italic</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.get_italic" title="Permalink to this definition">¶</a></dt>
466
<dd><div class="line-block">
467
<div class="line"><span class="summaryline">check if the text will be rendered italic</span></div>
468
<div class="line"><span class="signature">get_italic() -> bool</span></div>
470
<p>Return True when the font italic rendering mode is enabled.</p>
473
<dl class="definition method">
474
<dt class="title" id="pygame.font.Font.get_linesize">
475
<tt class="descname">get_linesize</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.get_linesize" title="Permalink to this definition">¶</a></dt>
476
<dd><div class="line-block">
477
<div class="line"><span class="summaryline">get the line space of the font text</span></div>
478
<div class="line"><span class="signature">get_linesize() -> int</span></div>
480
<p>Return the height in pixels for a line of text with the font. When
481
rendering multiple lines of text this is the recommended amount of space
485
<dl class="definition method">
486
<dt class="title" id="pygame.font.Font.get_height">
487
<tt class="descname">get_height</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.get_height" title="Permalink to this definition">¶</a></dt>
488
<dd><div class="line-block">
489
<div class="line"><span class="summaryline">get the height of the font</span></div>
490
<div class="line"><span class="signature">get_height() -> int</span></div>
492
<p>Return the height in pixels of the actual rendered text. This is the
493
average size for each glyph in the font.</p>
496
<dl class="definition method">
497
<dt class="title" id="pygame.font.Font.get_ascent">
498
<tt class="descname">get_ascent</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.get_ascent" title="Permalink to this definition">¶</a></dt>
499
<dd><div class="line-block">
500
<div class="line"><span class="summaryline">get the ascent of the font</span></div>
501
<div class="line"><span class="signature">get_ascent() -> int</span></div>
503
<p>Return the height in pixels for the font ascent. The ascent is the number
504
of pixels from the font baseline to the top of the font.</p>
507
<dl class="definition method">
508
<dt class="title" id="pygame.font.Font.get_descent">
509
<tt class="descname">get_descent</tt><big>(</big><big>)</big><a class="headerlink" href="#pygame.font.Font.get_descent" title="Permalink to this definition">¶</a></dt>
510
<dd><div class="line-block">
511
<div class="line"><span class="summaryline">get the descent of the font</span></div>
512
<div class="line"><span class="signature">get_descent() -> int</span></div>
514
<p>Return the height in pixels for the font descent. The descent is the
515
number of pixels from the font baseline to the bottom of the font.</p>
527
<div class="clearer"></div>
529
<div class="related">
532
<li class="right" style="margin-right: 10px">
533
<a href="../genindex.html" title="General Index"
534
accesskey="I">index</a></li>
536
<a href="freetype.html" title="pygame.freetype"
537
accesskey="N">next</a> |</li>
539
<a href="examples.html" title="pygame.examples"
540
accesskey="P">previous</a> |</li>
541
<li><a href="../index.html">Pygame v1.9.2 documentation</a> »</li>
542
<script type="text/javascript" src="jquery.plugin.docscomments.js"></script>
547
© Copyright 2011, Pygame Developers.
b'\\ No newline at end of file'