discuss@lists.openscad.org

OpenSCAD general discussion

View all threads

Documentation suggestion

RW
Ron Wheeler
Mon, Jul 12, 2021 4:00 PM

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Text talks about
adding a new font.

Is includes the example of "use"

It does not explain what the contents inside the bracket actually
represent nor where the ttf file needs to be.
use <ttf/paratype-serif/PTF55F.ttf>

It also does not explain that you only need to add the "use" if you do
NOT install the font as a system font.

Later is shows how to list the system fonts that are available but
choses a different font family
This is less helpful than it could be and does not discuss what happens
with the font included with the "use"

$ fc-list -f"%-60{{%{family[0]}%{:style[0]=}}}%{file}\n"  |  sort
 ...
Liberation Mono:style=Bold Italic /usr/share/fonts/truetype/liberation2/LiberationMono-BoldItalic.ttf
Liberation Mono:style=Bold        /usr/share/fonts/truetype/liberation2/LiberationMono-Bold.ttf
Liberation Mono:style=Italic      /usr/share/fonts/truetype/liberation2/LiberationMono-Italic.ttf
Liberation Mono:style=Regular    /usr/share/fonts/truetype/liberation2/LiberationMono-Regular.ttf
...

It also fails to mention that if you add the font to the system fonts
while OpenSCAD is running, you need to restart OpenSCAD before the font
will show up in "Help>Font List"

My case:

I am trying to use the NHL Bruin font to make something for a Bruins fan.
I have installed the font in /user/share/fonts/ so that fc-list shows

NanumGothicExtraBold:style=Regular
/usr/share/fonts/nhn-nanum/NanumGothicExtraBold.ttf
NanumGothic:style=Bold /usr/share/fonts/nhn-nanum/NanumGothicBold.ttf
NanumGothic:style=Regular /usr/share/fonts/nhn-nanum/NanumGothic.ttf
NHL Bruins:style=Regular /usr/share/fonts/NHL/NHL_Bruins.ttf
Nimbus Mono PS:style=Bold Italic
/usr/share/fonts/urw-base35/NimbusMonoPS-BoldItalic.otf
Nimbus Mono PS:style=Bold Italic
/usr/share/fonts/urw-base35/NimbusMonoPS-BoldItalic.t1

And it shows up in the OpenSCAD font list as font 193 with Font Name NHL
Bruins font style Regular with Filename /run/host/fonts/NHL/NHL_Bruins.ttf.
which seems to be in line with the other fonts.
Not sure where /run/host/fonts comes from.

If I have
        use <NHL/NHL_Bruins.ttf>
I get

WARNING: Can't open library 'NHL/NHL_Bruins.ttf'.

Removing the "use" makes it work.

--
Ron Wheeler
Artifact Software
438-345-3369
rwheeler@artifact-software.com

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Text talks about adding a new font. Is includes the example of "use" It does not explain what the contents inside the bracket actually represent nor where the ttf file needs to be. use <ttf/paratype-serif/PTF55F.ttf> It also does not explain that you only need to add the "use" if you do NOT install the font as a system font. Later is shows how to list the system fonts that are available but choses a different font family This is less helpful than it could be and does not discuss what happens with the font included with the "use" $ fc-list -f"%-60{{%{family[0]}%{:style[0]=}}}%{file}\n" | sort  ... Liberation Mono:style=Bold Italic /usr/share/fonts/truetype/liberation2/LiberationMono-BoldItalic.ttf Liberation Mono:style=Bold /usr/share/fonts/truetype/liberation2/LiberationMono-Bold.ttf Liberation Mono:style=Italic /usr/share/fonts/truetype/liberation2/LiberationMono-Italic.ttf Liberation Mono:style=Regular /usr/share/fonts/truetype/liberation2/LiberationMono-Regular.ttf ... It also fails to mention that if you add the font to the system fonts while OpenSCAD is running, you need to restart OpenSCAD before the font will show up in "Help>Font List" My case: I am trying to use the NHL Bruin font to make something for a Bruins fan. I have installed the font in /user/share/fonts/ so that fc-list shows NanumGothicExtraBold:style=Regular /usr/share/fonts/nhn-nanum/NanumGothicExtraBold.ttf NanumGothic:style=Bold /usr/share/fonts/nhn-nanum/NanumGothicBold.ttf NanumGothic:style=Regular /usr/share/fonts/nhn-nanum/NanumGothic.ttf NHL Bruins:style=Regular /usr/share/fonts/NHL/NHL_Bruins.ttf Nimbus Mono PS:style=Bold Italic /usr/share/fonts/urw-base35/NimbusMonoPS-BoldItalic.otf Nimbus Mono PS:style=Bold Italic /usr/share/fonts/urw-base35/NimbusMonoPS-BoldItalic.t1 And it shows up in the OpenSCAD font list as font 193 with Font Name NHL Bruins font style Regular with Filename /run/host/fonts/NHL/NHL_Bruins.ttf. which seems to be in line with the other fonts. Not sure where /run/host/fonts comes from. If I have         use <NHL/NHL_Bruins.ttf> I get WARNING: Can't open library 'NHL/NHL_Bruins.ttf'. Removing the "use" makes it work. -- Ron Wheeler Artifact Software 438-345-3369 rwheeler@artifact-software.com