Hi all.
I hope you are safe and healthy.
I want to talk about a problem with load personal font inside application
java Swing.
I'm developing a new Open-source L&F that import material style in swing, now in at this time I'm losing with a problem with a Java font.
I will describe the problem.
I'm loading the font with this code
I think after you read the code, you have a question, Why you calculate the dimension font with this formula:
The answer at your question is because if I only the dimension inside the font, I see the pixeled result, like this
If I use the screen resolution I can fix this problem and the result is this
But, now I have a problem with dimension font with a display with high resolution, the font is very small, as these pictures
Now I'm thinking of building a solution, as to create a set of default dimensions, For example, XXX_DISPLAY, XX_DISPLAY, X_DISPLAY.
This solution was implemented inside the android framework when adapting the icon at different screen dimensions.
But Before starting work I want to talk and
exchange ideas about this problem.
I'm losing somethings to calculate correctly the font dimension?
P.S: I noted that with the JDK version >= 10 the pixel effect if not present but with JDK 8 is present.