Skip to content

Commit

Permalink
fix: Ensure correct package name for public fonts.
Browse files Browse the repository at this point in the history
Use re.search, not re.match, to get the correct package name for fonts
in the 'public' dir. re.match only searches for a match at the beginning
of the string, which is _never_ where the '/public/.*/' pattern appears.
  • Loading branch information
badshah400 committed Mar 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 1c47983 commit 113bb52
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tartex/_latex.py
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
INPUT_RE = re.compile(r"^INPUT")
INPUT_STY = re.compile(r"^INPUT\s.*.(cls|def|sty)")
INPUT_FONTS = re.compile(r"^INPUT\s.*.(pfb|tfm)")
FONT_PUBLIC = re.compile(r"\/public\/.*\/")
FONT_PUBLIC = re.compile(r"/public/.*/")


def run_latexmk(filename, mode, compdir):
@@ -102,7 +102,9 @@ def fls_input_files(fls_fileobj, lof_excl, skip_files, *, sty_files=False):
p = Path(line.split()[-1])
if p.is_absolute():
try:
fontdir = FONT_PUBLIC.match(str(p)).split("/")[2]
fontdir = (
FONT_PUBLIC.search(str(p)).group(0).split("/")[2]
)
except AttributeError:
fontdir = p.parent.name
pkgs["System"].add(fontdir)

0 comments on commit 113bb52

Please sign in to comment.