[ Bug ] Draft preferences: problems with font settings

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
UR_
Veteran
Posts: 1354
Joined: Tue Jan 03, 2017 8:42 pm

Re: Draft preferences: problems with font settings

Post by UR_ »

yorik wrote: Wed Jan 22, 2020 9:25 am Then I'll merge it ...
Perhaps someone else with more c++ experience should have a look at: FileDialog.cpp, Widgets.cpp, customwidgets.cpp
to apply a more general solution.
Because same problem occurs, if according property should be edited by property editor.
wmayer wrote: :bell:
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Draft preferences: problems with font settings

Post by vocx »

yorik wrote: Wed Jan 22, 2020 9:25 am Then I'll merge it and we fix things afterwards if it breaks for linux ;)
It seems it fails with Windows.

0.19pre, ShapeString fail on clean-installed FreeCAD
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
fc_tofu
Posts: 653
Joined: Sun Jan 05, 2020 4:56 pm

Re: Draft preferences: problems with font settings

Post by fc_tofu »

wandererfan wrote: Sat Oct 05, 2019 2:12 am
Roy_043 wrote: Wed Oct 02, 2019 7:56 am Another Windows-only file access issue that is perhaps related or can maybe provide a clue?:
https://forum.freecadweb.org/viewtopic. ... 39#p337939
After looking into this, I would say the Draft Preference problem is definitely not the same issue the file rename problem.

Its a wide spread issue - see issue #4153 for details.

The batch file in the bug report fixed it for me.
Please take a look.
https://forum.freecadweb.org/viewtopic. ... 44#p368544
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Draft preferences: problems with font settings

Post by Roy_043 »

Thanks for the work done so far. When creating a ShapeString I now automatically get a different file dialog and I can access the Windows Font folder.

But there is an issue with the File dialog if you want to change the font of an existing ShapeString. In that case the Windows OS file dialog is still being opened. Now there is no error message, but the dialog does not show any files for the Windows Font folder.

Code: Select all

OS: Windows 8.1 (6.3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20311 (Git)
Build type: Release
Branch: master
Hash: 915e551bbb7e3614bc804f1ae1f65027b5432b9f
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Dutch/Netherlands (nl_NL)
fc_tofu
Posts: 653
Joined: Sun Jan 05, 2020 4:56 pm

Re: Draft preferences: problems with font settings

Post by fc_tofu »

Roy_043 wrote: Fri Apr 10, 2020 1:59 pm But there is an issue with the File dialog if you want to change the font of an existing ShapeString. In that case the Windows OS file dialog is still being opened. Now there is no error message, but the dialog does not show any files for the Windows Font folder.
Parameter Editor >BaseApp >Preferences >Dialog,

for ShapeString:
DontUseNativeFontDialog =true/false

for Menu >File >Open...
DontUseNativeDialog =ture/false
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug ] Draft preferences: problems with font settings

Post by Roy_043 »

@fc_tofu:
Thanks for your answer. DontUseNativeFontDialog=True on my system. But, as can be concluded from my previous post, this setting is ignored when you try to modify an existing ShapeString.
fc_tofu
Posts: 653
Joined: Sun Jan 05, 2020 4:56 pm

Re: [ Bug ] Draft preferences: problems with font settings

Post by fc_tofu »

Roy_043 wrote: Sat Apr 11, 2020 4:07 pm @fc_tofu:
Thanks for your answer. DontUseNativeFontDialog=True on my system. But, as can be concluded from my previous post, this setting is ignored when you try to modify an existing ShapeString.
Have you tried restarting FreeCAD after setting "DontUseNativeFontDialog=true" ?
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug ] Draft preferences: problems with font settings

Post by Roy_043 »

Thanks. I have just tried that. But still the Windows OS file dialog is being opened when I edit the font of an existing ShapeString.

Note that on my system (I assume on all Windows systems) the DontUseNativeFontDialog=True setting is created when Draft_ShapeString is first used. So probably this setting does not require a restart. But some settings do, so it was a good idea to check this. Thanks again.
Lulu51
Posts: 2
Joined: Thu Dec 31, 2020 10:00 am

Re: Draft preferences: problems with font settings

Post by Lulu51 »

wandererfan wrote: Wed Oct 09, 2019 11:18 pm If there's a Windows user out there that hasn't messed too much with attributes, permissions, etc, on the Fonts directory, could they try the following please?

In Tools>Edit parameters, add a parameter to the Dialog section as shown in this screen grab:
WindowsPrefDialogParm.png


On my Windows box, setting this parameter to true allows access to the Windows/Fonts directory. I'm not sure my machine is a valid test environment anymore since I've set and reset the Fonts properties so often.

Thanks,
wf
I tried to do your correction but in the preference windows at dialog, I have no option to set true or false, what can I do?
In fact my provlem is that when openinf a ShapeString, after choosing a font adress, I have the message "Font file not found: file adress (but must be executed)" this in Freecad 0.18.4 64 bits under W10.
Thanks for any help.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug ] Draft preferences: problems with font settings

Post by Roy_043 »

The font dialog solution was introduced in V0.19.
For V0.18 you can do this:
https://forum.freecadweb.org/viewtopic. ... 10#p339884
Post Reply