no default size for RichTextAnnotations

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

no default size for RichTextAnnotations

Post by uwestoehr »

- take this example document:
TD-test.FCStd
test file
(137.59 KiB) Downloaded 32 times

- select the bottom view and insert a RichtText Annotation. In the appearing dialog just type in "test"

result: You cannot see the annotation, despite it is there:
view with RichText annotation
view with RichText annotation
FreeCAD_j9skEStWbc.png (4.37 KiB) Viewed 1698 times

The reason is that there is no default text size. So the tinyiest possible size is taken, making it unreadable.
Solution: The RichtText annotation should have the same default text size like the normal annotations. (which is 8 mm here)

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19263 (Git)
Build type: Release
Branch: master
Hash: c4ca00a1d5b7922ef1d2ae3e820bb34ffdb64d9f
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: no default size for RichTextAnnotations

Post by wandererfan »

uwestoehr wrote: Mon Jan 13, 2020 10:40 pm The reason is that there is no default text size. So the tinyiest possible size is taken, making it unreadable.
Solution: The RichtText annotation should have the same default text size like the normal annotations. (which is 8 mm here)
Should be better after git commit e290e9c4c9
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: no default size for RichTextAnnotations

Post by uwestoehr »

wandererfan wrote: Wed Jan 15, 2020 12:29 pm Should be better after git commit e290e9c4c9
many thanks for the commit. It fixes the bug partly.

This still fails:
- select the bottom view and insert a RichtText Annotation. In the appearing dialog just type in "test" and click OK. (don't open the rich text editing window)

This works now:
- select the bottom view and insert a RichtText Annotation. In the appearing dialog click on "Start Rich Text Editor". Then type in "test". Now you have a default size (on my system it is 10).

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19299 (Git)
Build type: Release
Branch: master
Hash: a285e89b2708de427fdce5b3b981a3ef630f5a4d
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: no default size for RichTextAnnotations

Post by wandererfan »

uwestoehr wrote: Fri Jan 17, 2020 5:10 pm This still fails:
- select the bottom view and insert a RichtText Annotation. In the appearing dialog just type in "test" and click OK. (don't open the rich text editing window)
Not surprised, I didn't change anything in the dialog. I'll take a look when I get a minute.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: no default size for RichTextAnnotations

Post by uwestoehr »

wandererfan wrote: Fri Jan 17, 2020 6:28 pm I'll take a look when I get a minute.
Thanks. I tested the RichTextAnnotations further and collected some issues here: https://forum.freecadweb.org/viewtopic.php?f=35&t=42746
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: no default size for RichTextAnnotations

Post by uwestoehr »

uwestoehr wrote: Fri Jan 17, 2020 5:10 pm This still fails:
- select the bottom view and insert a RichtText Annotation. In the appearing dialog just type in "test" and click OK. (don't open the rich text editing window)
This is fixed by: https://github.com/FreeCAD/FreeCAD/pull/2968
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: no default size for RichTextAnnotations

Post by wandererfan »

uwestoehr wrote: Wed Jan 29, 2020 10:28 pm This is fixed by: https://github.com/FreeCAD/FreeCAD/pull/2968
This isn't broken. In the current version, I get my system default(14 pt) text size. In your version I get tiny 10 pt text.

If you really need to set a default size, do it like the big editor and take it from preferences (int MRichTextEdit::getDefFontSizeNum(void)).
Attachments
defaultText.png
defaultText.png (41.49 KiB) Viewed 1444 times
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: no default size for RichTextAnnotations

Post by uwestoehr »

wandererfan wrote: Thu Jan 30, 2020 4:06 am In the current version, I get my system default(14 pt) text size. In your version I get tiny 10 pt text.
Not here. At the moment I get no text size at all and therefore the text is not readable. Just add a new RichAnno to a ProjGroup view and assure that you don't call the rich text editor, just input the text to the dialog and press OK.

This is what I get:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hello</p></body></html>
With my patch you get a text size and thus the annotation is readable. You can change the size later. The important thing is that users see the annotation they created. I mean I created some of them since I thought my action was never applied.
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: no default size for RichTextAnnotations

Post by wandererfan »

uwestoehr wrote: Thu Jan 30, 2020 12:39 pm Not here. At the moment I get no text size at all and therefore the text is not readable. Just add a new RichAnno to a ProjGroup view and assure that you don't call the rich text editor, just input the text to the dialog and press OK.

This is what I get:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hello</p></body></html>
With my patch you get a text size and thus the annotation is readable. You can change the size later. The important thing is that users see the annotation they created. I mean I created some of them since I thought my action was never applied.
Tried a different machine this morning, still get text from the small editor. The html sample has a text size too (very small, though) - "font-size:8.25pt;".

10 point text is too small. It needs to be bigger.

Even better, use the default font size for labels or dimensions as a starting point.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: no default size for RichTextAnnotations

Post by uwestoehr »

wandererfan wrote: Thu Jan 30, 2020 1:22 pm Tried a different machine this morning, still get text from the small editor. The html sample has a text size too (very small, though) - "font-size:8.25pt;".
I checked now 3 different PCS, one Win 7, 2 Win 10. On all machines I get no text size at all. With my patch I get on all 10 pt.

wandererfan wrote: Thu Jan 30, 2020 1:22 pm 10 point text is too small. It needs to be bigger.
Even better, use the default font size for labels or dimensions as a starting point.
OK, so should I use 14 pt?
If not, I don't know how to set the font-size at runtime. I searched yesterday some forums and they said one has to do this in the UI file. So my patch is basically the solution I found in the forums.
Post Reply