京东朗正体

在网页中使用京东朗正体

  1. // ==UserScript==
  2. // @name 京东朗正体
  3. // @namespace JingDongLangZhengTi
  4. // @version 1
  5. // @description 在网页中使用京东朗正体
  6. // @author LWF
  7. // @license MIT
  8. // @grant none
  9. // @match *://*/*
  10. // @run-at document-start
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. // 创建一个 <style> 元素
  15. const css = document.createElement('style');
  16. // 为 <style> 元素设置 CSS 内容,导入外部字体,并强制所有元素使用 JingDongLangZhengTi 字体
  17. css.innerHTML = `
  18. @font-face {
  19. font-family: 'JingDongLangZhengTi';
  20. src: url('https://jdrdl.jd.com/assets/fonts/JDLANGZHENGTI-L--GBK1-0.woff2') format('woff2'),
  21. url('https://jdrdl.jd.com/assets/fonts/JDLANGZHENGTI-L--GBK1-0.woff') format('woff');
  22. font-weight: 300;
  23. font-style: normal;
  24. }
  25.  
  26. @font-face {
  27. font-family: 'JingDongLangZhengTi';
  28. src: url('https://jdrdl.jd.com/assets/fonts/JDLANGZHENGTI-R--GBK1-0.woff2') format('woff2'),
  29. url('https://jdrdl.jd.com/assets/fonts/JDLANGZHENGTI-R--GBK1-0.woff') format('woff');
  30. font-weight: normal;
  31. font-style: normal;
  32. }
  33.  
  34. @font-face {
  35. font-family: 'JingDongLangZhengTi';
  36. src: url('https://jdrdl.jd.com/assets/fonts/JDLANGZHENGTI-SB--GBK1-0.woff2') format('woff2'),
  37. url('https://jdrdl.jd.com/assets/fonts/JDLANGZHENGTI-SB--GBK1-0.woff') format('woff');
  38. font-weight: 600;
  39. font-style: normal;
  40. }
  41.  
  42. @font-face {
  43. font-family: 'JingDongLangZhengTi';
  44. src: url('https://jdrdl.jd.com/assets/fonts/JDLANGZHENGTI-B--GBK1-0.woff2') format('woff2'),
  45. url('https://jdrdl.jd.com/assets/fonts/JDLANGZHENGTI-B--GBK1-0.woff') format('woff');
  46. font-weight: bold;
  47. font-style: normal;
  48. }
  49. * {
  50. font-family: 'JingDongLangZhengTi' !important;
  51. }
  52. `;
  53. // 将 <style> 元素添加到页面的 <head> 部分
  54. document.head.appendChild(css);
  55. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址