font-family noto android test

test only

  1. // ==UserScript==
  2. // @name font-family noto android test
  3. // @description test only
  4. // @namespace font_android_test
  5. // @author Covenant
  6. // @version 1.0.3.7
  7. // @license MIT
  8. // @homepage
  9. // @match *://*/*
  10. // @exclude https://fonts.google.com/*
  11. // @icon data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxNnYxNkgweiIvPjxwYXRoIGZpbGw9IiNGMjk5MDAiIGQ9Ik0xMy41IDJIOEwxIDEzaDUuNXoiLz48cGF0aCBmaWxsPSIjMUE3M0U4IiBkPSJNOCAyaDV2MTFIOHoiLz48Y2lyY2xlIGZpbGw9IiNFQTQzMzUiIGN4PSIzLjI1IiBjeT0iNC4yNSIgcj0iMi4yNSIvPjxwYXRoIGZpbGw9IiMwRDY1MkQiIGQ9Ik0xMy4zMyAxMEwxMyAxM2MtMS42NiAwLTMtMS4zNC0zLTNzMS4zNC0zIDMtM2wuMzMgM3oiLz48cGF0aCBmaWxsPSIjMTc0RUE2IiBkPSJNMTAuNSA0LjVBMi41IDIuNSAwIDAxMTMgMmwuNDUgMi41TDEzIDdhMi41IDIuNSAwIDAxLTIuNS0yLjV6Ii8+PHBhdGggZmlsbD0iIzFBNzNFOCIgZD0iTTEzIDJhMi41IDIuNSAwIDAxMCA1Ii8+PHBhdGggZmlsbD0iIzM0QTg1MyIgZD0iTTEzIDdjMS42NiAwIDMgMS4zNCAzIDNzLTEuMzQgMy0zIDMiLz48L3N2Zz4K
  12. // @grant GM_setValue
  13. // @grant GM_getValue
  14. // @grant GM_registerMenuCommand
  15. // @connect
  16. // @run-at document-end
  17. // @noframes
  18. // ==/UserScript==
  19. var style;
  20. var ary_noto_test=[["sans-serif","sans-serif"],
  21. ["serif","serif"],
  22. ["monospace","monospace"],
  23. ["serif-monospace","serif-monospace"],
  24. ["sans-serif,serif,'old_emoji'","sans-serif,serif,'old_emoji'"],
  25. ["serif,'old_emoji'","serif,'old_emoji'"],
  26. ["monospace,serif,'old_emoji'","monospace,serif,'old_emoji'"],
  27. ["serif-monospace,serif,'old_emoji'","serif-monospace,serif,'old_emoji'"],
  28. /*["VT323 N","'VT323','Noto Color Emoji','Noto Sans Symbols 2','NotDef'"],
  29. ["Yomogi N","'Yomogi','Noto Color Emoji','Noto Sans Symbols 2','NotDef'"]*/];
  30. function create_style(innerText,class_name){
  31. var style=document.createElement("style");
  32. if(typeof class_name==='string'){style.classList.add(class_name);}
  33. else{
  34. for(let i=0; i<class_name.length; i++){style.classList.add(class_name[i]);}
  35. }
  36. style.textContent=innerText;
  37. document.body.appendChild(style);
  38. return style;
  39. }
  40. function css_update(fontFamily){
  41. console.log(style);
  42. style.textContent='.user_font_test{font-family: '+fontFamily+';font-weight: 400;}';
  43. }
  44. function font(apply_all){
  45. var node=document.body.querySelectorAll('*');
  46. for(let n = 0; n < node.length; n++){
  47. if(!node[n].classList.contains('user-panel-font')&&node[n].tagName!='style'){
  48. if(apply_all||node[n].style.fontFamily==''){
  49. node[n].classList.add("user_font_test");
  50. }
  51. }
  52. }
  53. console.log("font "+apply_all);
  54. }
  55. function main_01(){
  56. }
  57. (function() {
  58. 'use strict';
  59. for(let i = 0; i < ary_noto_test.length; i++){
  60. GM_registerMenuCommand('▶'+ary_noto_test[i][0], () => {
  61. css_update(ary_noto_test[i][1]);
  62. font(false);
  63. window.setTimeout(( () => alert(ary_noto_test[i][0]) ), 1000);
  64. });
  65. }
  66. style=create_style(".user_font_test{font-family: ;font-weight: 100;}",'user_css_font_noto_test');
  67. var style_font_face=create_style("@font-face{font-family: 'NotDef';src: url('https://raw.githubusercontent.com/adobe-fonts/adobe-notdef/master/AND-Regular.otf');}\n",'user_css_font_face');
  68. style_font_face.textContent+="@font-face{font-family: 'old_emoji';src: local('Noto Color Emoji');}\n";
  69. //window.setTimeout(( () => main_01() ), 1000);
  70. })();