Issue Filed About Control Size Issues on Raspberry Pi

I’m seeing issues with the control sizes on my Pi 3, 4 and 5. Basically, the control is too small to fit all the text properly on Buttons and Labels. When I build for Windows, Mac or Linux it’s fine. The issue is only on my Raspberry Pi’s. Anyone seen this and hopefully have a fix?

Please see the following for the ongoing discussion and some screen shots.

https://tracker.xojo.com/xojoinc/xojo/-/issues/75215

From there:

MacOS render, and then on his Pi (with extra big letters):

Screenshot_2023-12-19_at_4.36.06_PM

Screenshot_2023-12-19_at_4.34.48_PM

His example uses system font, size 0. Basically Default.

Normalize Control Sizes set on.

Raspberry Pi OS (December 5th 2023, Debian 12, Bookworm)

Set the control font to 12 and it will fit the defaut size. I believe xojo soomehow doesn’t really set the correct size (system default is probably 12 but xojo defines 14).

I do subclass the controls and set
#if targetArm And TargetLinux then
Self.FontSize = 12
#endif
RaiseEvent Opening

// you need to define event Opening again

I just manually set 3 controls on my test code to FontSize = 12 and they display correctly. Obviously it does’t make sense to do this manually, and I’m not sure how subclass the controls. I’m assuming simple code put somewhere in the project will handle all the controls, but I don’t know what that is or where to put it. I did try cut and paste of your suggestion and it didn’t work. I’m sure I didn’t put it in the proper place or use correctly.

I guess the Normalize Control Sizes is defective in this OS + DE

2 Likes

You can create a defaults override with the controls that you want (if changing 0 to 12 doesn’t affect your Windows/Mac/Linux projects).

In Documents create a folder named Xojo, inside one that is called Overrides, then for example DesktopButton.defaults as text file with this inside:

FontSize=12

now when you add a DesktopButton to your project it will show 12:
image

instead of 0.


Right click the control that you want to subclass:
image

Then a new control will be on your project:
image

Add the Opening event and Add an Event definition called Opening:
image

Add the code to the opening event:

#if targetArm And TargetLinux then
  Self.FontSize = 12
#endif
RaiseEvent Opening

Now, instead of using the default control, use the subclassed control in your projects.

1 Like

This makes sense to me. Look at the text on this screen shot of the Remote Debugger window on the Raspberry Pi. Even their code displays the issue.

1 Like

i remember i used 4 mm font on raspberry pi, not point size.

Well that’s my solution. The most obvious solution would be to make a ticket report with this info.

Thanks for explaining albert, i didn’t had the time for this. This pinpoints how i solved it.

“This pinpoints how I worked around it.”

There’s only one “solve” possible, Xojo fixing the “Normalize Control Sizes” for this platform.

2 Likes