This Extension Tool is fantastic, but it can be improved. Right now, when a given number has repeating decimals, there's no way to mark that on FreeCAD. Unfortunately, the way to represent this depends on the locale, and even inside a given locale, there might be different ways to do so [See this article on the Wikipedia]. Still, having a way to easily add the required symbols could be really helpful. So far, I'm resorting to using Inkscape to modify the exported document and add the horizontal line over the digits, since I could not figure what the right Unicode combining character is the right one.
As for how I expect this to work, I expect this to be added manually, via changing the dimension to "arbitrary=true" and then putting the symbol over the right decimals, I don't expect FreeCAD to go looking for repeating decimals and adding the symbol automatically.
[Extension Tools] [Feature Request] Add symbols for repeating decimals to "Customize Format Label"
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: [Extension Tools] [Feature Request] Add symbols for repeating decimals to "Customize Format Label"
And there is no way for FreeCAD to decide if such a representation exists, because it relies completely on the computers internal representation of numbers and that is always finite.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [Extension Tools] [Feature Request] Add symbols for repeating decimals to "Customize Format Label"
Which is why this is added to arbitrary dimensions, not to the values that FreeCAD adds by default
- wandererfan
- Veteran
- Posts: 6309
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: [Extension Tools] [Feature Request] Add symbols for repeating decimals to "Customize Format Label"
Using U305 - Combining Overline looks terrible in both the property editor and the page. If the font doesn't have glyphs for overlined digits, we'd have to draw the overline as a graphic and align it with the text to make it look right. That's a lot of coding.ToniTen wrote: ↑Tue Aug 16, 2022 11:00 am As for how I expect this to work, I expect this to be added manually, via changing the dimension to "arbitrary=true" and then putting the symbol over the right decimals, I don't expect FreeCAD to go looking for repeating decimals and adding the symbol automatically.
Re: [Extension Tools] [Feature Request] Add symbols for repeating decimals to "Customize Format Label"
So no unicode magic to save the day. I expected this to be just a matter of having the right unicode combining characters added, but that looks terrible. I assume it's a font issue?wandererfan wrote: ↑Tue Aug 16, 2022 5:28 pm Using U305 - Combining Overline looks terrible in both the property editor and the page. If the font doesn't have glyphs for overlined digits, we'd have to draw the overline as a graphic and align it with the text to make it look right. That's a lot of coding.
- wandererfan
- Veteran
- Posts: 6309
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: [Extension Tools] [Feature Request] Add symbols for repeating decimals to "Customize Format Label"
The graphic display above is using osifont, the PropertyEditor is using a different font, but I don't know which one. Things are a little better with a fixed width font (Monospace here), but still not great.
I guess we could customize a font to included overlined digits, but then you'd be limited to the custom font.
- Attachments
-
- repeating3_monoSpace.png (12.88 KiB) Viewed 624 times
Re: [Extension Tools] [Feature Request] Add symbols for repeating decimals to "Customize Format Label"
I have no idea if it's feasible, but could it be possible to customize OSIFONT, and sent the changes upstream? I mean, OSIFONT is a free and open source font right?wandererfan wrote: ↑Wed Aug 17, 2022 2:08 pm The graphic display above is using osifont, the PropertyEditor is using a different font, but I don't know which one. Things are a little better with a fixed width font (Monospace here), but still not great.
I guess we could customize a font to included overlined digits, but then you'd be limited to the custom font.
EDIT: Just checked the repository for upstream OSIFONT and it seems like development is ongoing, so I guess it would be feasible to try to send patches to make these combining characters work (I unfortunately have zero idea on how to edit a font)