changing text font in 2d

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!
Post Reply
Riedel74
Posts: 15
Joined: Tue Sep 27, 2022 8:46 am

changing text font in 2d

Post by Riedel74 »

I know how to change font in 3d like the pic I have here but when I put the text from 3d to 2d it changes the font and I cant get it back.
so is ther any way to chose what text font I use in 2d? first pic is when I have it in 2d second is having the font I want to use.


Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: Swedish/Sweden (sv_SE)
Installed mods: 
  * A2plus 0.4.59c
  * Assembly3 0.11.3
  * Assembly4 0.12.4
  * fasteners 0.4.12
  * toSketch 1.0.1
Attachments
text2.jpg
text2.jpg (9.54 KiB) Viewed 631 times
2221.jpg
2221.jpg (19.27 KiB) Viewed 631 times
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: changing text font in 2d

Post by onekk »

Riedel74 wrote: Wed Oct 05, 2022 8:14 am I know how to change font in 3d like the pic I have here but when I put the text from 3d to 2d it changes the font and I cant get it back.
so is ther any way to chose what text font I use in 2d? first pic is when I have it in 2d second is having the font I want to use.
What WB you are using, FC has many places where you could specify a "font".

Some examples, among others:
  • ShapeString, you could change the font directly in the object property.
Annotations, Dimensions or or other things.

attaching a file with some examples maybe will be useful.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
Riedel74
Posts: 15
Joined: Tue Sep 27, 2022 8:46 am

Re: changing text font in 2d

Post by Riedel74 »

funny part now I seems to get the font working but when I change from 3d to 2d the size is not the same.
Attachments
TEST FILE.FCStd
(14.97 KiB) Downloaded 18 times
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: changing text font in 2d

Post by onekk »

Riedel74 wrote: Wed Oct 05, 2022 9:53 am funny part now I seems to get the font working but when I change from 3d to 2d the size is not the same.
Yes it depends from the 2D and 3D setting of the "Draft Label" it respect or not the .TextSize property.


From: https://github.com/FreeCAD/FreeCAD/blob ... e_label.py
"""Create a Label object containing different types of information.
The current color and text height and font specified in preferences
are used.
Probably this is set too high 1000.00mm the different thing is there is a different behaviour of the scale factor on the text depending on the 3d or 2d setting.

There is a reason for which behaviour but I don't remember what is.

See maybe: https://wiki.freecadweb.org/Draft_Label

@Roy_043 Please do you a have a better explanation?

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: changing text font in 2d

Post by Roy_043 »

I find it understandable that the size of the text changes when switching the "Display Mode" of the label. When the text faces the camera it has a constant height (relative to the screen), so only at a certain zoom level will the text keep the same height when switching.

onekk wrote: Wed Oct 05, 2022 10:47 am there is a different behaviour of the scale factor on the text depending on the 3d or 2d setting.
You need to explain this, I can't reproduce it.
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: changing text font in 2d

Post by onekk »

Roy_043 wrote: Wed Oct 05, 2022 12:43 pm
onekk wrote: Wed Oct 05, 2022 10:47 am there is a different behaviour of the scale factor on the text depending on the 3d or 2d setting.
You need to explain this, I can't reproduce it.

If you use TEST_FILE.FCStd file in:

https://forum.freecadweb.org/viewtopic. ... 30#p630730

You will se that the measure are in mm but as example FontSize is 1000mm for the dLabel object if you change from 2d to 3d the dimensions of the text change "dramatically".

In that sense, (at least on my FC where units are mm).

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: changing text font in 2d

Post by Roy_043 »

Thanks, I thought you were talking about the "Scale Multiplier" property.
Post Reply