Skip to content

Commit

Permalink
Some provisional definitions
Browse files Browse the repository at this point in the history
To cope with upcoming features of MuPDF we make a few provisional definitions for flags that will be introduced then.
This will avoid complex version checks in our code.
  • Loading branch information
JorjMcKie committed Dec 12, 2024
1 parent 902e92c commit 2308a91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13507,6 +13507,7 @@ def width(self):
TEXT_COLLECT_VECTORS = 1024
TEXT_IGNORE_ACTUALTEXT = 2048
TEXT_STEXT_SEGMENT = 4096
TEXT_COLLECT_FLAGS = 32768 # mupdf.FZ_STEXT_COLLECT_FLAGS

TEXTFLAGS_WORDS = (0
| TEXT_PRESERVE_LIGATURES
Expand Down
6 changes: 3 additions & 3 deletions src/extra.i
Original file line number Diff line number Diff line change
Expand Up @@ -3125,7 +3125,7 @@ mupdf::FzRect JM_make_spanlist(
DICT_SETITEMSTR_DROP(span, "opacity", Py_BuildValue("f", style.opacity));
#endif

// rest of keys only make sense if FZ_STEXT_COLLECT_FLAGS was set
// rest of keys only make sense if FZ_STEXT_COLLECT_FLAGS (32768) was set
#if (THIS_MUPDF >= MUPDF1250)
if (dev_flags & 32768)
{
Expand All @@ -3139,9 +3139,9 @@ mupdf::FzRect JM_make_spanlist(
}
#endif
#if (THIS_MUPDF > MUPDF1251)
if (dev_flags & FZ_STEXT_COLLECT_FLAGS)
if (dev_flags & 32768) // FZ_STEXT_COLLECT_FLAGS = 32768
{
DICT_SETITEMSTR_DROP(span, "bold", JM_BOOL(style.flags & FZ_STEXT_BOLD));
DICT_SETITEMSTR_DROP(span, "bold", JM_BOOL(style.flags & 8)); // FZ_STEXT_BOLD = 8
}
else
{
Expand Down

0 comments on commit 2308a91

Please sign in to comment.