no default size for RichTextAnnotations
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
no default size for RichTextAnnotations
- take this example document:
- 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:
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)
- 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:
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)
- wandererfan
- Veteran
- Posts: 6320
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: no default size for RichTextAnnotations
Should be better after git commit e290e9c4c9
Re: no default size for RichTextAnnotations
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)
- wandererfan
- Veteran
- Posts: 6320
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: no default size for RichTextAnnotations
Not surprised, I didn't change anything in the dialog. I'll take a look when I get a minute.
Re: no default size for RichTextAnnotations
Thanks. I tested the RichTextAnnotations further and collected some issues here: https://forum.freecadweb.org/viewtopic.php?f=35&t=42746
- wandererfan
- Veteran
- Posts: 6320
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: no default size for RichTextAnnotations
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.uwestoehr wrote: ↑Wed Jan 29, 2020 10:28 pm This is fixed by: https://github.com/FreeCAD/FreeCAD/pull/2968
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 (41.49 KiB) Viewed 1445 times
Re: no default size for RichTextAnnotations
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.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.
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>
- wandererfan
- Veteran
- Posts: 6320
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: no default size for RichTextAnnotations
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;".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: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.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>
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.
Re: no default size for RichTextAnnotations
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 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;".
OK, so should I use 14 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.
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.