示例#1
0
    def setupFontProviders(self):
        """Load font providers for the context

        See the OpenGLContext.scenegraph.text package for the
        available font providers.
        """
        fontprovider.setTTFRegistry(self.getTTFFiles(), )
示例#2
0
    def setupFontProviders(self):
        """Load font providers for the context

        See the OpenGLContext.scenegraph.text package for the
        available font providers.
        """
        from OpenGLContext.scenegraph.text import fontprovider
        try:
            from OpenGLContext.scenegraph.text import toolsfont
            registry = self.getTTFFiles()
        except ImportError as err:
            log.warn(
                """Unable to import TTFQuery/FontTools-based TTF-file registry, no TTF font support!"""
            )
        else:
            fontprovider.setTTFRegistry(registry, )
        try:
            from OpenGLContext.scenegraph.text import pygamefont
        except (ImportError, NotImplementedError):
            log.warn(
                """Unable to import PyGame TTF-font renderer, no PyGame anti-aliased font support!"""
            )
        try:
            from OpenGLContext.scenegraph.text import glutfont
        except ImportError:
            log.error(
                """Unable to import GLUT-based font renderer, no GLUT bitmap font support (this is unexpected)!"""
            )
    def setupFontProviders(self):
        """Load font providers for the context

        See the OpenGLContext.scenegraph.text package for the
        available font providers.
        """
        from OpenGLContext.scenegraph.text import fontprovider
        try:
            from OpenGLContext.scenegraph.text import toolsfont
            registry = self.getTTFFiles()
        except ImportError as err:
            log.warn(
                """Unable to import fonttools-based TTF-file registry, no TTF font support!"""
            )
        else:
            fontprovider.setTTFRegistry(registry, )
            self.families = registry.DEFAULT_FAMILY_SETS.keys()
            self.families.sort()
            self.family = self.families[0]
        try:
            from OpenGLContext.scenegraph.text import pygamefont
        except ImportError:
            log.warn(
                """Unable to import PyGame TTF-font renderer, no PyGame anti-aliased font support!"""
            )
        try:
            from OpenGLContext.scenegraph.text import glutfont
        except ImportError:
            log.warn(
                """Unable to import GLUT-based TTF-file registry, no GLUT bitmap font support!"""
            )
示例#4
0
    def setupFontProviders( self ):
        """Load font providers for the context

        See the OpenGLContext.scenegraph.text package for the
        available font providers.
        """
        fontprovider.setTTFRegistry(
            self.getTTFFiles(),
        )
示例#5
0
    def setupFontProviders(self):
        """Load font providers for the context

        See the OpenGLContext.scenegraph.text package for the
        available font providers.
        """
        from OpenGLContext.scenegraph.text import fontprovider
        try:
            from OpenGLContext.scenegraph.text import toolsfont
            registry = self.getTTFFiles()
        except ImportError, err:
            log.warn(
                """Unable to import TTFQuery/FontTools-based TTF-file registry, no TTF font support!"""
            )
        else:
            fontprovider.setTTFRegistry(registry, )
        try:
            from OpenGLContext.scenegraph.text import pygamefont
        except (ImportError, NotImplementedError):
            log.warn(
                """Unable to import PyGame TTF-font renderer, no PyGame anti-aliased font support!"""
            )
        try:
            from OpenGLContext.scenegraph.text import glutfont
        except ImportError:
            log.error(
                """Unable to import GLUT-based font renderer, no GLUT bitmap font support (this is unexpected)!"""
            )

    def OnInit(self):
        """Initialise the VRMLContext keyboard shortcuts"""
示例#6
0
    sg = None
    def setupFontProviders( self ):
        """Load font providers for the context

        See the OpenGLContext.scenegraph.text package for the
        available font providers.
        """
        from OpenGLContext.scenegraph.text import fontprovider
        try:
            from OpenGLContext.scenegraph.text import toolsfont
            registry = self.getTTFFiles()
        except ImportError, err:
            log.warn( """Unable to import TTFQuery/FontTools-based TTF-file registry, no TTF font support!""" )
        else:
            fontprovider.setTTFRegistry(
                registry,
            )
        try:
            from OpenGLContext.scenegraph.text import pygamefont
        except (ImportError,NotImplementedError):
            log.warn( """Unable to import PyGame TTF-font renderer, no PyGame anti-aliased font support!""" )
        try:
            from OpenGLContext.scenegraph.text import glutfont
        except ImportError:
            log.error( """Unable to import GLUT-based font renderer, no GLUT bitmap font support (this is unexpected)!""" )
        
    def OnInit( self ):
        """Initialise the VRMLContext keyboard shortcuts"""

    def load( self, filename ):
        """Load given url, replacing current scenegraph"""