File: textbox.rst

package info (click to toggle)
psychopy 2020.2.10%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 44,056 kB
  • sloc: python: 119,649; javascript: 3,022; makefile: 148; sh: 125; xml: 9
file content (84 lines) | stat: -rw-r--r-- 2,102 bytes parent folder | download
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

:class:`TextBox`
------------------------------------------------------------------------

Attributes
=============

.. currentmodule:: psychopy.visual

.. autosummary::

    TextBox

.. note::

    The following `set______()` attributes all have equivalent `get______()` attributes:

.. autosummary::

    TextBox.setText
    TextBox.setPosition
    TextBox.setOri
    TextBox.setHorzAlign
    TextBox.setVertAlign
    TextBox.setHorzJust
    TextBox.setVertJust
    TextBox.setFontColor
    TextBox.setBorderColor
    TextBox.setBackgroundColor
    TextBox.setTextGridLineColor
    TextBox.setTextGridLineWidth
    TextBox.setInterpolated
    TextBox.setOpacity
    TextBox.setAutoLog
    TextBox.draw

.. note::

    TextBox also provides the following read-only functions:

.. autosummary::

    TextBox.getSize
    TextBox.getName
    TextBox.getDisplayedText
    TextBox.getValidStrokeWidths
    TextBox.getLineSpacing
    TextBox.getGlyphPositionForTextIndex
    TextBox.getTextGridCellPlacement

Helper functions:
=================

    **getFontManager()**

    FontManager provides a simple API for finding and loading font files
    (.ttf) via the FreeType lib

    The FontManager finds supported font files on the computer and
    initially creates a dictionary containing the information about
    available fonts. This can be used to quickly determine what font family
    names are available on the computer and what styles (bold, italic) are
    supported for each family.

    This font information can then be used to create the resources necessary
    to display text using a given font family, style, size, color, and dpi.

    The FontManager is currently used by the psychopy.visual.TextBox stim
    type. A user script can access the FontManager via:

    *font_mngr=visual.textbox.getFontManager()*

    Once a font of a given size and dpi has been created; it is cached by the
    FontManager and can be used by all TextBox instances created within the
    experiment.


Details
=============

.. autoclass:: TextBox
    :members:
    :undoc-members:
    :inherited-members: