- {l Code}: {l Select All Code}
fc-match LiberationSans-Regular.ttf -f "%{file}"
fc-match LiberationSans-Regular.ttf -f "%{file}"
c_xong {l Wrote}:Usually games include their own font files. Yes this can be wasteful of disk space but font files are tiny. Plus many games use bitmap fonts because they are faster to render.
std::string FindDefaultFont()
{
std::string answer("/usr/share/fonts/liberation/LiberationSans-Regular.ttf");
FcFontSet *fs;
FcPattern *pat;
FcResult result;
if (!FcInit())
{
return answer;
}
pat = FcNameParse((FcChar8 *)"LiberationSans-Regular.ttf");
FcConfigSubstitute(0, pat, FcMatchPattern);
FcDefaultSubstitute(pat);
fs = FcFontSetCreate();
FcPattern *match;
match = FcFontMatch(0, pat, &result);
if (match)
{
FcChar8 *file;
if (FcPatternGetString(match, FC_FILE, 0, &file) == FcResultMatch)
{
answer = (const char *)file;
}
FcPatternDestroy(match);
}
FcPatternDestroy(pat);
FcFini();
return answer;
}
Well if you want to be packaged on Fedora, I believe you can't include your own font.
Usually the legal workaround is to prerender the font to a bitmap and just use the bitmap
"disk space is hardly anything its okay" is not an excuse to everything, and being against bloat doesn't imply it's for dinosaur computer development only.
Users browsing this forum: No registered users and 1 guest