Closed prepare closed 5 years ago
(All our glyphs are NOT hinted with TrueType instructions)
But when we fit Y to the grid, this happens...
pic 2: left( our texture glyph, unalign Y ) vs right (reference img , gdi)
If we snap only X, ...
pic 3: left( our texture glyph, look blur) vs right (reference img , gdi)
Try with Round(X) and Floor(Y)
pic 4: left( our glyph texture) vs right (reference img , gdi)
Try with Glyph Texture's Lcd Effect
_pic 5: left (grey-scale stencil), middle(lcd effect,without x-shift), right(lcdeffect, with shift 0.33f to right)
_pic6 : left (grey-scale stencil), middle(gdi), right(lcdeffect, with shift 0.33f to right, with sharpen filter)
(All our glyphs are NOT hinted with TrueType instructions)
Agg Text Rasterizer with 3 primary weights (from http://www.antigrain.com/research/font_rasterization/)
“Primary Weight” controls the energy distribution exactly as on Steve Gibson's page: http://www.grc.com/freeandclear.htm. It's good enough to control only the primary weight and calculate the other ones accordingly. Increasing the primary weight you can make the text sharper, but more “color fringy”. Values up to 0.5 are reasonable; above 0.5 the color halos become too visible. To me, Windows ClearType with the default settings looks too “color fringy” as well.
(1) primary weight 0, (2) 0.33 , (3) 0.77
and zoom in
(1) primary weight 0, (2) 0.33 , (3) 0.77
(1) with openPDN's sharpen filter , (2) original
't' head
(1) with openPDN's sharpen filter , (2) original
(All our glyphs are NOT hinted with TrueType instructions)
(ported from ColorBlender, https://github.com/wieslawsoltes/ColorBlender)
Glyphs generated by our Typography lib(https://github.com/LayoutFarm/Typography)
pic 1: GLES2 canvas, lcd-effect-stecil-based texture glyph
Zoom on the text.
pic 2: show lcd-effect-stencil-based texture
(All our glyphs are NOT hinted with TrueType instructions)
pic 3: (1) before adjust with integer number, (2) after adjust with integer
pic 4: zoom (1) and (2)
(All our glyphs are HINTED with TrueType instructions)
pic 5: Tahoma, with TrueType instruction Hinted glyphs
pic 6: zoom, glyphs are rendered with lcd-stencil effect
(from http://www.antigrain.com/research/font_rasterization/)
pic 7: Tahoma, Maxim's sugession, vertical-only truetype hint
pic 8: Zoom
please note that 'x' is too light, we will fix it
plan ....
pic 9: mixed texture, x in pic 8 was replaced with the original un-hinted version
from pic 7 above, some selected Tahoma glyphs ('x','X','7') are patched with unhinted version. while others are hinted version.
pic 10: compare with pic7, you can see that 'x' was pacthed
pic 11: zoom
Latest x-axis snap to grid
pic 12: x-axis snap to grid
But still need to check space between x-p in Explore again
pic 13: diff from prev version
x-axis snap to grid
pic 14: i-o-i, Tahoma, 10 pt, GLES2
pic 15: i-i-i, Tahoma, 10 pt, GLES2
pic 16: alpha mask is a glyph atlas, and we draw our lion on it
pic 17: Tahoma, 10 pts, black rect over gray-scaled font atlas, red-component mask
please note a minor shift on subpixel position
pic 18: Tahoma, 10 pts, black rect over (1) red-only compo mask , (2) green , (3) blue
Similar to pic 18. above,
but now, we fill black color 3 times
each time we change the 1. selected mask color component
and 2. output mask component.
(same as OpenGLES technique)
Then the output => lcd-effect glyph.
pic 19: fill black with lcd effect over lcd-effect font atlas
pic 20: fill blue with lcd effect over lcd-effect font atlas
pic 21: fill yellow with lcd effect over lcd-effect font atlas, black background
pic 22: single font atlas, with multiple 'fill' color, MiniAgg
pic 23: MiniAgg, GlyphTexture + LcdEffect
pic 24: MiniAgg, GlyphTexture + LcdEffect
pic 25: MiniAgg, GlyphTexture + GreyscaleStencil
The same glyph texture can be used with both software-based rendering (above) and hardware-based rendering (the following 3 below).
1. Just Copy from GlyphTexture
pic 26: just copy from glyph texture, with debug marker, (1) blue-line=> top line, (2) red-line=> base-line, (3) magenta-line => bottom line
pic 27: just copy, zoom of pic26
2. Fill with Color on Stencil Glyph
This example fills the stencil with blue color
pic 28: Stencil-single color shader, with debug lines
pic 29: Stencil-single color, zoom of pic 28
3. SubPixelLcd
pic 30: Subpixel-Lcd technique, with debug lines
pic 31: Subpixel-Lcd technique, zoom of pic 29, please note the color different between pic 27 and pic31
another example, fill with black color
pic 32: (1) stencil technique , (2) subpixel-lcd technique
GLES2 surface with Text from Glyph Texture Atlas
pic 1, TextureKind.StencilGreyScale
(1) not snap (to integer grid) the glyph to x and y axis => Blur Glyph both axis (2) snap (to integer) only on y axis=> Blur Glyph only in X axis (3) snap both x and y axis => Clearer glyphs, improper inter-glyph space, eg. glyph 1 and 2