Hello guys,

I’m trying to install SF font from Apple on my Droplet.

I’ve placed the font in 3 places, just in case:

/usr/share/fonts/
/usr/local/share/fonts/
~/.fonts/

Then in my .css I have:

font-family: 'SF UI Display Regular';

Which works fine in my Mac.

Any suggestions please?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Have you installed a desktop environment on your droplet? Which .css file are you referring to?

@telm

Unless you’re referencing the location of the font in your CSS file, font-family isn’t going to work as it normally would in a local environment (i.e on a Mac or Windows machine).

In your CSS file, you’ll need to define @font-face and provide a direct or relative path to the font file before it can be used.

This should be placed above any references to the font in question (i.e. at the top of the CSS file).

i.e.

@font-face {
    font-family: 'SF UI Display Regular';
    font-style: normal;
    font-weight: 400;
    src: local('/path/to/font.ext');
}

You would need to change /path/to/font.ext to the direct or relative path to the associated file.

Submit an Answer