Skip to content

Commit

Permalink
fix(rules): Fix project-local font directory handling
Browse files Browse the repository at this point in the history
We've been stripping the last segment for no reason (as if the value was
a file and we needed the directory part) but the value is supposed to be
a directory. This works in many cases because of the way fontconfig
traverses directories, but creates priority issues when system paths for
the same fonts have less recursion.
  • Loading branch information
alerque committed Aug 31, 2024
1 parent 43814e9 commit 098ad34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rules/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ PROJECTLUA := $(wildcard $(PROJECT).lua)
LUALIBS +=

# Add a place where project local fonts can live
FONTDIRS ?=
FONTDIRS += $(patsubst ./%,%,$(CASILEDIR)/fonts $(wildcard $(PROJECTDIR:./=.)/.fonts))

FCCONFIG := $(BUILDDIR)/fontconfig.conf
Expand Down Expand Up @@ -508,7 +509,7 @@ $(FCCONFIG): | $(BUILDDIR)
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>$(foreach DIR,$(FONTDIRS),
<dir>$(shell $(_ENV) cd "$(shell $(_ENV) dirname $(DIR))" && pwd)</dir>)
<dir>$(shell $(_ENV) cd "$(DIR)" && pwd)</dir>)
<include ignore_missing="no">$(FCDEFAULT)</include>
</fontconfig>
EOF
Expand Down

0 comments on commit 098ad34

Please sign in to comment.