I would like to add macOS system font San Francisco to the CSS style sheet. I tried to use font-family "San Francisco", also tried font-family: -apple-system,
but no luck so far. What would be the correct string?
Regards,
None of the current answers -- including the accept one -- will use Apple's San Francisco font on systems that don't have it installed as the system font. Since the question isn't "how do I use the OS X system font on a webpage," the correct solution is to use web fonts:
/** Ultra Light */
@font-face {
font-family: "San Francisco";
font-weight: 100;
src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-ultralight-webfont.woff");
}
/** Thin */
@font-face {
font-family: "San Francisco";
font-weight: 200;
src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-thin-webfont.woff");
}
/** Regular */
@font-face {
font-family: "San Francisco";
font-weight: 400;
src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-regular-webfont.woff");
}
/** Medium */
@font-face {
font-family: "San Francisco";
font-weight: 500;
src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-medium-webfont.woff");
}
/** Semi Bold */
@font-face {
font-family: "San Francisco";
font-weight: 600;
src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-semibold-webfont.woff");
}
/** Bold */
@font-face {
font-family: "San Francisco";
font-weight: 700;
src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-bold-webfont.woff");
}
* {
font-family: "San Francisco"
}
Return to Programming with Servoy
Users browsing this forum: No registered users and 15 guests