[CR] Fix vtt CC fontSize not working

This commit is contained in:
AnimeDL 2024-03-19 11:22:15 -07:00
parent 97d64f6021
commit 1852ce1282
2 changed files with 2 additions and 1 deletions

View file

@ -2026,6 +2026,7 @@ export default class Crunchy implements ServiceClass {
let sBody;
if (subsItem.format == 'vtt') {
const chosenFontSize = options.originalFontSize ? undefined : options.fontSize;
if (!options.originalFontSize) subsAssReq.res.body = subsAssReq.res.body.replace(/( font-size:.+?;)/g, '').replace(/(font-size:.+?;)/g, '');
sBody = vtt2ass(undefined, chosenFontSize, subsAssReq.res.body, '', undefined, options.fontName);
sxData.fonts = fontsData.assFonts(sBody) as Font[];
} else {

View file

@ -69,7 +69,7 @@ function loadCSS(cssStr: string): Css {
function parseStyle(stylegroup: string, line: string, style: any) {
const defaultSFont = rFont == '' ? defaultStyleFont : rFont; //redeclare cause of let
if (stylegroup.startsWith('Subtitle') || stylegroup.startsWith('Song') || stylegroup.startsWith('Q0') || stylegroup.startsWith('Q1')) { //base for dialog, everything else use defaultStyle
if (stylegroup.startsWith('Subtitle') || stylegroup.startsWith('Song') || stylegroup.startsWith('Q0') || stylegroup.startsWith('Q1') || stylegroup.startsWith('Default')) { //base for dialog, everything else use defaultStyle
style = `${defaultSFont},${fontSize},&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,2.6,0,2,20,20,46,1`;
}