[DO-981] qt package (!15)
Co-authored-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech> Reviewed-on: https://git.avroid.tech/Conan/conan_build/pulls/15
This commit is contained in:
24
recipes/fontconfig/all/test_package/test_package.c
Normal file
24
recipes/fontconfig/all/test_package/test_package.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user