I have been using a Galaxy S3 smartphone (720x1280 pixels, 305ppi) for my game development for a few years. I recently purchased an LG G4 smartphone (1440x2560 pixels, 538ppi) and noticed that the letters on my self-made QWERTY keyboard keys were getting truncated on the right and bottom. (I made my own keyboard because I need to change the colors of the keys throughout the game).
As a result, I came up with the attached project (see TestLabelAndButton.zip). This App places a label and a button on the screen that are both the same size. It also allows you to change the height, width, text size, and text of both the label and the button, as well as showing some screen metrics.
There is a big difference between how this App appears on my Galaxy S3 (see Screenshot_GalaxyS3.png), and on my LG G4 (see Screenshot_LGG4.png). The label is the top View, and the button is the lower View.
What I am curious about is why there is such a big difference between the label and button as far as how much text can appear on each. As you can see, the "ABC" text fully appears on both the label and button on the GS3 at 100x100 size, but although the full "ABC" text appears on the LG G4 label, just a tiny piece of the "A" appears on the LG G4 button at 100x100.
In a slightly larger set of Views (122x122 -- see Screenshot_LGG4Margins.png), the LG G4 label text looks fine, but only the "A" appears on the button of the same size, with an appreciable top and left margin. Making the Width any smaller starts to cause the right edge of the "A" to be cut away.
My questions are:
1) Why is there a difference between how the text appears on labels and on buttons of the same size?
2) Is there any way to change the metrics of how text appears on buttons (top and left margins)?
As a result, I came up with the attached project (see TestLabelAndButton.zip). This App places a label and a button on the screen that are both the same size. It also allows you to change the height, width, text size, and text of both the label and the button, as well as showing some screen metrics.
There is a big difference between how this App appears on my Galaxy S3 (see Screenshot_GalaxyS3.png), and on my LG G4 (see Screenshot_LGG4.png). The label is the top View, and the button is the lower View.
What I am curious about is why there is such a big difference between the label and button as far as how much text can appear on each. As you can see, the "ABC" text fully appears on both the label and button on the GS3 at 100x100 size, but although the full "ABC" text appears on the LG G4 label, just a tiny piece of the "A" appears on the LG G4 button at 100x100.
In a slightly larger set of Views (122x122 -- see Screenshot_LGG4Margins.png), the LG G4 label text looks fine, but only the "A" appears on the button of the same size, with an appreciable top and left margin. Making the Width any smaller starts to cause the right edge of the "A" to be cut away.
My questions are:
1) Why is there a difference between how the text appears on labels and on buttons of the same size?
2) Is there any way to change the metrics of how text appears on buttons (top and left margins)?