Revision: 82
Author: Nicolas.Rougier
Date: Tue Jun 25 23:00:11 2013
Log: Fix typo
http://code.google.com/p/freetype-py/source/detail?r=82
Modified:
/trunk/README.txt
/trunk/examples/subpixel-positioning.py
/trunk/freetype/__init__.py
/trunk/setup.py
=======================================
--- /trunk/README.txt Mon Dec 31 00:12:32 2012
+++ /trunk/README.txt Tue Jun 25 23:00:11 2013
@@ -10,4 +10,3 @@
* Titusz Pan (bug report)
* Ekkehard.Blanz (bug report)
* Jānis Lībeks (bug report)
-
=======================================
--- /trunk/examples/subpixel-positioning.py Wed Jun 13 23:27:59 2012
+++ /trunk/examples/subpixel-positioning.py Tue Jun 25 23:00:11 2013
@@ -35,9 +35,15 @@
uniform vec2 pixel;
varying float m;
void main() {
- vec2 uv = gl_TexCoord[0].xy;
+ float gamma = 1.0;
+
+ vec2 uv = gl_TexCoord[0].xy;
vec4 current = texture2D(texture, uv);
vec4 previous= texture2D(texture, uv+vec2(-1,0)*pixel);
+
+ current = pow(current, vec4(1.0/gamma));
+ previous = pow(previous, vec4(1.0/gamma));
+
float r = current.r;
float g = current.g;
float b = current.b;
@@ -63,7 +69,11 @@
g = mix(previous.b, previous.g, z);
b = mix(current.r, previous.b, z);
}
- gl_FragColor = vec4(r,g,b,a);
+
+ float t = max(max(r,g),b);
+ vec4 color = vec4(0.,0.,0., (r+g+b)/2.);
+ color = t*color + (1.-t)*vec4(r,g,b, min(min(r,g),b));
+ gl_FragColor = vec4( color.rgb, color.a);
}
'''
@@ -145,13 +155,14 @@
gl.glColorPointer(4, gl.GL_FLOAT, 0, self.colors)
gl.glTexCoordPointer(2, gl.GL_FLOAT, 0, self.texcoords)
- alpha = 1
- gl.glEnable( gl.GL_COLOR_MATERIAL )
- gl.glBlendFunc( gl.GL_CONSTANT_COLOR_EXT,
- gl.GL_ONE_MINUS_SRC_COLOR )
+ r,g,b = 0,0,0
+ gl.glColor( 1, 1, 1, 1 )
gl.glEnable( gl.GL_BLEND )
- gl.glColor3f( alpha, alpha, alpha )
- gl.glBlendColor( 1-alpha, 1-alpha, 1-alpha, 1 )
+ #gl.glBlendFunc( gl.GL_CONSTANT_COLOR_EXT,
gl.GL_ONE_MINUS_SRC_COLOR )
+ #gl.glBlendColor(r,g,b,1)
+ gl.glBlendFunc( gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA )
+ gl.glBlendColor( 1, 1, 1, 1 )
+
gl.glEnableVertexAttribArray( 1 );
gl.glVertexAttribPointer( 1, 1, gl.GL_FLOAT, gl.GL_FALSE, 0,
self.attrib)
shader.bind()
@@ -176,10 +187,13 @@
atlas = TextureAtlas(512,512,3)
def on_display( ):
+ #gl.glClearColor(0,0,0,1)
gl.glClearColor(1,1,1,1)
gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT)
gl.glBindTexture( gl.GL_TEXTURE_2D, atlas.texid )
- for label in labels: label.draw()
+ for label in labels:
+ label.draw()
+
gl.glColor(0,0,0,1)
gl.glBegin(gl.GL_LINES)
gl.glVertex2i(15,0)
=======================================
--- /trunk/freetype/__init__.py Thu Dec 20 22:26:16 2012
+++ /trunk/freetype/__init__.py Tue Jun 25 23:00:11 2013
@@ -317,7 +317,7 @@
width = property( lambda self: self._FT_Glyph_Metrics.width,
doc = '''The glyph's width.''' )
- height = property( lambda self: self._FT_Glyph_Metrics.heigth,
+ height = property( lambda self: self._FT_Glyph_Metrics.height,
doc = '''The glyph's height.''' )
horiBearingX = property( lambda self:
self._FT_Glyph_Metrics.horiBearingX,
=======================================
--- /trunk/setup.py Thu Dec 20 22:38:03 2012
+++ /trunk/setup.py Tue Jun 25 23:00:11 2013
@@ -6,7 +6,7 @@
from distutils.core import setup
setup( name = 'freetype-py',
- version = '0.4',
+ version = '0.4.1',
description = 'Freetype python bindings',
author = 'Nicolas P. Rougier',
author_email= '
Nicolas...@inria.fr',