Skip to content

Fully embedded font is extracted only partially if it occupies more than one objects #2111

Discussion options

You must be logged in to vote

I can confirm that the change in main.py

--- ./fitz/__main__.py.orig     2022-11-07 19:21:52.000000000 +0100
+++ ./fitz/__main__.py  2022-12-08 19:53:12.000000000 +0100
@@ -512,7 +512,7 @@
                     if ext == "n/a" or not buffer:
                         continue
                     outname = os.path.join(
-                        out_dir, fontname.replace(" ", "-") + "." + ext
+                        out_dir, f"{fontname.replace(' ', '-')}-{xref}.{ext}"
                     )
                     outfile = open(outname, "wb")
                     outfile.write(buffer)

solves the problem of overwriting previously extracted font files, since now each font filename contains a …

Replies: 11 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@JorjMcKie
Comment options

Comment options

You must be logged in to vote
2 replies
@JorjMcKie
Comment options

@JorjMcKie
Comment options

Comment options

You must be logged in to vote
3 replies
@JorjMcKie
Comment options

@JorjMcKie
Comment options

@sedimentation-fault
Comment options

Comment options

You must be logged in to vote
2 replies
@JorjMcKie
Comment options

@sedimentation-fault
Comment options

Answer selected by sedimentation-fault
Comment options

You must be logged in to vote
1 reply
@JorjMcKie
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
not a bug not a bug / user error / unable to reproduce
2 participants
Converted from issue

This discussion was converted from issue #2110 on December 08, 2022 20:32.