Skip to content

Instantly share code, notes, and snippets.

@ngseke
Last active January 16, 2024 09:17
Show Gist options
  • Save ngseke/8b30050e05703f35c753cd0ac6330028 to your computer and use it in GitHub Desktop.
Save ngseke/8b30050e05703f35c753cd0ac6330028 to your computer and use it in GitHub Desktop.
把 YouTube CC 字幕變成粉圓體 `jf-openhuninn-2.0`
// ==UserScript==
// @name Customize YouTube Caption Font
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 把 YouTube CC 字幕變成粉圓體 `jf-openhuninn-2.0`(裝置內必須提前安裝此字體)
// @author You
// @match https://www.youtube.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==/UserScript==
(function () {
const fontFamily = '"jf-openhuninn-2.0"'
const css = `
.ytp-caption-segment {
font-family: ${fontFamily} !important;
}
.caption-visual-line {
user-select: all;
}
`
const style = document.createElement('style')
document.head.appendChild(style)
style.type = 'text/css'
style.appendChild(document.createTextNode(css))
})()
@ngseke
Copy link
Author

ngseke commented Aug 14, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment