-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Delay fc-list warning by 5s. #7596
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
Conversation
title says 'min', code looks like it is 's' |
""" | ||
fontext = get_fontext_synonyms(fontext) | ||
return [fname for fname in _call_fc_list() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the return type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a set represented as a {key: 1, key: 1, ...} dict to a list, yes. I can even document this as a API break :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 , please document this. The duck typing of the likely usage is the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like _call_fc_list always returns an empty list
fname = six.text_type(fname, sys.getfilesystemencoding()) | ||
except UnicodeDecodeError: | ||
continue | ||
return fnames |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it will always come out empty.
fixed min->s |
c637d88
to
fec1a93
Compare
``afm.get_fontconfig_fonts`` returns a list of paths and does not check for existence | ||
````````````````````````````````````````````````````````````````````````````````````` | ||
|
||
``afm.get_fontconfig_fonts`` used to return a set of paths encoded as a `{key: 1, ...}` dict, and checked for the existence of the paths. It now returns a list and dropped the existence check, as the same check is performed by the caller (``afm.findSystemFonts``) as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure the backticks are the wrong way here, in that single ticks are references and double are code formatting (or at least the dict one needs to be doubled if the other references are not wanted.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
We do not need to check filename validity in `_call_fc_list` as `findSystemFonts` already does it.
fec1a93
to
823fd95
Compare
Backported to v2.x as 93d09be. |
Alternative for #7532.
This implementation also avoids calling
fc-list
twice.We do not need to check filename validity in
_call_fc_list
asfindSystemFonts
already does it.