Ticket #4041 - Lost navigation cube labels

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Ticket #4041 - Lost navigation cube labels

Post by openBrain »

jmaustpc wrote: Mon Jul 01, 2019 1:08 am .... I wonder if this is also related to the QT version and Intel GPU/Driver?
Not that time I think. No problem here with an Intel GPU. :)
Last edited by openBrain on Mon Jul 01, 2019 11:20 am, edited 1 time in total.
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: Ticket #4041 - Lost navigation cube labels

Post by UR_ »

Same issue in german forum, like chrisb mentioned,
walks along with this error message in report view:

Code: Select all

XmbTextListToTextProperty result code -2

Same in your case?
User avatar
Roy_043
Veteran
Posts: 8576
Joined: Thu Dec 27, 2018 12:28 pm

Re: Ticket #4041 - Lost navigation cube labels

Post by Roy_043 »

On my system labels are visible but letters are squashed together.

Code: Select all

OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17144 (Git)
Build type: Release
Branch: master
Hash: ece1b7ecbaa36d22403d6850d8498882d820db3c
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Dutch/Netherlands (nl_NL)
Attachments
nav_019.png
nav_019.png (2.74 KiB) Viewed 1680 times
leong
Posts: 40
Joined: Mon Apr 11, 2016 8:46 pm

Re: Ticket #4041 - Lost navigation cube labels

Post by leong »

Anyone find a solution to this?
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Ticket #4041 - Lost navigation cube labels

Post by openBrain »

Does that change something if you change the app font?

Code: Select all

from PySide import QtGui
Gui.getMainWindow().setFont(QtGui.QFont("Mono", 10, QtGui.QFont.Normal, False))
leong
Posts: 40
Joined: Mon Apr 11, 2016 8:46 pm

Re: Ticket #4041 - Lost navigation cube labels

Post by leong »

Thank you. Sadly, it did not help the labels in the Navigation Cube.
Any idea where the Navigation Cube takes its font from?
The Xmb error (XmbTextListToTextProperty result code -2) appears throughout the log file, but I have no idea of its significance.
leong
Posts: 40
Joined: Mon Apr 11, 2016 8:46 pm

SOLVED--Re: Ticket #4041 - Lost navigation cube labels

Post by leong »

So i went looking around for a solution. I looked in the source code and saw the navigation cube used "Helvetica" font. I searched my system and I did not have Helvetica. It is proprietary but I found a free sample and downloaded it and installed the font on my system and now the labels can be seen.
screen_20190809-072523.png
screen_20190809-072523.png (2.97 KiB) Viewed 1602 times
This problem could be resolved by using a different font in the navigation cube.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Ticket #4041 - Lost navigation cube labels

Post by Kunda1 »

'Hold your horses there fella' not sure this is Solved just yet. You found a workaround but not a solution. A solution would entail having a conditional check to see if said font in the system before setting it as the font for FC. Oh and another thing, are u saying that Helvetica (a proprietary font) is a hardcoded default in to FC??
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
leong
Posts: 40
Joined: Mon Apr 11, 2016 8:46 pm

Re: Ticket #4041 - Lost navigation cube labels

Post by leong »

Thank you for the correction. You are correct, it is "solved" for me. My workaround was based on finding the following in NaviCube.cpp for 0.19

Code: Select all

if (text) {
		paint.setPen(Qt::white);
		QFont sansFont(str("Helvetica"), 0.18 * texSize);
		sansFont.setStretch(QFont::ExtraCondensed);
		paint.setFont(sansFont);
		paint.drawText(QRect(0, 0, texSize, texSize), Qt::AlignCenter,qApp->translate("Gui::NaviCube",text));
	}
and on the fact that changing the font in preferences had not effect on the navigation cube.
As I do not do coding (and my little knowledge is likely a dangerous thing), I leave it to you to say whether or not that constitutes harcoding the font into FC.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: SOLVED--Re: Ticket #4041 - Lost navigation cube labels

Post by jmaustpc »

leong wrote: Fri Aug 09, 2019 11:31 am So i went looking around for a solution. I looked in the source code and saw the navigation cube used "Helvetica" font. I searched my system and I did not have Helvetica. It is proprietary but I found a free sample and downloaded it and installed the font on my system and now the labels can be seen.
screen_20190809-072523.png

This problem could be resolved by using a different font in the navigation cube.
I doubt that is the problem since the text shows perfectly here for me and as far as I can tell I don't have Helvetica on this system, at least not that I can find. Wouldn't the system substitute the font with another if it can't find Helvetica?


OS: Ubuntu 18.04.3 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.6.8
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Australia (en_AU)
Post Reply