ColleagueRiley / RFont

Simple-to-use single header modular font rendering library written in C.
zlib License
27 stars 2 forks source link

Very odd 'X' coordinate spacing for a few letters using a Helvetica font #2

Closed EimaMei closed 10 months ago

EimaMei commented 11 months ago

Text using the Helvetica font in RFont usually looks fine, however in some instances some letters have very odd spacing that makes them look very awkward compared to the rest of the string. In the example below you can see that happening with the letter 'v', where it's off by a few pixels: image

Using LibreOffice Writer, this is how I expect the text to look more or less: image

And it isn't only with 'v'. "Button" suffers from the same issue, alongside many other random combinations of words. image

ColleagueRiley commented 11 months ago

Thank you for filing the issue; I'll be looking into it now.

ColleagueRiley commented 11 months ago

I'm not fully sure what I changed, but the text looks like this when it renders now. This looks a bit more proper.

image

Also, it may not render exactly how another app might render text depending on the spacing. RFont_draw_text_spacing can be used to change the spacing used to render the text.

image

As for the extra lines being rendered (shown in the screen shots). I'm not sure why they came to be but they are not related to this specific issue at the very least.

ColleagueRiley commented 11 months ago

Update : One of the things i fixed it (and the thing that is causing the line bug as well) is by using floats for the x and y values.

ColleagueRiley commented 11 months ago

image image

What do you think of this? (extra lines fixed)

EimaMei commented 11 months ago

The ‘v’ in all of the provided images is still leaning more towards the ‘d’ letter compared to the ‘e’. You can see how ‘v’ in the LibreOffice Writer screenshot is very clearly centred between ‘d’ and ‘e’, while in RFont the issue still persists. In fact, the spacing is much larger than in the previous versions, making the oddity more obvious. Unfortunately the done changes didn’t fix the awkwardness for the ‘v’ letter in any major ways. However, I will say that ‘button’ looks looks pretty good now.

One last thing I would like to point out is that I noticed that the very last letter, being ‘e’, looks also suspiciously very awkward compared to ‘r’, so that should also get investigated.

ColleagueRiley commented 11 months ago

Again, use a valid comparison. Neither are using the same spacing.

EimaMei commented 11 months ago

The added spacing doesn’t matter. The issue is that the letter is leaning more towards the left, when it’s suppose to be in the centre. I might show this more clearly with an image later tonight.

ColleagueRiley commented 11 months ago

The letter is not leaning towards the left, compare the images. The E is leaning towards the right

ColleagueRiley commented 10 months ago

image

The issue should be fixed now, Mr. Chinz. :)