rougier / freetype-gl

OpenGL text using one vertex buffer, one texture and FreeType
Other
1.64k stars 267 forks source link

Atlas repeated unknown character #220

Open Quetzalfir opened 4 years ago

Quetzalfir commented 4 years ago

I can notice that in the demo distance-field.c, if I set some new characters that are not representable, there are multiple box repeated in the atlas, does this happens only in the demo as a way of representing the unknown character?, or the library does save the glyph repeatedly? Screenshot_2020-06-09_16-29-17

in the case it saves memory, how can I create an atlas with the unknown glyphs pointing to the same region of the atlas?, avoiding the repeating situation.

rougier commented 4 years ago

They are not supposed to be here and means the demo failed at getting the proper glyph. What is the font ?

Quetzalfir commented 4 years ago

it's the same one that is in the demo "Vera.ttf". I just added some new extended ascii characters to it. It seems that cannot represent all of the characters, so it put the same box repeatedly

rougier commented 4 years ago

IF those glyphs are present within the font, it's probably a bad access to the charcode (I may use directly the letter code while you need an indirection through a freetype function). Can you check other demos to check if the problem is also present?