Skip to content

Commit

Permalink
fix pylint alarms
Browse files Browse the repository at this point in the history
  • Loading branch information
andersonhc committed Jun 16, 2023
1 parent df321a1 commit 9701b32
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions fpdf/fonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,6 @@ def shaped_text_width(self, text, font_size_pt):
text_width += pos.x_advance + pos.x_offset
return (len(glyph_positions), text_width)

# Disabling this check - looks like cython confuses pylint:
# pylint: disable=no-member
def perform_harfbuzz_shaping(self, text, font_size_pt):
if not hasattr(self, "hbfont"):
self.hbfont = hb.Font(hb.Face(hb.Blob.from_file_path(self.ttffile)))
Expand Down
4 changes: 2 additions & 2 deletions fpdf/line_break.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ def render_pdf_text(
if self.is_ttf_font:
if self._text_shaping:
return self.render_with_text_shaping(adjust_x, adjust_y, fpdf)
return self.render_pdf_text(frag_ws, word_spacing)
return self.render_pdf_text_ttf(frag_ws, word_spacing)
return self.render_pdf_text_core(frag_ws, current_ws)

def render_pdf_text(self, frag_ws, word_spacing):
def render_pdf_text_ttf(self, frag_ws, word_spacing):
ret = ""
mapped_text = ""
for char in self.string:
Expand Down
1 change: 0 additions & 1 deletion fpdf/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,6 @@ def _add_fonts(self):
# character that each used 16-bit code belongs to. It
# allows searching the file and copying text from it.
bfChar = []
uni_to_new_code_char = font.subset.dict()

def format_code(unicode):
if unicode > 0xFFFF:
Expand Down
3 changes: 2 additions & 1 deletion test/fonts/test_font_remap.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from pathlib import Path

from fpdf import FPDF
from fpdf.fonts import SubsetMap

# from fpdf.fonts import SubsetMap
from test.conftest import assert_pdf_equal

HERE = Path(__file__).resolve().parent
Expand Down

0 comments on commit 9701b32

Please sign in to comment.