Feature #3254 Embed font into FCSTD file for better model exchange between different systems

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Feature #3254 Embed font into FCSTD file for better model exchange between different systems

Post by GeneFC »

NormandC wrote: Sun Jul 01, 2018 3:54 pm What's the difference between redistributing and embedding font files??? :?
I believe most embedded fonts cannot be readily extracted for further use or distribution. "Installable" fonts can be extracted for other uses apart from the original dcument.

Gene
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Feature #3254 Embed font into FCSTD file for better model exchange between different systems

Post by DeepSOIC »

NormandC wrote: Sun Jul 01, 2018 3:54 pm Yet embedding is allowed.

What's the difference between redistributing and embedding font files???
I agree, it's all very confusing.


But in the end, it is user's responsibility. FreeCAD should let them do what they want, that's FOSS after all. FreeCAD can display a reminder to check font's license.

Embedding an image raises similar license questions, and we have it already.
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Feature #3254 Embed font into FCSTD file for better model exchange between different systems

Post by NormandC »

GeneFC wrote: Sun Jul 01, 2018 4:12 pm I believe most embedded fonts cannot be readily extracted for further use or distribution.
I wonder if it would be possible to do that here. But I don't see how, I guess anyone could simply unzip the FCStd file and copy the font contained.

DeepSOIC wrote: Sun Jul 01, 2018 4:29 pm FreeCAD can display a reminder to check font's license.
That makes sense.
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: Feature #3254 Embed font into FCSTD file for better model exchange between different systems

Post by UR_ »

NormandC wrote: Sun Jul 01, 2018 4:34 pm ... I guess anyone could simply unzip the FCStd file and copy the font contained.

More or less, it's the same as with other files containing embedded fonts.


https://stackoverflow.com/questions/348 ... font-files
User avatar
wandererfan
Veteran
Posts: 6307
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Feature #3254 Embed font into FCSTD file for better model exchange between different systems

Post by wandererfan »

NormandC wrote: Sun Jul 01, 2018 3:39 pm
wandererfan wrote: Fri Jun 29, 2018 1:46 pm Maybe a function to remap paths when fonts aren't found?
Do you mean to convert a ShapeString into a "dumb" set of curves, breaking the link to the font? Inkscape can do that. (On the other hand, this is already possible by using Draft Downgrade)
I was thinking directory paths. If the font isn't found, offer up a file chooser for a local alternate.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Feature #3254 Embed font into FCSTD file for better model exchange between different systems

Post by Kunda1 »

Old-school merging topics from: https://forum.freecadweb.org/viewtopic.php?f=8&t=38643
where the following posts were made and are relevant and appropriate for this discussion:
TheMarkster wrote: Thu Aug 29, 2019 4:30 pm The maintainers at github in charge of the project are the ones who changed it to a relative path. I had it in e:\downloads\fonts when I made the model.
tarek wrote: Thu Aug 29, 2019 6:54 am
kisolre wrote: Wed Aug 28, 2019 2:29 pm Also relative path to font file does not work under windows. I tried "assets/asimov.otf" and "./assets/asimov.otf"
Thanks for this. Interesting problem. I think at least it will work for some (I tested and it works on GNU/Linux), whereas with absolute paths it will work for none, right? Any other proposed solutions?
chrisb wrote: Thu Aug 29, 2019 3:21 pm Ok, so we have indeed a regression. I tested with the slightly outdated version below and it can handle a font path of the form
myFontDirectory/fontfile.ttf which uses myFontDirectory below the current directory of the FreeCAD file.
chrisb wrote: Fri Aug 30, 2019 7:02 am The new Link objects respect relative paths to subfolders but not to the current directory :o .
wmayer wrote: Fri Aug 30, 2019 9:54 am And how do you even use relative paths? This can only happen when you manually type in the path into the edit field while when using the browse button always an absolute path is returned.
UR_ wrote: Fri Aug 30, 2019 10:10 am This kind of reediting manually is necessary if you try to move your FCStd file and corresponding stuff like tff files, which are refereed by your FCStd but are not included, to your team mate on a separate machine.
wmayer wrote: Fri Aug 30, 2019 10:56 am Apparently we are talking about App::PropertyFile and not App::PropertyFileIncluded, right?
Just want to make sure we didn't lose track of this side-thread

Edit: This is all related to: issue #3254
Wrong paths to fonts occur when you exchange models between different systems. An 'Embed' option would be useful
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
onekk
Veteran
Posts: 6197
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Feature #3254 Embed font into FCSTD file for better model exchange between different systems

Post by onekk »

Maybe a more unified solution would be using free fonts in TTF format.

These font will be placed in the FreeCAD sources, maybe a decent front could be some of the font included say in LibreOffice.

A reduced count maybe be One for "Sans Serif", "Serfi" and "monospace", maybe one "Handwritten" font.

At least this will work for Windows and Linux and other Unix systems, I don't know much on MacOS.

https://en.wikipedia.org/wiki/Droid_fonts

https://en.wikipedia.org/wiki/Liberation_fonts

https://en.wikipedia.org/wiki/GNU_FreeFont

https://en.wikipedia.org/wiki/Open-sour ... _typefaces

Some interesting article on Web Safe Fonts

https://web.mit.edu/jmorzins/www/fonts.html

I don't know if is feasible, but with some FreeCAD images weighting 500 Mb i don't think that choosing two or three fonts will be a big wheight increase.


Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
catman
Posts: 412
Joined: Fri Jan 11, 2019 10:42 pm

Re: Feature #3254 Embed font into FCSTD file for better model exchange between different systems

Post by catman »

Please let me highlight this still up-to date thread is from 2018. The issue and ticket remains open.


Currently I have a file that is using a custom font file for Draft Annotations. I do attach it as TTF file to the project.
To send this file to another FreeCAD user he/she must add the font to the draft preferences of their installation just to see the file. For more files its necessary to install the font to their system (where it will likely remain forever :lol: )

Maybe its a step forward to agree on a possible solution, that someone may end up implementing sometime?

My suggestion from a user perspective:

Code: Select all

Draft/Annotation/Properties/View:
   Font Name                 Arial                                 # thats used  today, a fixed selection list
   Font Path Override    data/myfont.tts                # project local path overriding the default Font Name
When "Font Path Override" is empty Arial will be used, else the path.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Feature #3254 Embed font into FCSTD file for better model exchange between different systems

Post by Kunda1 »

Thanks for your feedback on this. Hope we can discuss this issue and find a solution before v1.0 release. Or else we're going to give a lot of FreeCAD users headaches.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply