-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fontconfig: update expat * Revert expat on fontconfig<2.13.93 * Only revert expat on Mac * alphabetize * Simplify test package for <2.13.93 * Bump expat again * Re-add return value Co-authored-by: Uilian Ries <uilianries@gmail.com> --------- Co-authored-by: Uilian Ries <uilianries@gmail.com>
- Loading branch information
1 parent
3136377
commit e49bd28
Showing
3 changed files
with
4 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,6 @@ | ||
#include <fontconfig/fontconfig.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
int main() { | ||
FcConfig* config = FcInitLoadConfigAndFonts(); | ||
FcPattern* pat = FcNameParse((const FcChar8*)"Arial"); | ||
FcConfigSubstitute(config, pat, FcMatchPattern); | ||
FcDefaultSubstitute(pat); | ||
char* fontFile; | ||
FcResult result; | ||
FcPattern* font = FcFontMatch(config, pat, &result); | ||
if (font) { | ||
FcChar8* file = NULL; | ||
if (FcPatternGetString(font, FC_FILE, 0, &file) == FcResultMatch) { | ||
fontFile = (char*)file; | ||
printf("%s\n",fontFile); | ||
} | ||
} else { | ||
printf("Ops! I can't find any font!\n"); | ||
} | ||
FcPatternDestroy(pat); | ||
return EXIT_SUCCESS; | ||
FcInit(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters