unfoldingWord / scripture-resources-rcl

A React Component Library for Rendering Scripture Resources.
https://scripture-resources-rcl.netlify.com/
MIT License
0 stars 8 forks source link

Avoid Hardcoding of Font Family #141

Open mandolyte opened 2 years ago

mandolyte commented 2 years ago

The using app should control the font used by the RCL. Thus this should be a property that is provided by the app.

Currently, it is hard-coded. This is the code in Verse.js:

  const verseText = verseObjects.map(verseObject => verseObject.text).join('');
  const hebrew = isHebrew(verseText);
  let _dir = direction || 'auto';
  if (hebrew) {
    _dir = 'rtl';
  }

  const style = _dir === 'rtl' 
    ? { fontSize: `1.7em`, fontFamily: `EzraSILSRRegular` } 
    : { fontSize: `1em`, fontFamily: `Noto Sans`}  
  //const style = {};
  if (paragraphs) style.display = 'inline';