Readwise 样式表与霞鹜文楷字体

为 Readwise 应用霞鹜文楷字体以改善中文文本显示

  1. // ==UserScript==
  2. // @name Readwise Stylesheet with LXGW Fonts
  3. // @name:zh-CN Readwise 样式表与霞鹜文楷字体
  4. // @name:zh-TW Readwise 樣式表與霞鶩文楷字體
  5. // @namespace http://tampermonkey.net/
  6. // @version 1.1
  7. // @description Applies LXGW fonts to Readwise for improved Chinese text display
  8. // @description:zh-CN 为 Readwise 应用霞鹜文楷字体以改善中文文本显示
  9. // @description:zh-TW 為 Readwise 應用霞鶩文楷字體以改善中文文本顯示
  10. // @match https://read.readwise.io/*
  11. // @license MIT
  12. // @locale en
  13. // @locale zh-CN
  14. // @locale zh-TW
  15. // ==/UserScript==
  16.  
  17. (function() {
  18. 'use strict';
  19.  
  20. // Add the external stylesheets
  21. var stylesheets = [
  22. 'https://cdn.jsdelivr.net/npm/@callmebill/lxgw-wenkai-web@latest/style.css',
  23. 'https://cdn.jsdelivr.net/npm/lxgw-wenkai-tc-webfont@1.0.0/style.css',
  24. 'https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont@1.1.0/style.css'
  25. ];
  26.  
  27. stylesheets.forEach(function(href) {
  28. var link = document.createElement('link');
  29. link.rel = 'stylesheet';
  30. link.href = href;
  31. document.head.appendChild(link);
  32. });
  33.  
  34. // Add custom styles
  35. var style = document.createElement('style');
  36. style.textContent = `
  37. #document-text-content p, #document-text-content li, #document-text-content span {
  38. font-family: 'Source Serif VF', 'LXGW ZhenKai', 'LXGW WenKai Screen', 'LXGW WenKai TC"', sans-serif;
  39. unicode-range: U+4E00-9FFF;
  40. }
  41.  
  42. #document-header h1, #document-text-content h1, #document-text-content h2, #document-text-content h3, #document-text-content h4, #document-text-content h5, #document-text-content h6 {
  43. font-family: serif;
  44. unicode-range: U+4E00-9FFF;
  45. }
  46. `;
  47. document.head.appendChild(style);
  48. })();