Skip to content

Commit

Permalink
Rebase tests with new fonttools (#863)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tolker-KU committed Jul 25, 2023
1 parent beb40d4 commit f2fe807
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 0 deletions.
Binary file modified test/encryption/encrypt_fonts.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions test/encryption/test_encryption.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# pylint: disable=protected-access
from pathlib import Path
import sys

import pytest

from fpdf import FPDF
from fpdf.enums import AccessPermission, EncryptionMethod
Expand Down Expand Up @@ -152,6 +155,10 @@ def custom_file_id():
assert_pdf_equal(pdf, HERE / "encrypt_metadata.pdf", tmp_path)


@pytest.mark.skipif(
sys.version_info < (3, 8),
reason="fontTools dropped support for 3.7. https://github.com/PyFPDF/fpdf2/pull/863",
)
def test_encrypt_font(tmp_path):
pdf = FPDF()
pdf.add_page()
Expand Down
Binary file modified test/fonts/charmap_first_999_chars-Quicksand-Regular.pdf
Binary file not shown.
Binary file modified test/fonts/fallback_font_with_overriden_get_fallback_font.pdf
Binary file not shown.
Binary file modified test/fonts/fonts_otf.pdf
Binary file not shown.
5 changes: 5 additions & 0 deletions test/fonts/test_add_font.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from os import devnull
from pathlib import Path
import sys

import pytest

Expand Down Expand Up @@ -92,6 +93,10 @@ def test_render_en_dash(tmp_path): # issue-166
assert_pdf_equal(pdf, HERE / "render_en_dash.pdf", tmp_path)


@pytest.mark.skipif(
sys.version_info < (3, 8),
reason="fontTools dropped support for 3.7. https://github.com/PyFPDF/fpdf2/pull/863",
)
def test_add_font_otf(tmp_path):
pdf = FPDF()
pdf.add_page()
Expand Down
5 changes: 5 additions & 0 deletions test/fonts/test_charmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""
import logging
from pathlib import Path
import sys

from fontTools.ttLib import TTFont
import pytest
Expand All @@ -21,6 +22,10 @@
HERE = Path(__file__).resolve().parent


@pytest.mark.skipif(
sys.version_info < (3, 8),
reason="fontTools dropped support for 3.7. https://github.com/PyFPDF/fpdf2/pull/863",
)
@pytest.mark.parametrize(
"font_filename",
[
Expand Down
5 changes: 5 additions & 0 deletions test/fonts/test_font_fallback.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from os import devnull
from pathlib import Path
import sys

from fpdf import FPDF
from fpdf.enums import XPos, YPos
Expand Down Expand Up @@ -124,6 +125,10 @@ def test_fallback_font_ignore_style(tmp_path):
)


@pytest.mark.skipif(
sys.version_info < (3, 8),
reason="fontTools dropped support for 3.7. https://github.com/PyFPDF/fpdf2/pull/863",
)
def test_fallback_font_with_overriden_get_fallback_font(tmp_path):
class PDF(FPDF):
def get_fallback_font(self, char, style=""):
Expand Down

0 comments on commit f2fe807

Please sign in to comment.