Skip to content

Commit 2308a91

Browse files
committed
Some provisional definitions
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.
1 parent 902e92c commit 2308a91

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13507,6 +13507,7 @@ def width(self):
1350713507
TEXT_COLLECT_VECTORS = 1024
1350813508
TEXT_IGNORE_ACTUALTEXT = 2048
1350913509
TEXT_STEXT_SEGMENT = 4096
13510+
TEXT_COLLECT_FLAGS = 32768 # mupdf.FZ_STEXT_COLLECT_FLAGS
1351013511

1351113512
TEXTFLAGS_WORDS = (0
1351213513
| TEXT_PRESERVE_LIGATURES

src/extra.i

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3125,7 +3125,7 @@ mupdf::FzRect JM_make_spanlist(
31253125
DICT_SETITEMSTR_DROP(span, "opacity", Py_BuildValue("f", style.opacity));
31263126
#endif
31273127

3128-
// rest of keys only make sense if FZ_STEXT_COLLECT_FLAGS was set
3128+
// rest of keys only make sense if FZ_STEXT_COLLECT_FLAGS (32768) was set
31293129
#if (THIS_MUPDF >= MUPDF1250)
31303130
if (dev_flags & 32768)
31313131
{
@@ -3139,9 +3139,9 @@ mupdf::FzRect JM_make_spanlist(
31393139
}
31403140
#endif
31413141
#if (THIS_MUPDF > MUPDF1251)
3142-
if (dev_flags & FZ_STEXT_COLLECT_FLAGS)
3142+
if (dev_flags & 32768) // FZ_STEXT_COLLECT_FLAGS = 32768
31433143
{
3144-
DICT_SETITEMSTR_DROP(span, "bold", JM_BOOL(style.flags & FZ_STEXT_BOLD));
3144+
DICT_SETITEMSTR_DROP(span, "bold", JM_BOOL(style.flags & 8)); // FZ_STEXT_BOLD = 8
31453145
}
31463146
else
31473147
{

0 commit comments

Comments
 (0)