目前把 Linux 当主力了,很多动漫字幕文件都会使用一些奇奇怪怪的字体,要怎么把它们给批量安装 / 删除呢?
字体懒的一个个找,我有字体库但体量几十 G 了所以打算在需要的时候批量载入不用了就一起卸载。
例如下面这段:
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,楷体,25,&H00FFFFFF,&HF0000000,&H00000000,&HF0000000,-1,0,0,0,100,100,0,0,1,1,0,2,30,30,10,134
Style: cokuhaku-screen1,@萝莉体 第二版,45,&H009E9A9C,&H000000FF,&H00F8F8FA,&H00000000,0,0,0,0,100,100,20,0,1,0,0,2,10,10,10,1
Style: cokuhaku-screen2,方正卡通_GBK,150,&H00000000,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,0,1,2,10,10,10,1
Style: cokuhaku-title,Aa 弯弯,110,&H009E9A9C,&H000000FF,&H00F8F8FA,&H00000000,-1,0,0,0,100,100,2,0,1,0,0,2,10,10,10,1
Style: cokuhaku-title2,浪漫雅圆,40,&H009D78E6,&H000000FF,&H00F8F8FA,&H00000000,-1,0,0,0,100,100,25,0,1,0,0,2,10,10,10,1
Style: cokuhaku-text,思源黑体 CN Bold,85,&H00FFFFFF,&H000000FF,&H007C40E1,&H009D78E6,0,0,0,0,100,100,0,0,1,4,1,2,10,10,10,1
Style: cokuhaku-tips,新蒂黑板报底字,95,&H00FFFFFF,&H000000FF,&H007C40E1,&H00000000,-1,0,0,0,100,100,0,0,1,3,0,2,10,10,10,1
Style: cokuhaku-staff,萝莉体 第二版,60,&H009D78E6,&H000000FF,&H009D78E6,&H00000000,-1,0,0,0,100,100,0,0,1,0,0,2,10,10,10,1
Style: effect2_ch,思源宋体 CN Heavy,60,&H00FFFFFF,&H000000FF,&H00B6A1FD,&H00000000,-1,0,0,0,100,100,0,0,1,2.5,0,7,30,15,30,1
Style: effect2_jp,DFGMinchoP-W5,45,&H00FFFFFF,&H000000FF,&H00B6A1FD,&H00000000,-1,0,0,0,100,100,3,0,1,2.5,0,7,30,15,30,1
Style: effect2_jp2,DFGMinchoP-W5,45,&H00FFFFFF,&H000000FF,&H00B6A1FD,&H00000000,-1,0,0,0,100,100,3,0,1,2.5,0,2,30,15,30,1
Style: test2,方正稚艺_GBK,55,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,-1,0,0,0,100,100,0,0,1,0,0,2,10,10,10,1
Style: test1,DFCraftYu-W7,60,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,0,0,2,10,10,10,1
Style: test3,DFCraftYu-W7,60,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,0,0,2,10,10,10,1
Style: test4,Arial,20,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,2,2,2,10,10,10,1
Style: test5,Arial,60,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,2,2,2,10,10,10,1
Style: effect1_jp,田氏細筆刷体繁,50,&H00FFFFFF,&H000000FF,&H00B6A1FD,&H00000000,-1,0,0,0,100,100,0,0,1,2.5,0,2,10,10,15,1
Style: effect1_ch,华康少女文字 W5,50,&H00FFFFFF,&H000000FF,&H00B6A1FD,&H00000000,0,0,0,0,100,100,0,0,1,2.5,0,8,10,10,10,1
Style: dogfood_4_jp,DFFuun-W7,50,&H00B9B9FF,&H000000FF,&H00B9B9FF,&H00000000,-1,0,0,0,100,100,0,0,1,0,0,7,10,10,10,1
Style: dogfood_4_ch,方正少儿_GBK,65,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,0,0,7,10,10,70,1
Style: dogfood_5_ch,方正卡通_GBK,60,&H00FFFFFF,&H000000FF,&H00000000,&H00FFFFFF,-1,0,0,0,100,100,0,0,1,0,2,7,10,10,65,1
Style: dogfood_5_jp,DFBrushRD-W7,45,&H00FFFFFF,&H000000FF,&H00000000,&H00FFFFFF,0,0,0,0,100,100,0,0,1,0,2,7,10,10,10,1
Style: dogfood_6_jp,DFCraftYu-W7,70,&H00280801,&H000000FF,&H00F2F5DC,&H00000000,0,0,0,0,100,100,0,0,1,2,0,1,10,10,10,1
Style: dogfood_6_jp_r,DFCraftYu-W7,70,&H00280801,&H000000FF,&H00F2F5DC,&H00000000,0,0,0,0,100,100,0,0,1,2,0,1,10,10,10,1
Style: dogfood_6_ch,方正稚艺_GBK,70,&H00280801,&H000000FF,&H00F2F5DC,&H00000000,-1,0,0,0,100,100,0,0,1,2,0,7,10,10,10,1
Style: dogfood_6_ch_r,方正稚艺_GBK,70,&H00280801,&H000000FF,&H00F2F5DC,&H00000000,-1,0,0,0,100,100,0,0,1,2,0,7,10,10,10,1
1
adoal 340 天前
Linux 下不是/usr/local/share/fonts 下面建个子目录把字体扔进去就行了?
|
4
icyalala 340 天前
@adoal 字幕作者有时候为了贴合某个画面中的原本的字体风格,会选择一些风格类似的小众中文字体,这样每一个视频需要的字体可能都不一样。动画字幕这种风气尤甚。
我觉得既然用 linux 了,就手动搞搞吧,拿 libass 自己写个小工具,锻炼一下自己。 |
5
mxalbert1996 340 天前 via Android
如果你用的是 mpv ,你可以直接用 --sub-fonts-dir 指定用于字幕的字体目录,不用安装。
|
6
sky96111 340 天前
字体文件复制到 /usr/local/share/fonts/ 或者 ~/.local/share/fonts/
你想批量安装批量卸载就再套子文件夹,干净一点。不要觉得这不优雅,这就是安装字体的唯一做法。 你想要“按需加载”,可以理解为你不想安装字体,那应该参考 #5 的方案从播放器入手 |
7
everyx 339 天前
有三种方法:
1. 用的时候软链接到用户目录 `~/.local/share/fonts/` ,不用的时候删除 2. 编辑使用 fontconfig 来管理需要屏蔽哪些字体 3. 使用 [fontmanager.]( http://fontmanager.github.io/) 这类的 GUI 工具管理 |
8
zuotun OP @icyalala 我去试试,虽然基本没学过 C
@mxalbert1996 主要用 VLC ,问过 GPT 没得到结果。不过也可以换着用。 @sky96111 我知道字体是这样安装的,但是一股脑地丢过去实在太多了,我觉得会造成系统卡顿之类的。哪怕扫个目录也得几秒了 @everyx 这个好,虽然不太适合这个用途但总有用的 谢谢大家,问题算是解决了,剩下的我自己折腾。 |
9
kkocdko 339 天前
只用同一个字体即可。ass 就是个 xml ,扫一下把字体信息都删掉就行,全都用系统默认 noto sans cjk 。
|
10
kkocdko 339 天前
记错了不是 xml ,抱歉抱歉(
|
11
qilme 338 天前
https://github.com/yzwduck/FontLoaderSub
这个是 op 想要的吗 |