Giter Site home page Giter Site logo

Fonts are ignored in PDF about panwriter HOT 7 CLOSED

Skeeve avatar Skeeve commented on July 20, 2024
Fonts are ignored in PDF

from panwriter.

Comments (7)

mb21 avatar mb21 commented on July 20, 2024

PDF export is using pandoc, which is using LaTeX under the hood. There, not all normally installed fonts are supported. See https://pandoc.org/MANUAL.html#fonts

from panwriter.

Skeeve avatar Skeeve commented on July 20, 2024

Okay. But I have a font which works with pandoc on another machine, but I do not use panwriter there. So what would be the correct syntax to tell pandoc from panwriter where the fontfile resides?

I already tried the full path to the font file but I did not succeed.

from panwriter.

Skeeve avatar Skeeve commented on July 20, 2024

I checked as described here: https://fedidat.com/160-installing-fonts-for-pandoc/

and I can see: My font is installed.

from panwriter.

Skeeve avatar Skeeve commented on July 20, 2024

Update:

pandoc -f markdown --pdf-engine=xelatex --to pdf -o Untitled.pdf Untitled.md

This works with my intended font "Avenir Next"

but when I define in the document or defaults.yaml

papersize: A4
mainfont: Avenir Next
output:
  latex:
    toc: true
    pdf-engine: xelatex

panWriter fails

Called: pandoc --metadata-file '/Users/skeeve/Library/Application Support/PanWriterUserData/default.yaml' --toc --pdf-engine xelatex --metadata 'mainfont=-apple-system, BlinkMacSystemFont, Segoe UI, sans-serif' --metadata monobackgroundcolor=#f0f0f0 --output /Users/skeeve/Desktop/Untitled.pdf --to latex --standalone

Error producing PDF.
! Package fontspec Error: The font "-apple-system, BlinkMacSystemFont, Segoe
(fontspec)                UI, sans-serif" cannot be found.

For immediate help type H <return>.
...                                              

l.24 \fi

from panwriter.

Skeeve avatar Skeeve commented on July 20, 2024

Update: mainfont works if
a) You put it into the document, not in the defaults.yaml
b) You use xelatex as the pdf-engine

from panwriter.

Skeeve avatar Skeeve commented on July 20, 2024

Would, maybe, this solve the issue?

  if (docMeta.mainfont === undefined) {
    out.metadata.mainfont = extMeta.mainfont || '-apple-system, BlinkMacSystemFont, Segoe UI, sans-serif';
  }

Yes, it does. Please see PR #134

from panwriter.

Skeeve avatar Skeeve commented on July 20, 2024

Will be fixed when PR #134 is merged.

from panwriter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.