-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting the default font sometimes fails #122
Comments
oof, fontconfig stuff I imagine that it's probably something related to fontconfig 2.13, since that's been... buggy, at times. |
@PandorasFox yes, it actually did turn out to be an annoying font config issues lmao. After some investigation it turns out it the problem is fc-match having very liberal matching and will return things that even partially match. I'm honestly not sure how to get around that. I have "Noto Sans" set as my default font, but fc-match returns "Noto Sans Adlam" as the first match, rather than an exact match. |
I have a similar problem.
Running the subsequent command with only one of these is fine:
But the original command, where both values are used, remains empty.
It essentially tries all comma-separated font families that Here's a patch, should I open a PR for it? diff --git a/i3lock-fancy b/i3lock-fancy
index d35b977..36cc583 100755
--- a/i3lock-fancy
+++ b/i3lock-fancy
@@ -6,7 +6,7 @@ set -o errexit -o noclobber -o nounset
hue=(-level "0%,100%,0.6")
effect=(-filter Gaussian -resize 20% -define "filter:sigma=1.5" -resize 500.5%)
# default system sans-serif font
-font=$(convert -list font | awk "{ a[NR] = \$2 } /family: $(fc-match sans -f "%{family}\n")/ { print a[NR-1]; exit }")
+font=$(fc-match sans -f "%{family}\n" | tr ',' '\n' | while read fontLine; do convert -list font | awk "{ a[NR] = \$2 } /family: $fontLine/ { print a[NR-1]; exit }"; done | head -n1)
image=$(mktemp --suffix=.png)
shot=(import -silent -window root)
desktop=""
@@ -22,7 +22,7 @@ options="Options:
-p, --pixelate Pixelate the background instead of blur, runs faster.
- -f <fontname>, --font <fontname> Set a custom font.
+ -f <fontname>, --font <fontname> Set a custom font. (Default: ${font})
-t <text>, --text <text> Set a custom text prompt. |
I just noticed that this is a different problem than the original one. |
Oh my system I have Noto Sans Regular as my default. However when I run this:
I get "Noto-Sans-Adlam-Regular" which is incorrect. It should be "Noto-Sans-Regular"
The bug in the awk script needs to get figured out.
The text was updated successfully, but these errors were encountered: