vispy.visuals.text.text.
FontManager
Bases: object
object
Helper to create TextureFont instances and reuse them when possible
get_font
Get a font described by face and size
SDFRendererCPU
Render SDFs using the CPU.
render_to_texture
TextVisual
Bases: vispy.visuals.visual.Visual
vispy.visuals.visual.Visual
Visual that displays text
extensions (see comments in fragment shader below).
Text to display. Can also be a list of strings. Note: support for list of str might be removed soon in favor of text collections.
Color to use.
Bold face.
Italic face.
Font face to use.
Point size to use.
Position (x, y) or (x, y, z) of the text. Can also be a list of tuple if text is a list.
Rotation (in degrees) of the text clockwise.
Horizontal text anchor.
Vertical text anchor.
Rendering method for text characters. Either ‘cpu’ (default) or ‘gpu’. The ‘cpu’ method should perform better on remote backends like those based on WebGL. The ‘gpu’ method should produce higher quality results.
Font manager to use (can be shared if the GLContext is shared).
FRAGMENT_SHADER
VERTEX_SHADER
anchors
bold
color
The color of the text
face
font_size
The font size (in points) of the text
italic
pos
The position of the text anchor in the local coordinate frame
rotation
The rotation of the text (clockwise, in degrees)
text
The text string
TextureFont
Gather a set of glyphs relative to a given font name and size
This currently stores characters in a TextureAtlas object which uses a 2D RGB texture to store unsigned 8-bit integer data. In the future this could be changed to a GL_R8 texture instead of RGB when OpenGL ES 3.0+ is standard. Since VisPy tries to stay compatible with OpenGL ES 2.0 we are using an RGB texture. Using a single channel texture should improve performance by requiring less data to be sent to the GPU and to remote backends (jupyter notebook).
GL_R8
RGB
Dict with entries “face”, “size”, “bold”, “italic”.
SDF renderer to use.
ratio
Ratio of the initial high-res to final stored low-res glyph
slop
Extra space along each glyph edge due to SDF borders