| |
- BitmapFontMixIn(object)
-
- WGLBitmapFont(NoDepthBufferMixIn, BitmapFontMixIn, WGLFont)
- Font(object)
-
- WGLFont
-
- WGLBitmapFont(NoDepthBufferMixIn, BitmapFontMixIn, WGLFont)
- WGLOutlineFont(PolygonalFontMixIn, WGLFont)
- NoDepthBufferMixIn(object)
-
- WGLBitmapFont(NoDepthBufferMixIn, BitmapFontMixIn, WGLFont)
- PolygonalFontMixIn(object)
-
- WGLOutlineFont(PolygonalFontMixIn, WGLFont)
class WGLBitmapFont(NoDepthBufferMixIn, BitmapFontMixIn, WGLFont) |
|
A WGL-provided Bitmap Font
Note: This is _not_ finished, or even particularly
functional! There is no currently satisfying way to
get bitmap-font metrics from WGL, so there's no way
to do formatting correctly |
|
- Method resolution order:
- WGLBitmapFont
- NoDepthBufferMixIn
- BitmapFontMixIn
- WGLFont
- Font
- object
Methods defined here:
- _createSingleChar(self, wgldc, char, base=None)
- Create the single-character display list
Because the Bitmap font doesn't get any information
regarding the metrics, we actually wind up generating
an outline font first, then overwriting the display-list
with the bitmap-font display-list. It's inefficient,
but I don't see a better way at the moment.
Data and non-method functions defined here:
- __doc__ = "A WGL-provided Bitmap Font\n\n\tNote: This is _not_..., so there's no way\n\tto do formatting correctly\n\t"
- __module__ = 'OpenGLContext.scenegraph.text.wglfont'
- format = 'bitmap'
Methods inherited from NoDepthBufferMixIn:
- render(self, *args, **named)
- Special depth-buffer mode for direct-to-screen bitmap fonts
Basically we don't want the direct-to-screen bitmap
fonts to generate depth-buffer blocks.
Data and non-method functions inherited from NoDepthBufferMixIn:
- __dict__ = <dict-proxy object at 0x079B00A0>
- __weakref__ = <member '__weakref__' of 'NoDepthBufferMixIn' objects>
Methods inherited from BitmapFontMixIn:
- centerJustify(self, lines, fontStyle, mode=None)
- Center-justify a list of lines
- leftJustify(self, lines, fontStyle, mode=None)
- Left-justify a list of lines
- rightJustify(self, lines, fontStyle, mode=None)
- Right-justify a list of lines
Methods inherited from WGLFont:
- __init__(self, fontStyle=None, deviation=0.0050000000000000001, extrusion=0.0)
- _uiFont(self)
- Get the appropriate UI-library font for this font
Note: for some reason this object is _not_ properly
reference counted. You will need to hold a reference
to it until _after_ you've called wglUseFont*
- createChar(self, char, mode=None)
- Create a single-character display list
- fastCreate(self, source, mode=None)
- Create display list & metrics for all items in char
This is breaking for the "normal" pattern to minimise
the number of DCs, Handles, etceteras we need to build.
- lineHeight(self, mode=None)
- Compute the height of a line for this font
WGL doesn't really tell us this, so we fudge it...
- 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!
Data and non-method functions inherited from WGLFont:
- _lineHeight = 0
Methods inherited from Font:
- __del__(self)
- Clean up our display lists on deletion
- getChar(self, char, mode=None)
- Get (and/or create) a single-character display-list (with metrics)
- getSpacing(self, fontStyle, mode=None)
- Get the vertical spacing multiplier
- normalise(self, value)
- Return a normalised value for the given value
In our case, this means decoding utf-8 strings
if they are passed.
- toLines(self, value, mode=None)
- Convert value to a set of expanded lines
Basically what this does is split value by line,
then expand tabs (using 4-spaces per-tab),
then return a list of Line instances for the
resulting strings.
- totalHeight(self, lines, spacing, mode=None)
- Calculate total height of the line-set
- totalWidth(self, lines, mode=None)
- Calculate total width of the line-set
- verticalAdjust(self, spacing, lines, fontStyle, mode=None)
- Calculate adjustement for first line's position
This needs to take into account the fontStyle's
"minor" alignment, which specifies one of:
FIRST -- use the bottom of the first line
BEGIN -- if topToBottom true, top of top line, bottom
of bottom line otherwise
MIDDLE -- y-coordinate middle of the middle-most line
END -- if topToBottom true, bottom edge of the last line
Data and non-method functions inherited from Font:
- fontStyle = None
Methods inherited from object:
- __delattr__(...)
- x.__delattr__('name') <==> del x.name
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __hash__(...)
- x.__hash__() <==> hash(x)
- __reduce__(...)
- helper for pickle
- __repr__(...)
- x.__repr__() <==> repr(x)
- __setattr__(...)
- x.__setattr__('name', value) <==> x.name = value
- __str__(...)
- x.__str__() <==> str(x)
Data and non-method functions inherited from object:
- __class__ = <type 'type'>
- __new__ = <built-in method __new__ of type object at 0x1E0BD978>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class WGLFont(Font) |
|
A WGL-provided Font (abstract base class)
This font displays Unicode characters, interpreting
passed strings as utf-8 encoded Unicode (i.e. it will
convert strings to Unicode using the utf-8 decoder). |
|
- Method resolution order:
- WGLFont
- Font
- object
Methods defined here:
- __init__(self, fontStyle=None, deviation=0.0050000000000000001, extrusion=0.0)
- _createSingleChar(self, wgldc, char, base=None)
- Create the single-character (polygonal) display list
Note:
This is actually used by both the bitmap and
polygonal geometry versions, though the metrics
returned are rather less than useful for bitmap :(
- _uiFont(self)
- Get the appropriate UI-library font for this font
Note: for some reason this object is _not_ properly
reference counted. You will need to hold a reference
to it until _after_ you've called wglUseFont*
- createChar(self, char, mode=None)
- Create a single-character display list
- fastCreate(self, source, mode=None)
- Create display list & metrics for all items in char
This is breaking for the "normal" pattern to minimise
the number of DCs, Handles, etceteras we need to build.
- lineHeight(self, mode=None)
- Compute the height of a line for this font
WGL doesn't really tell us this, so we fudge it...
- 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!
Data and non-method functions defined here:
- __doc__ = 'A WGL-provided Font (abstract base class)\n\n\tThis...rt strings to Unicode using the utf-8 decoder).\n\t'
- __module__ = 'OpenGLContext.scenegraph.text.wglfont'
- _lineHeight = 0
- format = ''
Methods inherited from Font:
- __del__(self)
- Clean up our display lists on deletion
- centerJustify(self, lines, fontStyle, mode=None)
- Center-justify a list of lines
- getChar(self, char, mode=None)
- Get (and/or create) a single-character display-list (with metrics)
- getSpacing(self, fontStyle, mode=None)
- Get the vertical spacing multiplier
- leftJustify(self, lines, fontStyle, mode=None)
- Left-justify a list of lines
- normalise(self, value)
- Return a normalised value for the given value
In our case, this means decoding utf-8 strings
if they are passed.
- render(self, lines, fontStyle=None, mode=None)
- Render value in this font, with control-character support
lines -- list of Line objects to be rendered, alternately
a string/unicode object to be converted to lines with
toLines( lines, mode=mode )
mode -- active rendering mode
- rightJustify(self, lines, fontStyle, mode=None)
- Right-justify a list of lines
- toLines(self, value, mode=None)
- Convert value to a set of expanded lines
Basically what this does is split value by line,
then expand tabs (using 4-spaces per-tab),
then return a list of Line instances for the
resulting strings.
- totalHeight(self, lines, spacing, mode=None)
- Calculate total height of the line-set
- totalWidth(self, lines, mode=None)
- Calculate total width of the line-set
- verticalAdjust(self, spacing, lines, fontStyle, mode=None)
- Calculate adjustement for first line's position
This needs to take into account the fontStyle's
"minor" alignment, which specifies one of:
FIRST -- use the bottom of the first line
BEGIN -- if topToBottom true, top of top line, bottom
of bottom line otherwise
MIDDLE -- y-coordinate middle of the middle-most line
END -- if topToBottom true, bottom edge of the last line
Data and non-method functions inherited from Font:
- __dict__ = <dict-proxy object at 0x07994B00>
- __weakref__ = <member '__weakref__' of 'Font' objects>
- fontStyle = None
Methods inherited from object:
- __delattr__(...)
- x.__delattr__('name') <==> del x.name
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __hash__(...)
- x.__hash__() <==> hash(x)
- __reduce__(...)
- helper for pickle
- __repr__(...)
- x.__repr__() <==> repr(x)
- __setattr__(...)
- x.__setattr__('name', value) <==> x.name = value
- __str__(...)
- x.__str__() <==> str(x)
Data and non-method functions inherited from object:
- __class__ = <type 'type'>
- __new__ = <built-in method __new__ of type object at 0x1E0BD978>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class WGLOutlineFont(PolygonalFontMixIn, WGLFont) |
|
A WGL-provided Outline Font
Adds polygonal justification routines to the
WGLFont class. |
|
- Method resolution order:
- WGLOutlineFont
- PolygonalFontMixIn
- WGLFont
- Font
- object
Data and non-method functions defined here:
- __doc__ = 'A WGL-provided Outline Font\n\n\tAdds polygonal justification routines to the\n\tWGLFont class.\n\t'
- __module__ = 'OpenGLContext.scenegraph.text.wglfont'
- format = 'polygon'
Methods inherited from PolygonalFontMixIn:
- _centerJustify(self, lines, fontStyle, mode=None)
- Center-justify a list of lines
- _leftJustify(self, lines, fontStyle, mode=None)
- Left-justify a list of lines (actual function)
- _rightJustify(self, lines, fontStyle, mode=None)
- Right-justify a list of lines
- centerJustify(self, lines, fontStyle, mode=None)
- Center-justify a list of lines (wrapper to do in child matrix)
- leftJustify(self, lines, fontStyle, mode=None)
- Left-justify a list of lines (wrapper to do in child matrix)
- rightJustify(self, lines, fontStyle, mode=None)
- Right-justify a list of lines (wrapper to do in child matrix)
Data and non-method functions inherited from PolygonalFontMixIn:
- __dict__ = <dict-proxy object at 0x07928EC8>
- __weakref__ = <member '__weakref__' of 'PolygonalFontMixIn' objects>
Methods inherited from WGLFont:
- __init__(self, fontStyle=None, deviation=0.0050000000000000001, extrusion=0.0)
- _createSingleChar(self, wgldc, char, base=None)
- Create the single-character (polygonal) display list
Note:
This is actually used by both the bitmap and
polygonal geometry versions, though the metrics
returned are rather less than useful for bitmap :(
- _uiFont(self)
- Get the appropriate UI-library font for this font
Note: for some reason this object is _not_ properly
reference counted. You will need to hold a reference
to it until _after_ you've called wglUseFont*
- createChar(self, char, mode=None)
- Create a single-character display list
- fastCreate(self, source, mode=None)
- Create display list & metrics for all items in char
This is breaking for the "normal" pattern to minimise
the number of DCs, Handles, etceteras we need to build.
- lineHeight(self, mode=None)
- Compute the height of a line for this font
WGL doesn't really tell us this, so we fudge it...
- 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!
Data and non-method functions inherited from WGLFont:
- _lineHeight = 0
Methods inherited from Font:
- __del__(self)
- Clean up our display lists on deletion
- getChar(self, char, mode=None)
- Get (and/or create) a single-character display-list (with metrics)
- getSpacing(self, fontStyle, mode=None)
- Get the vertical spacing multiplier
- normalise(self, value)
- Return a normalised value for the given value
In our case, this means decoding utf-8 strings
if they are passed.
- render(self, lines, fontStyle=None, mode=None)
- Render value in this font, with control-character support
lines -- list of Line objects to be rendered, alternately
a string/unicode object to be converted to lines with
toLines( lines, mode=mode )
mode -- active rendering mode
- toLines(self, value, mode=None)
- Convert value to a set of expanded lines
Basically what this does is split value by line,
then expand tabs (using 4-spaces per-tab),
then return a list of Line instances for the
resulting strings.
- totalHeight(self, lines, spacing, mode=None)
- Calculate total height of the line-set
- totalWidth(self, lines, mode=None)
- Calculate total width of the line-set
- verticalAdjust(self, spacing, lines, fontStyle, mode=None)
- Calculate adjustement for first line's position
This needs to take into account the fontStyle's
"minor" alignment, which specifies one of:
FIRST -- use the bottom of the first line
BEGIN -- if topToBottom true, top of top line, bottom
of bottom line otherwise
MIDDLE -- y-coordinate middle of the middle-most line
END -- if topToBottom true, bottom edge of the last line
Data and non-method functions inherited from Font:
- fontStyle = None
Methods inherited from object:
- __delattr__(...)
- x.__delattr__('name') <==> del x.name
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __hash__(...)
- x.__hash__() <==> hash(x)
- __reduce__(...)
- helper for pickle
- __repr__(...)
- x.__repr__() <==> repr(x)
- __setattr__(...)
- x.__setattr__('name', value) <==> x.name = value
- __str__(...)
- x.__str__() <==> str(x)
Data and non-method functions inherited from object:
- __class__ = <type 'type'>
- __new__ = <built-in method __new__ of type object at 0x1E0BD978>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
| |