Sketcher dimension number size

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Sketcher dimension number size

Post by triplus »

If i interpret provided data correctly then:

Low-res screens -> too small
Mid-res screens -> too small
Low or Mid-res screens + FreeCAD window extending beyond screen size -> OK ;)
High-res screens -> OK
High-res screens + small resized FreeCAD windows -> too small

If user could set font size in px would resizing FreeCAD windows still affect font size?

About colour schemes probably it does nut hurt to have them and NX example is in way appropriate one to distinguish correct constrains compared to let say over-constraints but if red/green is not suitable for colour blind people then maybe blue/red. I do not know but i do know great colour scheme can really change how application is received by the end user and this is probably the task for some great "UX artist" in the end because probably a lot of thought has to be put in to it to get things right.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Sketcher dimension number size

Post by triplus »

That is why i said in the past FreeCAD forums should probably have design section too. For icon work and for stuff like this.

"Colour Scheme Contest" thread could be made to see if anybody in FreeCAD community is able to beat current colour scheme. If yes great if no the old one stays!
mrlukeparry
Posts: 655
Joined: Fri Jul 22, 2011 8:37 pm
Contact:

Re: Sketcher dimension number size

Post by mrlukeparry »

If it helps the code that scales the text are these two lines in SoDatumLabel@line267

Code: Select all

const SbViewVolume & vv = SoViewVolumeElement::get(state);
float scale = vv.getWorldToScreenScale(SbVec3f(0.f,0.f,0.f), 0.4f);
If I remember correctly, the 0.4f argument is equivalent to pixels on the screen. We can probably infer the correct size from the DPI or the window size.

Also a configurable size/height for the font can be set since Qt is used to render the datum labels. There is actualy a Node Property/Field that can be set. I just don't think is made accessible via the ViewProvider.

Hopefully that be of some use...
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Sketcher dimension number size

Post by triplus »

I investigated a bit and i might be off track but does FreeCAD use FTGL for this exact purposes? If the answer is yes reading at this:

http://ftgl.sourceforge.net/docs/html/ftgl-faq.html

Does not look as there is an easy solution for the problem.
Is it possible to map a font to a "unit" size? My application relies on the fonts being a certain "physical" height (in OpenGL coordinate space) rather than a point size in display space. Any thoughts/suggestions?
Short answer:
We can do anything:)
Where can is probably a typo and can not is it? Reading about it do i understand correctly resizing FreeCAD window will always change font size? One solution would be to do real time scaling? But then again this could introduce issues:
Pitfall #5: Font scaling
This is pitfall is a consequence of scaling. When you scale the FTGL font, you must take the scale into account when working with bounding boxes and string widths.
http://devcry.heiho.net/2012/01/opengl- ... -ftgl.html

Could that represent issues for selection purposes? Probably it would do just that?

Anyway user configurable text box (that does not represent pixels) is one solution to control the size but that will not help to keep the same font size when FreeCAD window is being re-sized? Anyway if no obvious solution (without the need for doing considerable amount of work) is possible text box inside preferences is it? It would still be better compared to current situation and it would allow end user to at least do some customization based on the hardware used? I know the first thing i would do would be to bump it up for 2 or 3 times!
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: Sketcher dimension number size

Post by tanderson69 »

I had the same thought as Luke. I did some testing, by dumping the scale number from SbViewVolume::getWorldToScreenScale to the terminal. Window stretching vertical vs horizontal wasn't consistent with the changes to scale. Vertical stretching would scale the dimension correctly, but horizontal stretching would be reversed. I am thinking to get what we want we might have to skip getWorldToScreenScale. I have used sotext2 in the past and it seemed to work good. I am thinking we can use it for a reference. Doesn't look too bad. Notice it is not using the that function. https://bitbucket.org/Coin3D/coin/src/a ... ult#cl-313
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Sketcher dimension number size

Post by triplus »

I didn't realize setting in Preferences for sketcher font size was actually implemented (under Display -> Sketcher) until today! This really makes my work easier.

Just an observation of something i noticed and that is increasing the value (px) actually decreases font size? Is this intended behaviour?
Post Reply