comparison samples/freetype.tp @ 330:e70f9d3f19f8

Turn off hinting in freetype sample as hinting does not play nice with using font units for layout
author Michael Pavone <pavone@retrodev.com>
date Sat, 28 Mar 2015 13:26:44 -0700
parents c1fad3d93861
children 577406b25f89
comparison
equal deleted inserted replaced
329:eef8a5cea812 330:e70f9d3f19f8
17 ] from: (sdl pixelFormats) 17 ] from: (sdl pixelFormats)
18 18
19 import: [ 19 import: [
20 render 20 render
21 linearDesign 21 linearDesign
22 noHinting
22 ] from: (freetype loadFlags) 23 ] from: (freetype loadFlags)
23 24
24 makeAtlas <- :renderer face fontSize dpi color { 25 makeAtlas <- :renderer face fontSize dpi color {
25 face setCharSize: fontSize res: dpi 26 face setCharSize: fontSize res: dpi
26 slot <- face glyphSlot 27 slot <- face glyphSlot
27 28
28 glyphs <- #[] 29 glyphs <- #[]
29 //TODO: Use a bytearray once that has an append method 30 //TODO: Use a bytearray once that has an append method
30 pixels <- #[] 31 pixels <- #[]
31 foreach: (face charmap) :char glyphIdx { 32 foreach: (face charmap) :char glyphIdx {
32 face loadGlyph: glyphIdx flags: (render or linearDesign) 33 face loadGlyph: glyphIdx flags: (render or linearDesign or noHinting)
33 pixelStart <- pixels length 34 pixelStart <- pixels length
34 _width <- slot bitmapWidth 35 _width <- slot bitmapWidth
35 _height <- slot bitmapRows 36 _height <- slot bitmapRows
36 pitch <- slot bitmapPitch 37 pitch <- slot bitmapPitch
37 buffer <- slot bitmapData 38 buffer <- slot bitmapData