Version: FreeCAD_0.19.19510_x64_LP_12.1.2_PY3QT5-WinVS2015 /GIMP 2.10
OS: win10 x64
Summary:
DraftWB ShapeString font size varies in differnt font files. While in other apps, font sizes keep consistent between different font files.
Font file: HYSWLongFangSong.ttf
http://gd.ddooo.com:8081/uuauth/hycfst_ ... df9717.rar
0.19pre, DraftWB ShapeString font sizes vary among differnt font files
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
0.19pre, DraftWB ShapeString font sizes vary among differnt font files
- Attachments
-
- gimp210_fontsize_test.zip
- (35.11 KiB) Downloaded 19 times
-
- fc019pre_shapestring_fontsize_test.FCStd
- (111.39 KiB) Downloaded 21 times
- wandererfan
- Veteran
- Posts: 6326
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: 0.19pre, DraftWB ShapeString font sizes vary among differnt font files
My understanding is that it is normal for different fonts to have different actual sizes for the same nominal size. This explains it fairly well.
I guess GIMP scales the font to match the nominal point size. We could do that(??), but it has never come up before.
Re: 0.19pre, DraftWB ShapeString font sizes vary among differnt font files
Yes, if you learn LaTeX you often have to read a lot about fonts. It seems that there isn't a standard for many things, for example, "1 ex" is the height of the letter "x". For one font, this 1 ex is one size in millimeters, and for a different font, it has a different value. So they are both 1 ex, but with different real sizes. Same with the value "1 em" which is the value of the width of the letter "M".wandererfan wrote: ↑Tue Feb 18, 2020 1:05 am My understanding is that it is normal for different fonts to have different actual sizes for the same nominal size. This explains it fairly well.
...
And the typographical world uses all sorts of strange units like points (pt), big points (Adobe points?), and picas (pc).
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: 0.19pre, DraftWB ShapeString font sizes vary among differnt font files
Thank you and vocx, you are always warm hearted.wandererfan wrote: ↑Tue Feb 18, 2020 1:05 am ...
I guess GIMP scales the font to match the nominal point size. We could do that(??), but it has never come up before.
I've read you recommended article, and can understand that font design affect font size.
But in this case, the variation level obviously exceeds the font design factor.
In my new test, all weird size fonts are Chinese fonts.
- HYSWLongFangSong.ttf
- minliub.ttc (Win10 stock)
- simsun.ttc (Win10 stock)
But there are still normal size Chinese fonts.
- no.3 = msyh.ttc (Win10 stock)
- no.6 = msjh.ttc (Win10 stock)
So, this time, it turns out to be a new Chinese/CJK/DBCS font issue? I'm not quite sure. I'll do more tests.
Below is a weird size Chinese font download, siumsun.ttc (url is WinXP version, but same effect as Win10 version).
http://117.128.6.36/cache/down.font5.co ... d690a34c2d
Attachment is this time new test.
Last edited by fc_tofu on Wed Feb 19, 2020 11:37 am, edited 1 time in total.
- wandererfan
- Veteran
- Posts: 6326
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: 0.19pre, DraftWB ShapeString font sizes vary among differnt font files
Can't download your fonts, so I am using others with similar names.
Arial renders to almost perfect height, hysw is about double what it should be and simsun is a massive 7x what it should be.
If I compare hysw, simsun and arial in fontforge, the parameters (em size, ascender, descender, advance etc) are vastly different, so I'm not completely surprised that they render differently.
We only do a simple scaling of desired_height / em_size, so if the font uses an unusual em size or draws the glyphs in only part of the em square we won't get the intended size. We could use a more complex scaling algorithm, but it still would not guarantee the right size.
Another issue is that some fonts have bitmaps (which we don't use) for various sizes inside the font file, so if a program uses the bitmap(s) to render the glyphs, there is no guarantee that we (using the contours) will generate the same size glyphs.
You can make a feature request for more accurate font scaling, but I imagine it will be a long wait.