Hi Streamlits,
Good Evening. In one of my project, i have been asked to use “SFMono-Regular.woff2” and "“SFMono-Regular.woff” font. so i downloaded it over online. I kept the files under “working-directory/static/fonts/SFMono-Regular.woff2”.
and i created a style.css with below code to access in app.py;
@font-face {
font-family: 'SF Mono';
src: url('/static/fonts/SFMono-Regular.woff2') format('woff2')
url('/static/fonts/SFMono-Regular.woff') format('woff');
font-weight: 400;
font-style: normal;
}
:root {
/* Fonts */
--font-primary: 'SF Mono', monospace;
}
body {
font-family: var(--font-primary);
}
and In app.py file. i used the below lines for access the style.css
# Load custom CSS
def load_css():
with open("style.css") as f:
st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)
load_css()
but i am not able to see the font difference. When i Inspect, i see the font response header is not having content-type : font/woff2 or font/woff; Also getting 304 status.
kindly help me to resolve this