OpenGLContext.scenegraph.text.toolsfont
rendering of TTF outlines (as provided by _fonttools)
Classes
class _OutlineFont(
Font
):
Outline-Glyph specialisation of a fonttools-based font
class _SolidFont(
Font
):
Solid-Glyph specialisation of a fonttools-based font
class _ToolsFontProvider(
TTFFontProvider
):
Singleton for creating new ToolsFont fonts
class OutlineGlyph(
Glyph
):
Glyph that can render to outlines, contours and control-points
class SolidGlyph(
OutlineGlyph
):
Glyph composed of triangle geometry
renderCap(
self
,
scale
= 400.0
,
front
= 1
)
The cap is generated with GLU tessellation routines...
renderExtrusion(
self
,
scale
= 400.0
,
distance
= 1.0
)
Render the extrusion of the font backward by distance (using GLE)
This is pretty simple, save that there's no good
way to specify the normals for the edge properly :( ,
basically anything we do is going to look weird because
we can only specify one normal for each vertex on
the outline.
class ToolsFontMixIn(
object
):
Mixin providing ToolsFont common operations
__init__(
self
,
fontStyle
= None
,
font
= None
)
Initialise the 3D-font object
- fontStyle
- fontStyle node for this font, normally should be a FontStyle3D node to provide extra information regarding extrusion, capping and the like. Otherwise uses defaults for just about everything.
lists(
self
,
value
,
mode
= None
)
Get a sequence of display-list integers for value
Basically, this does a bit of trickery to do
as-required compilation of display-lists, so
that only those characters actually required
by the displayed text are compiled.
NOTE: Must be called from within the rendering
thread and within the rendering pass!