Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import textDecoration from '@react-pdf/textkit/engines/textDecoration';
import scriptItemizer from '@react-pdf/textkit/engines/scriptItemizer';
import wordHyphenation from '@react-pdf/textkit/engines/wordHyphenation';
import fontSubstitution from './fontSubstitution';
const engines = {
linebreaker,
justification,
textDecoration,
scriptItemizer,
wordHyphenation,
fontSubstitution,
};
const engine = layoutEngine(engines);
export default engine;
import Font from '../font';
import transformText from '../text/transformText';
import isTextInstance from '../node/isTextInstance';
import fontSubstitution from '../text/fontSubstitution';
const engines = {
linebreaker,
justification,
textDecoration,
scriptItemizer,
wordHyphenation,
fontSubstitution,
};
const engine = layoutEngine(engines);
const layoutOptions = {
hyphenationCallback: Font.getHyphenationCallback(),
shrinkWhitespaceFactor: { before: -0.5, after: -0.5 },
};
const getFragments = instance => {
if (!instance) return [{ string: '' }];
const fragments = [];
const {
fill = 'black',
fontFamily = 'Helvetica',
fontWeight,
fontStyle,