0.19pre, DraftWB ShapeString font sizes vary among differnt font files

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.
fsc_2020-02-14_223622.jpg
fsc_2020-02-14_223524.jpg
Font file: HYSWLongFangSong.ttf
http://gd.ddooo.com:8081/uuauth/hycfst_131877.rar?9f1fbedab04a91e3bddfbdc9b5df9717.rar
gimp210_fontsize_test.zip (35.1 KB)
fc019pre_shapestring_fontsize_test.FCStd (111 KB)

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.

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”.

And the typographical world uses all sorts of strange units like points (pt), big points (Adobe points?), and picas (pc).

Thank you and vocx, you are always warm hearted.
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.
fsc_2020-02-19_000650b.jpg
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.com.cn/fontfile/200903/simsunttc.rar?ich_args2=527-19001407061132_080dab17e0de12a4bf498ea34e7def00_10001002_9c896c2ed7c7f3d59132518939a83798_dfc4962257b681be02e978d690a34c2d

Attachment is this time new test.
fc019pre_shapestring_fontsize_test2.FCStd (75.2 KB)

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.