Playwright 在Ubuntu 系統截圖亂碼

截圖發現出現的問題是一堆小方塊。

playwright截圖錯誤

這里其實顯而易見的就是中文亂碼。

出現這個問題就是因為服務器沒有安裝中文字體,所以無法解析。

所以只需要在服務器上安裝上對應的中文字體就可以了,

首先從本地Windows (C:\Windows\Fonts ) 上隨便找一個中文字體。

Windows字體文件

然后上傳到服務器的/usr/share/fonts文件夾中,之后輸入

fc-cache -fv

root@:/usr/share/fonts# fc-cache -fv

/usr/share/fonts: caching, new cache contents: 8 fonts, 1 dirs

/usr/share/fonts/truetype: caching, new cache contents: 0 fonts, 2 dirs

/usr/share/fonts/truetype/dejavu: caching, new cache contents: 6 fonts, 0 dirs

/usr/share/fonts/truetype/lato: caching, new cache contents: 18 fonts, 0 dirs

/usr/local/share/fonts: caching, new cache contents: 0 fonts, 0 dirs

/root/.local/share/fonts: skipping, no such directory

/root/.fonts: skipping, no such directory

/usr/share/fonts/truetype: skipping, looped directory detected

/usr/share/fonts/truetype/dejavu: skipping, looped directory detected

/usr/share/fonts/truetype/lato: skipping, looped directory detected

/var/cache/fontconfig: cleaning cache directory

/var/cache/fontconfig: invalid cache file: 3830d5c3ddfd5cd38a049b759396e72e-le64.cache-7

/root/.cache/fontconfig: not cleaning non-existent cache directory

/root/.fontconfig: not cleaning non-existent cache directory

fc-cache: succeeded

即可

?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容