On Sat, Jun 6, 2009 at 9:34 PM, Harry Tormey <[email protected]> wrote:

>
> On Fri, Jun 05, 2009 at 07:43:12PM -0400, Tristam MacDonald wrote:
> > On Fri, Jun 5, 2009 at 7:15 PM, Harry Tormey <[email protected]>
> wrote:
> > > Hi All,
> > > I am trying to create a magnify effect with fonts in pyglet.
> > > I want to move me mouse over a letter and have it scale up.
> > >
> > >
> > > font            = pyglet.font.load('Times New Roman', 16)
> > > letters         = font.get_glyphs("alice")
> > >
> > > I want to apply a scaling effect to a given letter, glscale
> > > causes artifacts in the letter texture which is not good.
> > >
> > > #glscale letter while iterating through and drawing
> > > #letter[0].draw()
> > >
> > > One way I could do this would be to create multiple copies of
> > > the word I want to apply the effect to at different scales. I am
> > > lookin for a nicer solution than this. Any suggestions?
> > >
> >
> > Bitmap fonts just don't scale nicely, so you either need to load the
> fonts
> > at multiple resolutions, or implement a new font renderer based on
> something
> > like Valves' distance-field rendering (an example of the rendering
> technique
> > exists in pyglet/experimental).
> >
>
> What is the name of that specific example? Thanks Tristam.


renderfield.py in the experimental/dist_field/ directory.
I think you have to change the function 'mix' in the glsl code to 'lerp', if
you want it to run on a non-NVidia (i.e. standards compliant) graphics card.

Also don't forget to set the antialias option to True.

-- 
Tristam MacDonald
http://swiftcoder.wordpress.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to