@@ -0,0 +1,3054 @@
+#!/usr/bin/env python%0A# ----------------------------------------------------------------------------%0A# pyglet%0A# Copyright (c) 2006-2008 Alex Holkner%0A# All rights reserved.%0A#%0A# Redistribution and use in source and binary forms, with or without%0A# modification, are permitted provided that the following conditions%0A# are met:%0A#%0A#  * Redistributions of source code must retain the above copyright%0A#    notice, this list of conditions and the following disclaimer.%0A#  * Redistributions in binary form must reproduce the above copyright%0A#    notice, this list of conditions and the following disclaimer in%0A#    the documentation and/or other materials provided with the%0A#    distribution.%0A#  * Neither the name of pyglet nor the names of its%0A#    contributors may be used to endorse or promote products%0A#    derived from this software without specific prior written%0A#    permission.%0A#%0A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS%0A# %22AS IS%22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT%0A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS%0A# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE%0A# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,%0A# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,%0A# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;%0A# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER%0A# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT%0A# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN%0A# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE%0A# POSSIBILITY OF SUCH DAMAGE.%0A# ----------------------------------------------------------------------------%0A%0A'''A simple tool that may be used to compare font faces.%0A%0AUse the left/right cursor keys to change font faces.%0A'''%0A%0A__docformat__ = 'restructuredtext'%0A__version__ = '$Id: $'%0Aimport pyglet%0A%0AFONTS = %5B'Consolas', 'Andale Mono', 'Inconsolata', 'Inconsolata-dz', 'Monaco',%0A    'Menlo'%5D%0A%0ASAMPLE = '''class Spam(object):%0A%09def __init__(self):%0A%09%09# The quick brown fox%0A%09%09self.spam = %7B%22jumped%22: 'over'%7D%0A    @the%0A%09def lazy(self, *dog):%0A%09%09self.dog = %5Blazy, lazy%5D'''%0A%0Aclass Window(pyglet.window.Window):%0A    font_num = 0%0A    def on_text_motion(self, motion):%0A        if motion == pyglet.window.key.MOTION_RIGHT:%0A            self.font_num += 1%0A            if self.font_num == len(FONTS):%0A                self.font_num = 0%0A        elif motion == pyglet.window.key.MOTION_LEFT:%0A            self.font_num -= 1%0A            if self.font_num %3C 0:%0A                self.font_num = len(FONTS) - 1%0A%0A        face = FONTS%5Bself.font_num%5D%0A        self.head = pyglet.text.Label(face, font_size=24, y=0,%0A            anchor_y='bottom')%0A        self.text = pyglet.text.Label(SAMPLE, font_name=face, font_size=18,%0A            y=self.height, anchor_y='top', width=self.width, multiline=True)%0A%0A    def on_draw(self):%0A        self.clear()%0A        self.head.draw()%0A        self.text.draw()%0A%0Awindow = Window()%0Awindow.on_text_motion(None)%0Apyglet.app.run()%0A

add simple font comparison tool in examples