MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / row_has_bold

Method row_has_bold

src/table.py:1742–1756  ·  view source on GitHub ↗

Check if a row contains some bold text. If e.g. true for the top row, then it will be used as (internal) column header row if any of the following is true: * the previous (above) text line has no bold span * the second table row text has no bold span

(bbox)

Source from the content-addressed store, hash-verified

1740 return False
1741
1742 def row_has_bold(bbox):
1743 """Check if a row contains some bold text.
1744
1745 If e.g. true for the top row, then it will be used as (internal)
1746 column header row if any of the following is true:
1747 * the previous (above) text line has no bold span
1748 * the second table row text has no bold span
1749
1750 Returns True if any spans are bold else False.
1751 """
1752 return any(
1753 c["bold"]
1754 for c in CHARS
1755 if rect_in_rect((c["x0"], c["y0"], c["x1"], c["y1"]), bbox)
1756 )
1757
1758 try:
1759 row = self.rows[0]

Callers

nothing calls this directly

Calls 1

rect_in_rectFunction · 0.85

Tested by

no test coverage detected