Adding a new font as ttf file

Hello,

I would like to add a new font in order to use it on template node in html. I have a .ttf file and would like to import it to nodered. Could you please let me know If there is any method to do that?

The ui_template node has a setting to load code into the head of the Dashboard page and that would be the best place to load the font I think.

Put something like this into a ui_template node, set template type to "added to site head section"

<style>
    @font-face {
        font-family: LCDBOLD; 
        src: url("/fonts/LCDBOLD.ttf");
    }
    
</style>

I did this but still cannot see my font when trying to use in font-family field on any html.

I am trying to send a mail and I have prepared a template node (not ui_template) with an html and trying to use my font for mail strings

Not all mail services support external fonts I don't believe. Check to make sure that the received message actually still includes the font, I expect it won't.

The received mail has the font name but not its style. The style still calibri but font name is what I entered to templete node.

To me, that implies that the mail client has ignored the font specification. You may wish to check with the vendor of the client as to whether they support external fonts. Typically the mail client will block all external requests in an email because too many unscrupulous organisations use such calls to track people.

You can sometimes work around that by making the resource into a data link but that would make all of your emails super large. I use that trick though to embed a small BCS logo into my professional emails.

I thought you wanted to use it within node red.

If you are sending a html format email then the email client cannot access the font from node red.

Even if the mail client would allow to use it, the font would still need to be hosted online, for it to be downloaded.

there is a good guide here - Web Fonts: How to Make Them Work Perfectly in Email - Litmus

Really, just don't do it. If you use an external link, it won't work on most clients anyway and even those where it might work will probably block it and if even that works, you are leaking your recipients info to the host of the font.

You should not be putting any external links into emails without letting the recipients clearly understand what you are doing.

I was just going to post this as an example of why its not worth it, but figured that its better to read it and come to that conclusion yourself :wink:

image

Interesting that the supposed privacy minded Apple are the only ones to allow such a potential privacy leak!

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.