(line_dict, line, raw, buff, tp_rect)
| 20496 | |
| 20497 | |
| 20498 | def JM_make_spanlist(line_dict, line, raw, buff, tp_rect): |
| 20499 | if 1 or g_use_extra: |
| 20500 | return extra.JM_make_spanlist(line_dict, line, raw, buff, tp_rect) |
| 20501 | char_list = None |
| 20502 | span_list = [] |
| 20503 | mupdf.fz_clear_buffer(buff) |
| 20504 | span_rect = mupdf.FzRect(mupdf.FzRect.Fixed_EMPTY) |
| 20505 | line_rect = mupdf.FzRect(mupdf.FzRect.Fixed_EMPTY) |
| 20506 | |
| 20507 | class char_style: |
| 20508 | def __init__(self, rhs=None): |
| 20509 | if rhs: |
| 20510 | self.size = rhs.size |
| 20511 | self.flags = rhs.flags |
| 20512 | self.char_flags = rhs.char_flags |
| 20513 | self.font = rhs.font |
| 20514 | self.argb = rhs.argb |
| 20515 | self.asc = rhs.asc |
| 20516 | self.desc = rhs.desc |
| 20517 | self.bidi = rhs.bidi |
| 20518 | else: |
| 20519 | self.size = -1 |
| 20520 | self.flags = -1 |
| 20521 | self.char_flags = -1 |
| 20522 | self.font = '' |
| 20523 | self.argb = -1 |
| 20524 | self.asc = 0 |
| 20525 | self.desc = 0 |
| 20526 | self.bidi = 0 |
| 20527 | def __str__(self): |
| 20528 | ret = f'{self.size} {self.flags}' |
| 20529 | ret += f' {self.char_flags}' |
| 20530 | ret += f' {self.font} {self.color} {self.asc} {self.desc}' |
| 20531 | return ret |
| 20532 | |
| 20533 | old_style = char_style() |
| 20534 | style = char_style() |
| 20535 | span = None |
| 20536 | span_origin = None |
| 20537 | |
| 20538 | for ch in line: |
| 20539 | # start-trace |
| 20540 | r = JM_char_bbox(line, ch) |
| 20541 | if (not JM_rects_overlap(tp_rect, r) |
| 20542 | and not mupdf.fz_is_infinite_rect(tp_rect) |
| 20543 | ): |
| 20544 | continue |
| 20545 | |
| 20546 | # Info from: |
| 20547 | # detect_super_script() |
| 20548 | # fz_font_is_italic() |
| 20549 | # fz_font_is_serif() |
| 20550 | # fz_font_is_monospaced() |
| 20551 | # fz_font_is_bold() |
| 20552 | |
| 20553 | flags = JM_char_font_flags(mupdf.FzFont(mupdf.ll_fz_keep_font(ch.m_internal.font)), line, ch) |
| 20554 | origin = mupdf.FzPoint(ch.m_internal.origin) |
| 20555 | style.size = ch.m_internal.size |
no test coverage detected
searching dependent graphs…