Jump to content

font problem with justifyRight


ForTest

Recommended Posts

Hi,

actually i'm using uGFX 2.4 on a old project and i have a little problem with the font right alignment.

The font comes from a monospaced ttf file, converted with the ugfx font converter.

For example i have the two instructions:

gdispFillStringBox(505, 115, 72, 20, text1,    IsonormMonospacedRegular20, mycolor, mybgcolor,    justifyRight);

gdispFillStringBox(505, 267, 72, 20, text2,    IsonormMonospacedRegular20, mycolor, mybgcolor,    justifyRight);

'text1' and 'text2' contains different numbers (including "." and "-" characters)

I expect that text1 and text2 digits are perfectly alligned but depending from the digit i have 1 pixel of difference.

With justifyLeft i don't have this problem.

I think the problem is only in the right alignment.
 

IsonormMonospacedRegular20.c ufonts.com_isonorm-regular.ttf

Edited by ForTest
Link to comment
Share on other sites

Just before we dive too much into this: Can you replicate the same issue with the latest version of the µGFX library?
The font stuff (especially wrapping and alignment/justification) has been reworked intensively in a release after 2.4 (can't remember, was 2.7 or 2.8 I think - check the changelogs).

If you integrated µGFX properly into your project you should be able to just replace the library directory.
If upgrading is for some reason not an option, I'd recommend you to first investigate and re-evaluate why that is not an option and if the situation stays the same you can go through the changelogs and git history to figure out which patches were applied to this and cherry-pick those patches to your copy of µGFX 2.4.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...