0.19pre editor cannot save Chinese font family name

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
fc_tofu
Posts: 653
Joined: Sun Jan 05, 2020 4:56 pm

0.19pre editor cannot save Chinese font family name

Post by fc_tofu »

version: FreeCAD_0.19.19358_x64_Conda_Py3QT5-WinVS2015
os: win10 x64

Preferences>General>Editor>Family, choose a Chinese font family and apply. Font change take effect immediately in python console
But after restarting FreeCAD, Editor font was change back to first font family (in alphabetic order).
Check "user.cfg" file and find saved font family name is "????".

Set font family as "微软雅黑"
Image

After restarting FreeCAD
Image

"user.cfg" file

Code: Select all

        <FCParamGroup Name="Editor">
          <FCBool Name="EnableLineNumber" Value="1"/>
...
          <FCText Name="Font">????</FCText>
        </FCParamGroup>
It seems that font selector here cannot handle DBCS characters. I'm not a coder and dont know the difficulty to fix it. But I found the font selector used in Draft>ShapeString (notnative) can pick font file name (not font family name). Chinese named font family can use ASCII file name. Its a common practice in Windows. So howabout use the font selector in ShapeString to replace here.
Thank you.
Post Reply