Font size shows as it should on Linnux Mint 64 bit but not on RPi Stretch

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
philjynx
Earned some good credits
Earned some good credits
Posts: 137
Joined: Tue Mar 06, 2018 6:00 pm

Re: Font size shows as it should on Linnux Mint 64 bit but not on RPi Stretch

Post by philjynx »

Hmmm, apparently I am not alone, and from what I've just read I certainly am not applying for the job of fixing this. Definitely out of my realm.

http://trac.wxwidgets.org/ticket/16088
viewtopic.php?t=42975

So, for the time being, no more wxWidgets coding for me - I'll just have to wait till this issue is resolved.
On the up-side though it means I'll get to play my music more.

A heartfelt thank you to all who have tried to help with this.
I look forward to the opportunity to develop my UI at a later date.
User avatar
doublemax
Moderator
Moderator
Posts: 19159
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Font size shows as it should on Linnux Mint 64 bit but not on RPi Stretch

Post by doublemax »

The forum post seems to describe the problem, but i think the trac ticket is about a different issue.

As a workaround i would use bitmap based buttons now. Create bitmaps with big text in Photoshop, Gimp, whatever and then use wxBitmapButtons in wxWidgets.
Use the source, Luke!
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Font size shows as it should on Linnux Mint 64 bit but not on RPi Stretch

Post by DavidHart »

That's a gtk+3 specific bug. Why not rebuild wx against gtk+2?
philjynx
Earned some good credits
Earned some good credits
Posts: 137
Joined: Tue Mar 06, 2018 6:00 pm

Re: Font size shows as it should on Linnux Mint 64 bit but not on RPi Stretch

Post by philjynx »

doublemax wrote:The forum post seems to describe the problem, but i think the trac ticket is about a different issue.

As a workaround i would use bitmap based buttons now. Create bitmaps with big text in Photoshop, Gimp, whatever and then use wxBitmapButtons in wxWidgets.
And the static text and any other text that might be wanted?
philjynx
Earned some good credits
Earned some good credits
Posts: 137
Joined: Tue Mar 06, 2018 6:00 pm

Re: Font size shows as it should on Linnux Mint 64 bit but not on RPi Stretch

Post by philjynx »

DavidHart wrote:That's a gtk+3 specific bug. Why not rebuild wx against gtk+2?
How do I ditch gtk3? Then, how do I employ gtk2? I wouldn't have to try very hard to get entirely muddled here.....

Incidentally, in my abortive attempts to google an answer to this stuff, I saw a few posts where QT users were having nightmares with RPi too.
Last edited by philjynx on Mon Mar 19, 2018 7:49 pm, edited 1 time in total.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Font size shows as it should on Linnux Mint 64 bit but not on RPi Stretch

Post by ONEEYEMAN »

Hi,
Which fonts are installing on the system?
I think in Linux you can check that by looking at some settings.

See if there will be a font you can select for your app.

Thank you.
philjynx
Earned some good credits
Earned some good credits
Posts: 137
Joined: Tue Mar 06, 2018 6:00 pm

Re: Font size shows as it should on Linnux Mint 64 bit but not on RPi Stretch

Post by philjynx »

ONEEYEMAN wrote:Hi,
Which fonts are installing on the system?
I think in Linux you can check that by looking at some settings.

See if there will be a font you can select for your app.

Thank you.
I'm sorry, if I didn't mention it earlier, I installed a font (the same font) on both machines and made sure to employ that one. It made no difference on the RPi, but did make a difference on the PC.
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Font size shows as it should on Linnux Mint 64 bit but not on RPi Stretch

Post by DavidHart »

How do I ditch gtk3? Then, how do I employ gtk2? I wouldn't have to try very hard to get entirely muddled here.....
Always assuming it is gtk+3-specific, why not simply install the stretch wx packages:
apt install libwxgtk3.0-dev
will probably suffice.

After, check that e.g.
wx-config --libs
finds the correct version.
philjynx
Earned some good credits
Earned some good credits
Posts: 137
Joined: Tue Mar 06, 2018 6:00 pm

Re: Font size shows as it should on Linnux Mint 64 bit but not on RPi Stretch

Post by philjynx »

Did that, doesn't look like it is correct though.

Code: Select all

 wx-config --libs
-L/usr/local/lib -pthread   -lwx_gtk3u_xrc-3.0 -lwx_gtk3u_html-3.0 -lwx_gtk3u_qa-3.0 -lwx_gtk3u_adv-3.0 -lwx_gtk3u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0 
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Font size shows as it should on Linnux Mint 64 bit but not on RPi Stretch

Post by DavidHart »

No, that's your gtk+3 build.
An apt installed gtk+2 version should say e.g. -lwx_gtk2u_adv-3.0 and won't mention /usr/local.

If you'd already installed the debian wxgtk2 packages, you can try selecting them by doing, as root:
#> update-alternatives --config wx-config
and selecting the correct one.
philjynx
Earned some good credits
Earned some good credits
Posts: 137
Joined: Tue Mar 06, 2018 6:00 pm

