普通に @font-face で url に相対パスを指定すれば動く
扱い的に local ぽいけど local はインストール済みフォントをパスではなく名前指定で探すもの

(例)
フォントは 「M PLUS 1 Code」 を使用
Google Fonts でダウンロード
https://fonts.google.com/specimen/M+PLUS+1+Code?query=Coji+Morishita&vfonly=true

index.html と index.css と MPLUS1Code-Regular.ttf を同じフォルダに配置

[index.html]
<!doctype html>
<head>
<meta charset="utf-8"/>
<link rel="stylesheet" href="./index.css"/>
</head>
<body>
<h1>H1</h1>
<pre><code class="">function a() {<br/> console.log("!#$%&{}+*@|?")<br/> return 1<br/>}</code></pre>
<pre><code class="font1">function a() {<br/> console.log("!#$%&{}+*@|?")<br/> return 1<br/>}</code></pre>
<pre><code class="font2">function a() {<br/> console.log("!#$%&{}+*@|?")<br/> return 1<br/>}</code></pre>
</body>

[index.css]
@font-face {
font-family: "mp1c";
src: url("MPLUS1Code-Regular.ttf");
}
pre code {
display: block;
border: 1px solid #000;
padding: 5px;
}
.font1 {
font-family: monospace;
}
.font2 {
font-family: mp1c;
}

コマンド
weasyprint index.html out.pdf

結果
out