Font Roboto in LibreCAD

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Font Roboto in LibreCAD

foosterh
Hello

I run
Versione: 2.1.3
Compilatore: GNU GCC 11.2.0
Compilato in data: Jan 30 2022
Versione Qt: 5.15.3
Boost Version: 1.74.0
System: Ubuntu 22.04.3 LTS


I am asked to use the Roboto font (https://fonts.google.com/specimen/Roboto) in LibreCAD.
I am aware of the tff2lff converter (for windows only, as I understand) but I have Ubuntu only (no WINE) on my computer.

I am aware of the fact that the conversion of TTF into LFF may loose info, but would like to give it try.

So here is my question: is there a TTF-2-LFF conversion tool/program in the Ubuntu space I can use for the font conversion?

Thanks
Fred
Reply | Threaded
Open this post in threaded view
|

Re: Font Roboto in LibreCAD

LordOfBikes
Administrator
Welcome Fred!

The ttf2lff tool is part of the build for all OS, but it is not deployed, neither as part of LibreCAD package, nor standalone.

I've converted Roboto-Thin for you, so you can test if it is satisfying for you.
robotothin.lff

LibreCAD supports only outline fonts. There are two options for solid letters:
1) hatch
- explode text
- select a single letter (e.g. with window select)
- apply a solid hatch
- repeat for each letter
2) line width
- change the layer line width until all gaps are closed

Method 2 may work well for thin fonts, but for regular fonts the line width will probably be too much and the letters become too rounded.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Font Roboto in LibreCAD

foosterh
Thanks Armin for the support. 1. As expected the .lff font resulting from your conversion does not have the letters filled up, fact that comes out either specifying a huge letter height or zooming in a lot. See attached screen shot where the space between grid points is 1 cm. Screenshot_from_2023-10-24_20-56-14.png I will experiment with zoom and/or font height to see if it works out for me (i.e. obtain decent print out) 2. For the moment I will not explore the way you indicate to get fully filled up characters. 3. For future: should I decide to convert font(s), how can I get to the ttf2lff conversion tool you mention to exist but "not deployed"? Kind regards Fred
Reply | Threaded
Open this post in threaded view
|

Re: Font Roboto in LibreCAD

LordOfBikes
Administrator
LibreCAD does not support filled fonts.
We have single strike fonts, with constant line width, working like a pen plotter. They can also be made 'heavier' by changing line width.
But most, if not all, converted fonts are outline types.

ttf2lff is build with LibreCAD, when FreeType library is installed on the build system. So you probably need to build LibreCAD from source and have to fulfill requirements for ttf2lff to get your own tool.

I cobbled some HTML/PHP code together, to provide an online converter.
Sadly, after finishing it locally, it doesn't run on our server, because of some missing requirements.
Means I can't finish this yet, and I'm on tour the next couple days. If it is not urgent, you must not dive into building from source. I think I can publish a working online converter next weekend.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Font Roboto in LibreCAD

foosterh
Hello Armin

Great you're working on an on-line ttf2lff variant.
I am not in a hurry :-)

Thanks
Fred
Reply | Threaded
Open this post in threaded view
|

Re: Font Roboto in LibreCAD

LordOfBikes
Administrator
Please, try this:
https://librecad.org/ttf2lff/index.html

It's basically tested and working for supported TTF fonts, but not sure what happens with unsupported TTF's. It should show the ttf2lff error output, but I couldn't test it.
It's not a beauty yet, but it does what it should. If it works, it can be enhanced and properly designed.

If any issue happens, please report here.
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Font Roboto in LibreCAD

oldarchitect
Armin,
Thank you very much. I am trying to convert the public domain "Flux Architect " font ( I'm a retired  Architect  teaching drafting students ). The online app says "Converting " at top but never completes the process to report a finished .lff file. Any ideas what is wrong ?
Reply | Threaded
Open this post in threaded view
|

Re: Font Roboto in LibreCAD

LordOfBikes
Administrator
Just checked it and it's probably because of blanks in the file name.
I removed the blanks, then it worked for me.
This should be easy to fix, for now you can simply rename the font files and avoid blanks and maybe other special characters in the TTF filename.
Also, the .ttf extension is mandatory (case insensitive)!

The LFF file is created all lower case, because there were issues with upper case file names on case sensitive OS (Linux/Mac OS).

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Font Roboto in LibreCAD

oldarchitect
THANK YOU VERY MUCH !!!!  You are exactly right. I simply retyped the ttf file names without any blanks or non alphabet or numerical characters and it works like a charm. I would still appreciate any info on where to find the ttf2lff source or precompiled code ( Linux version NOT Windows ).
Reply | Threaded
Open this post in threaded view
|

Re: Font Roboto in LibreCAD

LordOfBikes
Administrator
I'm glad, that it worked for you.
Meanwhile it is fixed, blanks in upload filenames are OK, but they are removed for LFF output, to avoid issues using them with LibreCAD.

The ttf2lff source is kept inside the main LibreCAD code base:
https://github.com/LibreCAD/LibreCAD/tree/master/tools/ttf2lff

Sadly, there is not THE precompiled/binary of ttf2lff, it has dependencies, libraries, which could be different on various Linux distributions. So it would need it's own deployment or distribution package for each Linux distribution and probably release version.
When LibreCAD is built from source, all dependencies for ttf2lff are fulfilled on that specific Linux machine, and it will work, but the binary can't be copied to a different distribution or release version.
That ttf2lff is built with LibreCAD, the additional package libfreetype-dev has to be installed, beside the other requirements for LibreCAD itself.

Following instructions should probably work for most Ubuntu derivates:
https://github.com/LibreCAD/LibreCAD/wiki/Build-from-source
The executable is then in the unix folder, beside the librecad executable.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: Font Roboto in LibreCAD

foosterh
Hi Armin

works fine for me.

Thanks for the work you did!

Regards
Fred