Re: Font size shows as it should on Linnux Mint 64 bit but not on RPi Stretch

Post by philjynx »

DavidHart wrote:No, that's your gtk+3 build.
An apt installed gtk+2 version should say e.g. -lwx_gtk2u_adv-3.0 and won't mention /usr/local.

If you'd already installed the debian wxgtk2 packages, you can try selecting them by doing, as root:
#> update-alternatives --config wx-config
and selecting the correct one.
It's not going well.....

Code: Select all

Configured wxWidgets 3.0.3 for `armv7l-unknown-linux-gnueabi'

  Which GUI toolkit should wxWidgets use?                 GTK+ 2 with support for GTK+ printing libnotify
  Should wxWidgets be compiled into single library?       no
  Should wxWidgets be linked as a shared library?         yes
  Should wxWidgets support Unicode?                       yes (using wchar_t)
  What level of wxWidgets compatibility should be enabled?
                                       wxWidgets 2.6      no
                                       wxWidgets 2.8      yes
  Which libraries should wxWidgets use?
                                       STL                no
                                       jpeg               builtin
                                       png                sys
                                       regex              builtin
                                       tiff               builtin
                                       zlib               sys
                                       expat              sys
                                       libmspack          no
                                       sdl                no

pi@raspberrypi:~/wxWidgets-3.0.3/gtk-build $ make
make: *** No rule to make target '/home/phil/wxWidgets-3.0.3/gtk-build/lib/wx/include/gtk3-unicode-static-3.0/wx/setup.h', needed by 'wxregex_regcomp.o'.  Stop.
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Font size shows as it should on Linnux Mint 64 bit but not on RPi Stretch

Post by DavidHart »

Did you install the debian binary packages ? If so, you don't need to build your own wx.

If you do want/need to build your own, are you building in the source dir or in a subdir? If the former, is that where you previously configured the gtk+3 build?
Assuming the answers are yes and yes, I suggest you instead do:
mkdir build-gtk2 && cd build-gtk2 && ../configure --enable-debug --with-gtk=2 --prefix=$(pwd) && make
That gets you a 'local' wxgtk2 build that can't conflict with any other one. You can access it by calling its wx-config direct using its full path, or by prefixing that full path to a terminal's PATH with
PATH=/full/path/to/build-gtk2:$PATH
philjynx
Earned some good credits
Earned some good credits
Posts: 137
Joined: Tue Mar 06, 2018 6:00 pm

Re: Font size shows as it should on Linnux Mint 64 bit but not on RPi Stretch

Post by philjynx »

DavidHart wrote:Did you install the debian binary packages ?
I'm sorry, I do not know what or where those are or how I'd install them.

I have fried my brain for today at least. What I'd like to do without re-flashing the SD card is wipe out wxwidgets entirely and start from scratch. For my PC it is considerably less of a problem because I have a new machine in the post which will be built from scratch, so if I get everything right, it won't be full of scrambled junk. Speaking which, that aptly describes what's in my head right now. Thanks.
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Font size shows as it should on Linnux Mint 64 bit but not on RPi Stretch

Post by DavidHart »

I'm sorry, I do not know what or where those are or how I'd install them.
Just do, as root:

Code: Select all

apt install libwxgtk3.0-dev
and agree to install any dependencies it asks for. I think you'll find that will work.
philjynx
Earned some good credits
Earned some good credits
Posts: 137
Joined: Tue Mar 06, 2018 6:00 pm

Re: Font size shows as it should on Linnux Mint 64 bit but not on RPi Stretch

Post by philjynx »

DavidHart wrote:
I'm sorry, I do not know what or where those are or how I'd install them.
Just do, as root:

Code: Select all

apt install libwxgtk3.0-dev
and agree to install any dependencies it asks for. I think you'll find that will work.

Code: Select all

pi@p:~ $ sudo apt install libwxgtk3.0-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libwxgtk3.0-dev is already the newest version (3.0.2+dfsg-4).
0 upgraded, 0 newly installed, 0 to remove and 72 not upgraded.
pi:~ $ 

Code: Select all

pi:~ $ wx-config --libs
bash: wx-config: command not found
p:~ $ 
and (still on the Pi) I ran this and made no change.

Code: Select all

 
sudo update-alternatives --config wx-config
There are 4 choices for the alternative wx-config (providing /usr/bin/wx-config).

  Selection    Path                                                             Priority   Status
------------------------------------------------------------
  0            /usr/lib/arm-linux-gnueabihf/wx/config/gtk2-unicode-3.0           308       auto mode
  1            /usr/lib/arm-linux-gnueabihf/wx/config/base-unicode-3.0           307       manual mode
* 2            /usr/lib/arm-linux-gnueabihf/wx/config/base-unicode-release-2.8   287       manual mode
  3            /usr/lib/arm-linux-gnueabihf/wx/config/gtk2-unicode-3.0           308       manual mode
  4            /usr/lib/arm-linux-gnueabihf/wx/config/gtk2-unicode-release-2.8   288       manual mode

Press <enter> to keep the current choice[*], or type selection number: 
update-alternatives: warning: forcing reinstallation of alternative /usr/lib/arm-linux-gnueabihf/wx/config/base-unicode-release-2.8 because link group wx-config is broken
Then I ran it again selecting the last option.

Code: Select all

sudo update-alternatives --config wx-config
There are 4 choices for the alternative wx-config (providing /usr/bin/wx-config).

  Selection    Path                                                             Priority   Status
------------------------------------------------------------
  0            /usr/lib/arm-linux-gnueabihf/wx/config/gtk2-unicode-3.0           308       auto mode
  1            /usr/lib/arm-linux-gnueabihf/wx/config/base-unicode-3.0           307       manual mode
* 2            /usr/lib/arm-linux-gnueabihf/wx/config/base-unicode-release-2.8   287       manual mode
  3            /usr/lib/arm-linux-gnueabihf/wx/config/gtk2-unicode-3.0           308       manual mode
  4            /usr/lib/arm-linux-gnueabihf/wx/config/gtk2-unicode-release-2.8   288       manual mode

Press <enter> to keep the current choice[*], or type selection number: 4
update-alternatives: using /usr/lib/arm-linux-gnueabihf/wx/config/gtk2-unicode-release-2.8 to provide /usr/bin/wx-config (wx-config) in manual mode

Code: Select all

$ wx-config --libs
-L/usr/lib/arm-linux-gnueabihf -pthread -Wl,-z,relro  -L/usr/lib/arm-linux-gnueabihf   -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8 
and then we try to build from my simple compile and link script, nothing fancy.
but to avoid being asked what it does:
cmplist

Code: Select all

main.cpp
JynxII.cpp
JIIGR55Settings.cpp
JynxIIGR55Settings.cpp
JIIKatanaSettings.cpp
JynxIIKatanaSettings.cpp
JIITopFrame.cpp
JynxIITopFrame.cpp
the compile and link script

Code: Select all

echo "Having a go at compiling and linking! :)"
g++ @cmplist $(wx-config --libs) $(wx-config --cxxflags) -o   MyApp

Code: Select all

Having a go at compiling and linking! :)
main.cpp:12:19: fatal error: wx/wx.h: No such file or directory
 #include <wx/wx.h>
                   ^
compilation terminated.
In file included from JynxII.cpp:8:0:
JynxII.h:11:24: fatal error: wx/artprov.h: No such file or directory
 #include <wx/artprov.h>
                        ^
compilation terminated.
In file included from JynxIIGR55Settings.h:9:0,
                 from JIIGR55Settings.h:5,
                 from JIIGR55Settings.cpp:1:
JynxII.h:11:24: fatal error: wx/artprov.h: No such file or directory
 #include <wx/artprov.h>
Not entirely encouraging.

Code from here on (in this post) is from my PC which is playing nice.
Is it perhaps, working (by which I mean my built App displays as it should) on my PC because of the following? I got this from http://codelite.org/LiteEditor/WxWidgets30Binaries but have not done the same on the RPi, I tried to, but was unable to:

Code: Select all

sudo update-alternatives --config wx-config
phil@phil-Veriton-N280G ~ $ sudo update-alternatives --config wx-config

There are 2 choices for the alternative wx-config (providing /usr/bin/wx-config).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/wx/config/gtk2-unicode-3.0-unofficial   308       auto mode
  1            /usr/lib/wx/config/base-unicode-3.0-unofficial   307       manual mode
* 2            /usr/lib/wx/config/gtk2-unicode-3.0-unofficial   308       manual mode


Code: Select all

phil@phil-Veriton-N280G ~ $ wx-config --libs
-L/usr/local/lib -pthread   /usr/local/lib/libwx_gtk3u_xrc-3.0.a /usr/local/lib/libwx_gtk3u_qa-3.0.a /usr/local/lib/libwx_baseu_net-3.0.a /usr/local/lib/libwx_gtk3u_html-3.0.a /usr/local/lib/libwx_gtk3u_adv-3.0.a /usr/local/lib/libwx_gtk3u_core-3.0.a /usr/local/lib/libwx_baseu_xml-3.0.a /usr/local/lib/libwx_baseu-3.0.a -lgthread-2.0 -pthread -lX11 -lXxf86vm -lSM -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lpng -lexpat -lwxregexu-3.0 -lwxtiff-3.0 -lwxjpeg-3.0 -lz -ldl -lm 
phil@phil-Veriton-N280G ~ $ 
It might be worth reiterating that I consider myself to be primarily an applications coder, I have scant knowledge of Linux (perilously close to zero), so I find it very, very, easy to get lost.

I do appear to have successfully broken wx related stuff on the Pi.

As I said, if there's some way to hoover out all trace of it and start from scratch, that's what I'd like to do.
Post Reply