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

@font-face issue #506

Closed
leesus opened this Issue Sep 15, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@leesus

leesus commented Sep 15, 2017

Using the Python API, my custom font isn't showing in the PDF. When I try using the command line arguments on Mac, the PDF is output fine, with the font. Minimal example below, hopefully I'm just missing something simple.

CSS

@font-face {
  font-family: MyCustomFont;
  font-style: normal;
  src: url(http://path.to/MyCustomFont.ttf) format('truetype');
}

body {
  font-family: MyCustomFont;
}

Python

font_config = FontConfiguration()
stylesheet = CSS(path_to_my_stylesheet, font_config=font_config)
pdf = HTML(string=my_html_template_string).write_pdf(stylesheets=[stylesheet])

The CSS is output correctly, just the fonts aren't showing up.

@liZe liZe added the bug label Oct 1, 2017

@liZe liZe closed this in 0c27e94 Oct 1, 2017

@liZe

This comment has been minimized.

Show comment
Hide comment
@liZe

liZe Oct 1, 2017

Member

Thanks for taking the time to report this issue.

That was actually a problem in the API, you couldn't use the font_config attribute with render and write_* methods. That's now fixed if you give font_config to write_pdf. I've also updated the tutorial.

Member

liZe commented Oct 1, 2017

Thanks for taking the time to report this issue.

That was actually a problem in the API, you couldn't use the font_config attribute with render and write_* methods. That's now fixed if you give font_config to write_pdf. I've also updated the tutorial.

@liZe liZe added this to the v0.41 milestone Oct 1, 2017

@liZe liZe self-assigned this Oct 1, 2017

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Oct 9, 2017

kleink
py-weasyprint: update to 0.41.
Version 0.41
------------

Released on 2017-10-05.

WeasyPrint now depends on pdfrw >= 0.4.

New features:

* `#471 <https://github.com/Kozea/WeasyPrint/issues/471>`_:
  Support page marks and bleed.

Bug fixes:

* `#513 <https://github.com/Kozea/WeasyPrint/issues/513>`_:
  Don't crash on unsupported image-resolution values.
* `#506 <https://github.com/Kozea/WeasyPrint/issues/506>`_:
  Fix @font-face use with write_* methods.
* `#500 <https://github.com/Kozea/WeasyPrint/pull/500>`_:
  Improve readability of _select_source function.
* `#498 <https://github.com/Kozea/WeasyPrint/issues/498>`_:
  Use CSS prefixes as recommanded by the CSSWG.
* `#441 <https://github.com/Kozea/WeasyPrint/issues/441>`_:
  Fix rendering problems and crashes when using @font-face.
* `bb3a4db <https://github.com/Kozea/WeasyPrint/commit/bb3a4db>`_:
  Try to break pages after a block before trying to break inside it.
* `1d1654c <https://github.com/Kozea/WeasyPrint/commit/1d1654c>`_:
  Fix and test corner cases about named pages.

Documentation:

* `#508 <https://github.com/Kozea/WeasyPrint/pull/508>`_:
  Add missing libpangocairo dependency for Debian and Ubuntu.
* `a7b17fb <https://github.com/Kozea/WeasyPrint/commit/a7b17fb>`_:
  Add documentation on logged rendering steps.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Oct 22, 2017

kleink
py-weasyprint: update to 0.41.
Version 0.41
------------

Released on 2017-10-05.

WeasyPrint now depends on pdfrw >= 0.4.

New features:

* `#471 <https://github.com/Kozea/WeasyPrint/issues/471>`_:
  Support page marks and bleed.

Bug fixes:

* `#513 <https://github.com/Kozea/WeasyPrint/issues/513>`_:
  Don't crash on unsupported image-resolution values.
* `#506 <https://github.com/Kozea/WeasyPrint/issues/506>`_:
  Fix @font-face use with write_* methods.
* `#500 <https://github.com/Kozea/WeasyPrint/pull/500>`_:
  Improve readability of _select_source function.
* `#498 <https://github.com/Kozea/WeasyPrint/issues/498>`_:
  Use CSS prefixes as recommanded by the CSSWG.
* `#441 <https://github.com/Kozea/WeasyPrint/issues/441>`_:
  Fix rendering problems and crashes when using @font-face.
* `bb3a4db <https://github.com/Kozea/WeasyPrint/commit/bb3a4db>`_:
  Try to break pages after a block before trying to break inside it.
* `1d1654c <https://github.com/Kozea/WeasyPrint/commit/1d1654c>`_:
  Fix and test corner cases about named pages.

Documentation:

* `#508 <https://github.com/Kozea/WeasyPrint/pull/508>`_:
  Add missing libpangocairo dependency for Debian and Ubuntu.
* `a7b17fb <https://github.com/Kozea/WeasyPrint/commit/a7b17fb>`_:
  Add documentation on logged rendering steps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment