I have an app that uses custom fonts, its currently deployed to Azure using 1.41. I was about to push a new branch today and though it would be good time to update to 1.43 (I wanted that timezone support). I did a pip install --upgrade streamlit in my local venv. When i launched the app under 1.43 my custom font was gone. I used pip to go back to 1.41 and the font was correctly rendered again. When i launched in 1.43 i didn’t get the standard streamlit font, i instead got some ‘Time New Roman -like’ serif font, so i assume its trying to render my custom font but can’t and falling back to the browser default.
My code is:
css_path = 'assets/styles/style.css'
with open(css_path) as css:
st.markdown(f'<style>{css.read()}</style>', unsafe_allow_html=True)
style.css:
@font-face {
font-family: 'My Custom Font';
src: url('../fonts/my_custom_font.otf') format('opentype');
}
h1 {
font-family: 'My Custom Font', sans-serif !important;
}
h3 {
font-family: 'My Custom Font', sans-serif !important;
}
Any ideas?