Default font selection and automatic assignment for unrecognized fonts

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

Default font selection and automatic assignment for unrecognized fonts

marko.p.radojcic
Hi.

I am thinking on starting to work on the option to automatically assign the default font to fonts that are not recognized during the loading stage of dxf or dwg file.

Is there interest in such feature?

Personally, I think it would be very useful.

Any pointers/advice/opinions would be greatly appreciated.

Best,
Marko
Reply | Threaded
Open this post in threaded view
|

Re: Default font selection and automatic assignment for unrecognized fonts

dxli
Hi Marko,

Where do you get the font data?

If it's Unicode, you can search other Unicode fonts to look for a backup.

If it's not Unicode, it's getting harder, because you cannot use an ASCII font for a symbol, for example.

Another thought, can we use ttf2lff at dxf loading time to create lff from system fonts, if font looking up fails. Or from some free ttf fonts online. Basically, making the lff management automatic.




marko.p.radojcic wrote
Hi.

I am thinking on starting to work on the option to automatically assign the default font to fonts that are not recognized during the loading stage of dxf or dwg file.

Is there interest in such feature?

Personally, I think it would be very useful.

Any pointers/advice/opinions would be greatly appreciated.

Best,
Marko
Reply | Threaded
Open this post in threaded view
|

Re: Default font selection and automatic assignment for unrecognized fonts

marko.p.radojcic
dxli wrote
Hi Marko,

Where do you get the font data?

If it's Unicode, you can search other Unicode fonts to look for a backup.

If it's not Unicode, it's getting harder, because you cannot use an ASCII font for a symbol, for example.

Another thought, can we use ttf2lff at dxf loading time to create lff from system fonts, if font looking up fails. Or from some free ttf fonts online. Basically, making the lff management automatic.
First of all, thank you @dxli.

My intended workflow would be to convert and install (if needed) a default font.
Then, using RS::FontList class to show available fonts in a dropdown somewhere in preferences as a selection for default font.
This font would be assigned to unrecognized fonts as a default.

So a GUI addition to allow a new setting ( and record in preferences backend) the default font.
Managing ASCII and Unicode separately is a good pointer, thank you.
And lastly to assign this font to unrecognized fonts during drawing load time.

Converting already existing fonts on the system to .lff is very interesting, and I will take it into account.

Downloading an open font on the fly could be messy and if it happens too often whenever someone starts using LibreCAD might result in a server crash or a ban of some kind (even if it is available on a known static URL). Instructing user to download and convert a font is good, which is already well documented.

The unicode font in librecad does not have support (ar at least it doesn't work) for many Serbian Cyrillic or even Serbian Latin characters. Neither does the cyrillic_i and cyrillic_ii. I guess this might be a problem for other languages too.

I (on my own machine) used Unifont that works well (it is a large Unicode font, unfortunately even though I think license is compatible, the converted font is too big to fit in the installer image).
It is not perfect in terms of appearance, the converted .lff is blocky, but it is correct and legible.

I will take into account your comments. I plan to learn more on this topic in LibreCAD during next couple of weekends and do the actual development work over the New Year's holidays.

Marko
Reply | Threaded
Open this post in threaded view
|

Re: Default font selection and automatic assignment for unrecognized fonts

dxli
Hi Marko,

We can add cyrillic fonts to our codebase, if you can find some fonts with compatible licenses.

Adding them to our unicode fonts may also help.

In long run, it's better to be able to download missing fonts automatically.

Regards,

dxli

Reply | Threaded
Open this post in threaded view
|

Re: Default font selection and automatic assignment for unrecognized fonts

marko.p.radojcic
dxli wrote
In long run, it's better to be able to download missing fonts automatically.

Regards,

dxli
I have thought about this. I think the correct path would be to add a plugin called something like "Font Download Manager" then we can use this plugin to allow the user to download open or otherwise license compatible fonts and automatically convert them using ttf2lff and add them to LibreCAD.

We would need to host an xml or JSON containing a font name, description and URL and maybe even host the fonts themselves on a static URL somewhere. An extension to the plugin could be to add a custom "repository" file to add support for downloading from other sites. This I believe can be done as a "stage 2 font feature", and I guess could be a welcome addition. Let me know what you think. Thanks,

Marko
Reply | Threaded
Open this post in threaded view
|

Re: Default font selection and automatic assignment for unrecognized fonts

marko.p.radojcic
Sorry for the delay. I had been working on another set of projects. I plan on doing it eventually but it has been delayed.