memononen / fontstash

Light-weight online font texture atlas builder
zlib License
688 stars 88 forks source link

add SDF support when using stb_truetype backend #38

Open wheybags opened 7 years ago

wheybags commented 7 years ago

uses the builtin sdf generation in stb_truetype, disabled when using freetype

wheybags commented 7 years ago

@memononen bump?

suikki commented 6 years ago

Seemed to work after those changes. Would be very nice to have this

wheybags commented 6 years ago

fixed @memononen any chance of a merge?

jimon commented 6 years ago

👍 would be nice to have this upstream!

jimon commented 6 years ago

@wheybags also it would be super useful to be able to provide two different text sizes: one for glyph size under SDF font and another for actual text size. Because SDF fonts don't really work that well under small pt sizes.

wheybags commented 6 years ago

@jimon What I do is pass in a constant value to fonstash (30px), and then scale the font metrics I get back according to the difference between the constant and the actual size. I also scale the resulting vertex buffer.