gumyr / build123d

A python CAD programming library
Apache License 2.0
395 stars 72 forks source link

Add build123d method for listing fonts available to OCP/OCCT #364

Open jdegenstein opened 8 months ago

jdegenstein commented 8 months ago

Rough prototype:

from OCP.Font import Font_FontMgr
mgr = Font_FontMgr.GetInstance_s()
abc = mgr.GetAvailableFonts()
for i in abc:
    print(i.FontName().ToCString())

Returns:

Arial
Arial Black
Bahnschrift
Bahnschrift Light
Bahnschrift SemiLight
...
gumyr commented 8 months ago

Thanks @jdegenstein, this would be good to have. It's somewhat like import_svg_as_buildline_code more of a tool then a direct construct CAD capability. I guess if it's created as a function like list_available_fonts() then it doesn't really matter how it's classified.

rawwerks commented 5 months ago

+1 for this feature, would make my life so much easier, especially since i'm hosting b123d (so the user won't have any way of directly checking the server for available fonts).