OpenGLContext.scenegraph.text.wglfont
index
p:\openglcontext\scenegraph\text\wglfont.py

WGL font classes

 
Modules
            
Numeric
OpenGLContext.scenegraph.text.font
OpenGLContext.scenegraph.text.fontprovider
win32con
win32ui
 
Classes
            
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
 
Functions
            
ChoosePixelFormat(...)
ChoosePixelFormat(hdc, ppfd) -> int
DescribePixelFormat(...)
DescribePixelFormat(hdc, iPixelFormat, nBytes, ppfd) -> int
GetPixelFormat(...)
GetPixelFormat(hdc) -> int
SetPixelFormat(...)
SetPixelFormat(hdc, iPixelFormat, ppfd) -> int
SwapBuffers(...)
SwapBuffers(hdc) -> BOOL
wglCopyContext(...)
wglCopyContext(hglrcSrc, hglrcDst, mask) -> BOOL
wglCreateContext(...)
wglCreateContext(hdc) -> HGLRC
wglCreateLayerContext(...)
wglCreateLayerContext(hdc, iLayerPlane) -> HGLRC
wglDeleteContext(...)
wglDeleteContext(hglrc) -> BOOL
wglDescribeLayerPlane(...)
wglDescribeLayerPlane(hdc, iPixelFormat, iLayerPlane, nBytes, plpd) -> BOOL
wglGetCurrentContext(...)
wglGetCurrentContext() -> HGLRC
wglGetCurrentDC(...)
wglGetCurrentDC() -> HDC
wglGetLayerPaletteEntries(...)
wglGetLayerPaletteEntries(hdc, iLayerPlane, iStart, cEntries, pcr) -> cr
wglGetProcAddress(...)
wglGetProcAddress(lpszProc) -> PROC
wglMakeCurrent(...)
wglMakeCurrent(hdc, hglrc) -> BOOL
wglRealizeLayerPalette(...)
wglRealizeLayerPalette(hdc, iLayerPlane, bRealize) -> BOOL
wglSetLayerPaletteEntries(...)
wglSetLayerPaletteEntries(hdc, iLayerPlane, iStart, cEntries, pcr) -> int
wglShareLists(...)
wglShareLists(hglrc1, hglrc2) -> BOOL
wglSwapLayerBuffers(...)
wglSwapLayerBuffers(hdc, fuPlanes) -> BOOL
wglUseFontBitmaps = wglUseFontBitmapsA(...)
wglUseFontBitmapsA(hdc, first, count, listBase) -> BOOL
wglUseFontBitmapsA(...)
wglUseFontBitmapsA(hdc, first, count, listBase) -> BOOL
wglUseFontBitmapsW(...)
wglUseFontBitmapsW(hdc, first, count, listBase) -> BOOL
wglUseFontOutlines = wglUseFontOutlinesA(...)
wglUseFontOutlinesA(hdc, first, count, listBase, deviation, extrusion, formation, lpgmf) -> BOOL
wglUseFontOutlinesA(...)
wglUseFontOutlinesA(hdc, first, count, listBase, deviation, extrusion, formation, lpgmf) -> BOOL
wglUseFontOutlinesW(...)
wglUseFontOutlinesW(hdc, first, count, listBase, deviation, extrusion, formation, lpgmf) -> BOOL
 
Data
             FAMILYMAPPING = {'ROMAN': 'Times New Roman', 'SANS': 'Arial', 'SERIF': 'Times New Roman', 'TYPEWRITER': 'Courier New'}
LPD_DOUBLEBUFFER = 1
LPD_SHARE_ACCUM = 256
LPD_SHARE_DEPTH = 64
LPD_SHARE_STENCIL = 128
LPD_STEREO = 2
LPD_SUPPORT_GDI = 16
LPD_SUPPORT_OPENGL = 32
LPD_SWAP_COPY = 1024
LPD_SWAP_EXCHANGE = 512
LPD_TRANSPARENT = 4096
LPD_TYPE_COLORINDEX = 1
LPD_TYPE_RGBA = 0
PFD_DEPTH_DONTCARE = 536870912
PFD_DOUBLEBUFFER = 1
PFD_DOUBLEBUFFER_DONTCARE = 1073741824
PFD_DRAW_TO_BITMAP = 8
PFD_DRAW_TO_WINDOW = 4
PFD_GENERIC_ACCELERATED = 4096
PFD_GENERIC_FORMAT = 64
PFD_MAIN_PLANE = 0
PFD_NEED_PALETTE = 128
PFD_NEED_SYSTEM_PALETTE = 256
PFD_OVERLAY_PLANE = 1
PFD_STEREO = 2
PFD_STEREO_DONTCARE = -2147483648
PFD_SUPPORT_DIRECTDRAW = 8192
PFD_SUPPORT_GDI = 16
PFD_SUPPORT_OPENGL = 32
PFD_SWAP_COPY = 1024
PFD_SWAP_EXCHANGE = 512
PFD_SWAP_LAYER_BUFFERS = 2048
PFD_TYPE_COLORINDEX = 1
PFD_TYPE_RGBA = 0
PFD_UNDERLAY_PLANE = -1
WEIGHTNAMES = [('DEMIBOLD', 600), ('EXTRABOLD', 800), ('SEMIBOLD', 600), ('ULTRABOLD', 800), ('BOLD', 700), ('ULTRALIGHT', 200), ('EXTRALIGHT', 200), ('LIGHT', 300), ('HEAVY', 900), ('MEDIUM', 500), ('THIN', 100)]
WGL_FONT_LINES = 0
WGL_FONT_POLYGONS = 1
WGL_SWAP_MAIN_PLANE = 1
WGL_SWAP_OVERLAY1 = 2
WGL_SWAP_OVERLAY10 = 1024
WGL_SWAP_OVERLAY11 = 2048
WGL_SWAP_OVERLAY12 = 4096
WGL_SWAP_OVERLAY13 = 8192
WGL_SWAP_OVERLAY14 = 16384
WGL_SWAP_OVERLAY15 = 32768
WGL_SWAP_OVERLAY2 = 4
WGL_SWAP_OVERLAY3 = 8
WGL_SWAP_OVERLAY4 = 16
WGL_SWAP_OVERLAY5 = 32
WGL_SWAP_OVERLAY6 = 64
WGL_SWAP_OVERLAY7 = 128
WGL_SWAP_OVERLAY8 = 256
WGL_SWAP_OVERLAY9 = 512
WGL_SWAP_UNDERLAY1 = 65536
WGL_SWAP_UNDERLAY10 = 33554432
WGL_SWAP_UNDERLAY11 = 67108864
WGL_SWAP_UNDERLAY12 = 134217728
WGL_SWAP_UNDERLAY13 = 268435456
WGL_SWAP_UNDERLAY14 = 536870912
WGL_SWAP_UNDERLAY15 = 1073741824
WGL_SWAP_UNDERLAY2 = 131072
WGL_SWAP_UNDERLAY3 = 262144
WGL_SWAP_UNDERLAY4 = 524288
WGL_SWAP_UNDERLAY5 = 1048576
WGL_SWAP_UNDERLAY6 = 2097152
WGL_SWAP_UNDERLAY7 = 4194304
WGL_SWAP_UNDERLAY8 = 8388608
WGL_SWAP_UNDERLAY9 = 16777216
text_log = <logging.Logger instance at 0x056ED758>