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

Rebase tests with new fonttools #863

Merged
merged 4 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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