Closed Trashtalk217 closed 1 year ago
Yeah, the fond backend does not calculate cursor positions correctly. It is correct in the msdf backend, but for that the atlas generation is still broken in the 3b/sdf library.
Ideally the fond backend can be eliminated once atlas generation works correctly, since msdf is both pure-lisp, and creates far better text rendering than the fond backend.
So you are referring to the make-atlas
function in this repo? Just to make sure I understand the problem?
That is the repo, though not the right branch (msdf). We use it here: https://github.com/Shirakumo/alloy/blob/master/renderers/opengl/msdf.lisp#L112
The issue is complex and I'm waiting for @3b to get back into working on it, since I lack the understanding on the topic myself.
is the problem in msdf atlas generator, bmfont code/api , or the way atlas generator uses the bmfont code? seems like cursor and character positioning should be using same character size, so seems odd they wouldn't match
The amount of space the cursor moves is also proportional to the length of a given letter. When an 'i' is typed the cursor moves less, then when a 'w' is typed. So it is somewhat aware of the right proportions.
@3b The problem mentioned in this ticket is in the fond backend, which has nothing to do with the msdf atlas. It's just doing a bad computation on the glyph advance.
For the msdf backend the problem is still as before -- the atlas generation chokes on some glyphs that appear in fonts out there. Otherwise that backend (when using pre-computed atlases) works perfectly fine.
The fond backend has been deprecated.
Problem: https://imgur.com/a/aRBL3MX
The cursor is not behaving nicely for me, it doesn't stick to the text but charges ahead.
Code I used in the examples/window.lisp file:
I've looked throught the codebase myself and I've isolated the problem to the renderer. Nothing seemed to be wrong in the components themselve. Sadly, I've not yet gotten the courage to dig into renderer side of things so I thought I'd make this an issue instead of a pull request.