request for input: default for NaviCube font

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!
user1234
Veteran
Posts: 3320
Joined: Mon Jul 11, 2016 5:08 pm

Re: request for input: default for NaviCube font

Post by user1234 »

chrisb wrote: Sat Jan 28, 2023 12:18 am Would it be possible to use SVGs created from a decent font? We would be platform independent and future safe.
I think the main goal on this is, that you can translate or rename the sides of the cube, even on more then ASCII character set, like unicode for example arabic fonts. Then you need a font, else you have do all as svg, also the setting and spacing of the written words.


Greetings
user1234
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: request for input: default for NaviCube font

Post by chrisb »

user1234 wrote: Sat Jan 28, 2023 1:43 am I think the main goal on this is, that you can translate or rename the sides of the cube,
Of course :oops: .
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: request for input: default for NaviCube font

Post by onekk »

There is no a font that is shared between diferent OS and Windows is known not to follow standards. Even across his versions.

I know that it may be not popular but as MS has deprecated (end of life) Windows 7 and probably 8.1 too developers should tsrget window 10 and 11, and maybe document workaround for old systems.

Probably an installed font should work. there is no a way to set an hardcoded path with a opensource font put in FreeCAD program path?

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/
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: request for input: default for NaviCube font

Post by GeneFC »

onekk wrote: Sat Jan 28, 2023 7:41 am I know that it may be not popular but as MS has deprecated (end of life) Windows 7 and probably 8.1 too
Completely irrelevant. Any OS can have and use virtually any font.

Gene
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: request for input: default for NaviCube font

Post by onekk »

GeneFC wrote: Sat Jan 28, 2023 3:33 pm
onekk wrote: Sat Jan 28, 2023 7:41 am I know that it may be not popular but as MS has deprecated (end of life) Windows 7 and probably 8.1 too
Completely irrelevant. Any OS can have and use virtually any font.

Gene
I could disagree as Arial was used by MS and then they changed standard font name supplied with the OS.

But sadly even Helvetica is not a standard name, (it was if I i don't go wrong an Adobe TM) better use Serif, Sans Serif, Fixed (or monospaced) to design family of fonts,.

Linux and probably MacOS use fontconfig Windows other things to set fonts, so the matter is not really plain.

I think that a multiOS toolkit like Qt should have some OS agnostic ways to define things across different OS but when dealing with fonts even "metric compatibility" is difficult to have and manage across different OS, not counting HighDpi screens and similar things that could complicate things.

It resemble the start of IBM compatible computing graphics saga EGA, VGA, XGA if you remember.

I'm confident that developer will find a correct way to implement things.

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/
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: request for input: default for NaviCube font

Post by GeneFC »

onekk wrote: Sat Jan 28, 2023 4:18 pm I could disagree as Arial was used by MS and then they changed standard font name supplied with the OS.
I don't know where you are trying to go with this.

Not all computers, even with the same OS, will have the same set of fonts available. However, if a font is included in the FreeCAD distribution, such as the case for TechDraw, then virtually any OS can use it.

Gene
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: request for input: default for NaviCube font

Post by adrianinsaval »

chrisb wrote: Sat Jan 28, 2023 12:18 am Would it be possible to use SVGs created from a decent font? We would be platform independent and future safe.
I don't remember if the navicube is translatable but if it is this would be problematic
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: request for input: default for NaviCube font

Post by chrisb »

adrianinsaval wrote: Sat Jan 28, 2023 5:06 pm I don't remember if the navicube is translatable but if it is this would be problematic
That's what I learned already above from user1234.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: request for input: default for NaviCube font

Post by mario52 »

Hi

or one icon not translation and universal

Navigation Cube Colours

Image

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
aapo
Posts: 615
Joined: Mon Oct 29, 2018 6:41 pm

Re: request for input: default for NaviCube font

Post by aapo »

onekk wrote: Sat Jan 28, 2023 7:41 am Probably an installed font should work. there is no a way to set an hardcoded path with a opensource font put in FreeCAD program path?
There is, and this techinque is already used in the TechDraw module with osifont. It's discussed right in the first page of this same thread, and user Roy_043 even pointed out the relevant part of the c++ code: https://github.com/FreeCAD/FreeCAD/blob ... ui.cpp#L79, which shows that it's actually really simple and easy with Qt. I'll paste it here for your convenience:

Code: Select all

void loadTechDrawResource()
{
    // add resources and reloads the translators
    Q_INIT_RESOURCE(TechDraw);
    Gui::Translator::instance()->refresh();

    // add fonts
    std::string fontDir = App::Application::getResourceDir() + "Mod/TechDraw/Resources/fonts/";
    QFontDatabase fontDB;

    std::vector<std::string> fontsAll(
        {"osifont-lgpl3fe.ttf", "osifont-italic.ttf", "Y14.5-2018.ttf", "Y14.5-FreeCAD.ttf"});

    for (auto& font : fontsAll) {
        QString fontFile = Base::Tools::fromStdString(fontDir + font);
        int rc = fontDB.addApplicationFont(fontFile);
        if (rc < 0) {
            Base::Console().Warning(
                "TechDraw failed to load font file: %d from: %s\n", rc, qPrintable(fontFile));
        }
    }
}
Post Reply