View Issue Details

IDProjectCategoryView StatusLast Update
0003139DraftBugpublic2018-01-11 16:02
ReporterUname3D Assigned Toyorik  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformfreecad 64 bits 0.17.11616 (Git)OSLinux 64OS VersionUbuntu 16.04LTS
Product Version0.17 
Summary0003139: Draft ShapeString tool doesn't have utf-8 support
DescriptionHi, I have a problem with freecad in draft mode with the shapestring tool.

In french version, when I have to type the shapestring in the subwindow "Texte surfacique", i.e. "text on a surface". I can see a bug, it requires a "Chaîne" (french for string) but it shows something like "Cha®ne" (accent_maj_a + registered_sign) So it is obvious that there is a unicode/latin problem.
Even worse, I cannot type a string with accents. And, I cannot use a .ttf file in a subdirectory with accents.

There are no other problem with UTF-8 in freecad except here.
Steps To ReproduceSet your OS locals to french for instance.
Open freecad.
Open a new project.
Go to draft.
Use the shapestring tool.
Choose any coordinate.
Then the bug appears.
Then if you type an accentuated string like "élo", it will show you a square in spite of the "é" char.
If you search the .ttf file in a directory which contains "é" it will not validate the path.
Additional InformationOS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11616 (Git)
Build type: None
Branch: master
Hash: aba4338808178b508f3170237f205e0066a5b437
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: French/France (fr_FR)
Tagsfont, locale, shapestring, unicode
FreeCAD Information

Relationships

related to 0001947 closedwandererfan FreeCAD Non-ASCII Character in ShapeString FontFile Path 

Activities

Kunda1

2017-07-26 17:20

administrator   ~0009828

@NormandC can you replicate this ?

normandc

2017-07-27 00:49

manager   ~0009832

Last edited: 2017-07-27 00:49

The tool is not called "String", it's called ShapeString!!! Please fix the summary and description.

I confirm that in the GUI, the text labels are not translated correctly, see file attached.

Although the ShapeString object is correctly created for me with accented letters (second capture). I do not have font files located in a path with accented letters. I believe that on Linux that goes against conventions regarding the file system.

OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11659 (Git)
Build type: None
Branch: master
Hash: 37258b918def361c8f80b3e82a6a420904af1229
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: French/Canada (fr_CA)

Kunda1

2017-07-27 01:04

administrator   ~0009833

fixed summary and description.

Uname3D

2017-07-27 04:02

reporter   ~0009835

Sorry for the wrong name it is ShapeString indeed.

Accented letters in the file system is not conventional.
But in french ubuntu 16.04, the "/home/$USER/Download" path is renamed "/home/$USER/Téléchargement". This is where the fonts you just downloaded are located by default. Yes I can move the file or rename the path without accentuated directories. I didn't, I like utf-8 accented paths.

May I can have some information about your test ? I'd try to reproduce it with the same font and see if it is a font file related problem.

Thanks for the fast answer and for your time NormandC !

Kunda1

2017-08-14 00:17

administrator   ~0009923

@Uname3D please open a forum thread and bi-directionally link this ticket and the thread together.
CC @normandc

Kunda1

2017-09-13 12:22

administrator   ~0010114

@normandc ping

normandc

2017-09-13 14:09

manager   ~0010116

Last edited: 2017-09-13 14:11

But in french ubuntu 16.04, the "/home/$USER/Download" path is renamed "/home/$USER/Téléchargement". This is where the fonts you just downloaded are located by default.

Uname3D
Any downloaded file is saved there by default unless you specify the path, but it does not mean that they should stay there. Downloaded font files should always be moved to /home/$USER/.fonts so they are recognized by the system.

For completeness, here is the error message in the Report View when selecting a font located in a path with accented letters:
Traceback (most recent call last):
  File "/usr/lib/freecad-daily/Mod/Draft/Draft.py", line 5918, in execute
    CharList = Part.makeWireString(obj.String,obj.FontFile,obj.Size,obj.Tracking)
<type 'exceptions.TypeError'>: ** makeWireString bad args.
But again, on Ubuntu, fonts should either go to the system folder (/usr/share/fonts) or the dedicated ~/.fonts user folder.

Kunda1

2017-09-30 11:41

administrator   ~0010217

@normandc Is this a dupe of 0001947 ?

yorik

2017-10-27 19:56

administrator   ~0010362

Indeed the shapestring tool font path is not encoded correctly. I'll take care of it

Kunda1

2017-12-07 04:17

administrator   ~0010528

FreeCAD Pull Request 1149

wmayer

2017-12-07 09:44

administrator   ~0010536

https://github.com/FreeCAD/FreeCAD/commit/750661de3503e5cca3a1d7ae5614340d4948d9df

Issue History

Date Modified Username Field Change
2017-07-26 06:23 Uname3D New Issue
2017-07-26 11:03 Kunda1 Tag Attached: locale
2017-07-26 17:20 Kunda1 Note Added: 0009828
2017-07-27 00:49 normandc File Added: FC017_Sraft_ShapeString_French_02.png
2017-07-27 00:49 normandc File Added: FC017_Sraft_ShapeString_French_01.png
2017-07-27 00:49 normandc Note Added: 0009832
2017-07-27 00:49 normandc Note Edited: 0009832
2017-07-27 01:03 Kunda1 Summary Draft string tool no utf-8 support => Draft ShapeString tool doesn't have utf-8 support
2017-07-27 01:03 Kunda1 Description Updated
2017-07-27 01:03 Kunda1 Steps to Reproduce Updated
2017-07-27 01:04 Kunda1 Note Added: 0009833
2017-07-27 04:02 Uname3D Note Added: 0009835
2017-08-14 00:17 Kunda1 Note Added: 0009923
2017-08-14 00:18 Kunda1 Status new => feedback
2017-09-13 12:22 Kunda1 Note Added: 0010114
2017-09-13 12:24 Kunda1 Tag Attached: #post-to-forum
2017-09-13 14:09 normandc Note Added: 0010116
2017-09-13 14:11 normandc Note Edited: 0010116
2017-09-30 11:38 Kunda1 Tag Attached: shapestring
2017-09-30 11:38 Kunda1 Tag Attached: font
2017-09-30 11:39 Kunda1 Tag Attached: unicode
2017-09-30 11:41 Kunda1 Note Added: 0010217
2017-09-30 11:41 Kunda1 Relationship added related to 0001947
2017-10-27 19:56 yorik Note Added: 0010362
2017-10-27 19:56 yorik Assigned To => yorik
2017-10-27 19:56 yorik Status feedback => assigned
2017-12-07 04:16 Kunda1 Tag Detached: #post-to-forum
2017-12-07 04:17 Kunda1 Note Added: 0010528
2017-12-07 09:44 wmayer Note Added: 0010536
2018-01-11 16:02 yorik Status assigned => closed
2018-01-11 16:02 yorik Resolution open => fixed