Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you change font-family? #64

Closed
alinobari opened this issue Mar 27, 2018 · 2 comments
Closed

How do you change font-family? #64

alinobari opened this issue Mar 27, 2018 · 2 comments
Milestone

Comments

@alinobari
Copy link

I have downloaded a new font called "Geomanist-Book" from the file hinted-Geomanist-Book.ttf, yet adding it into the css file that is specified by:

"markdown-pdf.styles": [
    "path/to/your/markdown.css"
]

In the style:

@font-face{font-family:Geomanist-Book; src:url(./hinted-Geomanist-Book.ttf);}
body{font-family: "Geomanist-Book", sans-serif; font-size: 10px;}

and having the .ttf file does not show the new font in the pdf and goes to sans-serif. I can see my new font in the VS Code .md preview though, so I know it is correctly linked and working. Any ideas?

@yzane yzane added this to the 1.0.3 milestone Apr 28, 2018
yzane added a commit that referenced this issue Apr 30, 2018
yzane added a commit that referenced this issue Apr 30, 2018
@yzane
Copy link
Owner

yzane commented Apr 30, 2018

Please upgrade to Markdown PDF ver1.0.3 and try it.

@yzane yzane closed this as completed Apr 30, 2018
@kzhui125
Copy link

kzhui125 commented Dec 1, 2018

@yzane I get a blank pdf file using @font-face

can you help? thanks.

@font-face{font-family:TeXGyreAdventor; src:url(/Users/xx/Documents/texgyreadventor-regular.woff);}
@media print {
  a,body {
    color: #000;
  }

  body {
    background: #fff;
    font-family: "TeXGyreAdventor", sans-serif;
    font-size: 12px;
    font-weight: 300;
    line-height: 1.41;
    /* padding: 0 calc(50% - 50% + 1.2cm); */
    min-width: 0;
  }

  body>* {
    max-width: 100%;
  }

  h1 {
    color: #506d95;
    font-size: 17pt;
    margin-bottom: 16pt;
    margin-top: 16pt;
  }

  h1,h2,h3 {
    font-family: "Fira Sans Extra Condensed","Arial Narrow","HelveticaNeue",sans-serif;
    font-weight: 500;
  }

  h2 {
    color: #737d8c;
    font-size: 14pt;
    margin-bottom: 14pt;
    margin-top: 14pt;
  }

  h3 {
    font-size: 13pt;
    margin-bottom: 8pt;
    margin-top: 8pt;
  }

  h4,table thead {
    font-size: 12pt;
    font-weight: 500;
  }

  h4,h5,h6,table thead {
    font-family: "Fira Sans Extra Condensed","Arial Narrow","HelveticaNeue",sans-serif;
  }

  p {
    line-height: 21px;
    margin-block-start: 0px;
    margin-block-end: 15px;
    margin: 0 0 15px;
    overflow-wrap: break-word;
    text-align: justify;
  }

  ul {
    list-style: square;
  }

  blockquote,h4,ol,p,pre,ul {
    margin-bottom: 6pt;
    margin-top: 6pt;
  }

  ol {
    list-style: decimal;
  }

  blockquote,pre {
    border: solid transparent 1px;
  }

  blockquote {
    font-size: 13pt;
    color: #506d95;
    font-style: italic;
    border-radius: 3px;
    line-height: 1.67;
    padding: 6pt 24pt;
  }

  code,pre {
    font-family: "Fira Mono","Consolas","Monaco",monospace;
    font-size: 10pt;
    background: #eff2f5;
    border-radius: 3px;
  }

  pre {
    line-height: 1.5;
    padding: 12pt;
  }

  hr {
    margin-bottom: 12pt;
    margin-top: 12pt;
  }

  a {
    font-weight: 700;
  }

  code {
    padding: 3pt;
  }

  table {
    margin: 6pt auto;
  }

  table thead {
    border-bottom: solid #506d95 1px;
  }

  table td,table th {
    font-weight: inherit;
    padding: 3pt 6pt;
  }

  dd {
    margin-left: 24pt;
  }

  .left.floated {
    margin-right: 6pt;
  }

  .right.floated {
    margin-left: 6pt;
  }
}

tat3 pushed a commit to tat3/vscode-markdown-pdf-2 that referenced this issue Sep 4, 2022
tat3 pushed a commit to tat3/vscode-markdown-pdf-2 that referenced this issue Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants