[2.5.2] Fix fontSize not reflecting in exported PDF

This commit is contained in:
Amruth Pillai
2021-01-07 09:35:31 +05:30
parent c40d89e98e
commit 98aef7eb77
4 changed files with 28 additions and 18 deletions

View File

@ -12,6 +12,8 @@ import Onyx from '../../templates/Onyx';
import Pikachu from '../../templates/Pikachu';
import styles from './view.module.css';
import Celebi from '../../templates/Celebi';
import fontSizeOptions from '../../data/fontSizeOptions';
import { scaler } from '../../utils';
const ResumeViewer = ({ id }) => {
const { t, i18n } = useTranslation();
@ -33,6 +35,14 @@ const ResumeViewer = ({ id }) => {
setResume(data);
i18n.changeLanguage(data.metadata.language || 'en');
for (const [key, sizeDefault] of Object.entries(fontSizeOptions)) {
document.documentElement.style.setProperty(
key,
`${scaler(data.metadata.fontSize) * sizeDefault}rem`,
);
}
return setLoading(false);
})();
}, [id]);