Using custom fonts

Hi, I was wondering if I can use a custom font instead of the predefined three in the Edit Theme menu in setting? There I only see three options in the font family menu: sans serif, serif and monospace.

I have some tff font files I downloaded and I would like to use them instead.

I am new to streamlit and not that experienced with css. I would appreciate some examples and references.

I see that it is possible to override using st.markdown as given here . and this guide

But it doesn’t seem to work.

def style():
    css = """
    <link rel="preconnect" href="https://fonts.gstatic.com">
        <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap" rel="stylesheet"> 
    <style>
    @font-face {
        font-family: 'My Font';
        font-style: normal;
        src: url(assets/fonts/myfont.tff) format('truetype');;
    }
    .sidebar-text{
        font-family: 'Roboto', sans-serif;
    }
    .standard-text{
        font-family: 'My Font';
    }
    </style>
    """
    st.markdown(css,unsafe_allow_html=True)
style()