LibreCAD icon indicating copy to clipboard operation
LibreCAD copied to clipboard

Convert shx font

Open lianzaozi opened this issue 5 years ago • 7 comments

Is there any way or software that can convert shp/shx (shx files decompiled to get shx files) fonts to lff fonts?

lianzaozi avatar Jun 08 '20 01:06 lianzaozi

I think you need convert shx to tff then use ttf2lff convert ttf to lff

liufeijin avatar Jun 08 '20 03:06 liufeijin

Do you know what conversion software can convert shx to ttf?

lianzaozi avatar Jun 08 '20 06:06 lianzaozi

Sorry, i don't find it still.

liufeijin avatar Jun 08 '20 07:06 liufeijin

请问解决了吗,cad的单线矢量字体hztxt能在librecad上面显示吗

hsieb avatar Apr 12 '23 06:04 hsieb

Is there any way or software that can convert shp/shx (shx files decompiled to get shx files) fonts to lff fonts?

Yes. See:

  • https://sourceforge.net/p/shx-font-converter/code/ci/master/tree/
    • https://github.com/Kharabadze/SHX_font_converter

@dxli @lordofbikes, Could it be merged to LibreCAD repo?

Also, on forum discussed some other way of SHX2LFF converting:

  • https://forum.librecad.org/Another-Font-Conversion-Experiment-tp5723057.html
  • https://forum.librecad.org/SHX-to-LFF-td5723053.html

u2fly avatar Aug 18 '24 02:08 u2fly

@dxli @lordofbikes, Could it be merged to LibreCAD repo?

I had a look at the repo and I don't want to merge this into LibreCAD's code base. It looks like a quick'n'dirty hack, there are various issues which will surely raise CVE's in future.

This doesn't mean, that the converter does not work. It may work for what it is built and it may be fine as an external tool. But to bundle it with LibreCAD it is too vulnerable, it might affect LibreCAD's trust and security rating. The code would need a general refactoring or even a complete rewrite.

lordofbikes avatar Aug 22 '24 12:08 lordofbikes

OK, there is SHX to Hershey Python lib: https://github.com/tatarize/shxparser

And source of Hershey to LFF fontconverter has been found (it might could be merged to ttf2lff, as derivated from it itself):

  • https://github.com/LibreCAD/LibreCAD/issues/1245#issuecomment-2295078081

u2fly avatar Aug 22 '24 12:08 u2fly

Interesting point about keeping conversion programs separate from the main CAD program.

CVE's being Common Vulnerabilities and Exposures.

Was interesting to learn that "Hershey" is the name of a government tech person that wrote some important font data.

Noticed that the book on QCAD did not seem to mention the term CXF (or LFF) in the table of contents. Seems like all common file extensions should be listed there for users. So that they can become familiar with this stuff.

BTW, I can imagine sign makers wanting to get access to SHX conversions for detailed CAM work, cutting out letters and such. Not really the main market for LibreCAD though.

Gary-Wheeler avatar Dec 24 '24 11:12 Gary-Wheeler