Changing font style in Google Colab Markdown text

Viewed 566

is this possible to change the markdown's font style in Colab?
I wrote this CSS code but as it doesn't work, I don't know how to use it (or if it's possible or not).
The code perfectly works in a html file but not working on Colab:

<html>
<head>
    <link href="https://fonts.googleapis.com/css2?family=Alike+Angular&display=swap" rel="stylesheet">
    <style>
        p {
            font-family: 'Alike Angular', serif;
            font-size: 22px;
        }
    </style>
</head>
</html>

<span>
    <p>Lorem ipsum dolor sit amet,</p>
</span>
1 Answers

Two problems:

  1. That is the URL of the Github page about the TrueType file, not the TrueType file itself. You need to add ?raw=true:

    https://github.com/cyrealtype/Alike/blob/master/Alike-Regular.ttf?raw=true

  2. The server, that serves the TrueType file, needs to give you its permission for you to include it. And it's unlikely Github will give you that permission, because it's not a file delivery service.

You need to either download the font file and serve it from the same web server where you host your HTML/CSS files, or find a font provider that serves it from a server that gives you permission, for example, Google Fonts, which has "Alike": https://fonts.google.com/?query=alike

Related