  */
 shader_in mediump vec4 color;
 
-/*!
+/*
   color
  */
 shader_out mediump vec4 tex_color;
 
 
-#if defined(MIX_FONT_SHADER) 
 /*
-  normalized texture coordinate 
-  .xy for non-minified glyph
-  .zw for minified glyph
+  coming from glyph_data_type function,
+  passed onto pre_compute_glyph()
  */
-shader_out TEX_VARYING_TYPE vec4 tex_coord;
+uniform highp vec2 reciprocal_texture_size;
 
-/*
-  relative coordinate within the glyph NOT normalized
- */
-shader_out TEX_VARYING_TYPE vec4 relative_coord;
-
-/*
-  reciprocal of the texture holding the glyph
-  [0] --> for native or magnified
-  [1] --> for minified
- */
-uniform TEX_RECIP_TYPE vec2 reciprocal_texture_size[2];
-
-#else
-/*
-  reciprocal of the texture holding the glyph,
-  native only
-*/
-uniform TEX_RECIP_TYPE vec2 reciprocal_texture_size;
-shader_out TEX_VARYING_TYPE vec2 tex_coord;
-shader_out TEX_VARYING_TYPE vec2 relative_coord;
-#endif
-
-
-
-/*
-  relative coordinate within the glyph as normalized
- */
-shader_out TEX_VARYING_TYPE vec2 GlyphNormalizedCoordinate;
-
-/*
-  glyph_index for use in detailed coverage fonts
- */
-shader_in mediump float in_glyph_index;
-shader_out mediump float GlyphIndex;
 
 void
 shader_main(void)
 {
   highp vec2 tpos, offset;
-  highp vec4 unnormalized_tex;
+  highp vec2 glyph_position;
   highp vec2 abs_glyph_normalized_coordinate, clipped_normalized;
   
-  tex_color=color;
-
   clipped_normalized=
      compute_clipped_normalized_coordinate(glyph_normalized_coordinate,
                                            pos.xy, pos.w*glyph_size.xy*glyph_stretch.xy);
 
   abs_glyph_normalized_coordinate=abs(clipped_normalized);
-  GlyphNormalizedCoordinate=abs_glyph_normalized_coordinate;
 
-  GlyphIndex=in_glyph_index;
-  relative_coord.xy=abs_glyph_normalized_coordinate*glyph_size.xy;
-  unnormalized_tex.xy= relative_coord.xy + glyph_bottom_left_texel.xy;
+  //position of vertex inside of glyph
+  glyph_position=abs_glyph_normalized_coordinate*glyph_size.xy;
 
   
+  #if defined(WRATH_FONT_CUSTOM_DATA)
+  {
+    struct wrath_font_custom_data_t custom_values_str;
+  
+    wrath_font_shader_custom_data_func(custom_values_str);
+    pre_compute_glyph(glyph_position,
+		      glyph_bottom_left_texel,
+		      glyph_size,
+		      reciprocal_texture_size,
+		      custom_values_str.values);
+  }  
+  #else
+  {
+    pre_compute_glyph(glyph_position,
+		      glyph_bottom_left_texel,
+		      glyph_size,
+		      reciprocal_texture_size);
+  }
+  #endif
+  
   offset=pos.w*clipped_normalized*glyph_size.xy*glyph_stretch.xy;
-
-#if defined(MIX_FONT_SHADER) 
-  unnormalized_tex.zw= 
-    abs_glyph_normalized_coordinate*glyph_size.zw + glyph_bottom_left_texel.zw;
-
-  tex_coord.xy=reciprocal_texture_size[0]*unnormalized_tex.xy; 
-  tex_coord.zw=reciprocal_texture_size[1]*unnormalized_tex.zw; 
-
-  relative_coord.zw=abs_glyph_normalized_coordinate*glyph_size.zw;
-#else
-  tex_coord.xy=reciprocal_texture_size*unnormalized_tex.xy; 
-#endif
-  
-  //scale from the center of the glyph:
   offset.xy*= mix(1.0, 3.0, animation_fx_interpol);
   offset.x -= mix(0.0, 1.0, animation_fx_interpol)*offset.x;
   offset=animation_matrix*offset*0.5 + offset*0.5;
- 
+
   tpos=pos.xy + offset;
   gl_Position=compute_gl_position(vec3(tpos, pos.z));
+  tex_color=color;
+
+  #if defined(WRATH_APPLY_BRUSH_RELATIVE_TO_LETTER)
+  {
+    wrath_shader_brush_prepare(glyph_position);
+  }
+  #elif defined(WRATH_APPLY_BRUSH_RELATIVE_TO_ITEM)
+  {
+    wrath_shader_brush_prepare(tpos);    
+  }
+  #endif
 }

 */


uniform mediump float animation_fx_interpol;
uniform mediump mat2 animation_matrix;



/*pos meanings:

/*! 
 * \file simple_ui_font.vert.wrath-shader.glsl
 * \brief file simple_ui_font.vert.wrath-shader.glsl
 * 
 * Copyright 2013 by Nomovok Ltd.
 * 
