Skip to content

Commit

Permalink
change fmt to font_format
Browse files Browse the repository at this point in the history
  • Loading branch information
mtd91429 committed Jul 13, 2022
1 parent 13b9cdc commit c7ed347
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PyPDF2/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1894,7 +1894,7 @@ def color(self) -> Optional[tuple]:
return self.get("/C", [FloatObject(0), FloatObject(0), FloatObject(0)])

@property
def fmt(self) -> Optional[OutlineFontFlag]:
def font_format(self) -> Optional[OutlineFontFlag]:
"""Read-only property accessing the font type. 1=italic, 2=bold, 3=both"""
return self.get("/F", 0)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,8 +867,8 @@ def test_outline_color():
assert reader.outlines[0].color == [0, 0, 1]


def test_outline_fmt():
def test_outline_font_format():
url = "https://corpora.tika.apache.org/base/docs/govdocs1/924/924546.pdf"
name = "tika-924546.pdf"
reader = PdfReader(BytesIO(get_pdf_from_url(url, name=name)))
assert reader.outlines[0].fmt == 2
assert reader.outlines[0].font_format == 2

0 comments on commit c7ed347

Please sign in to comment.