Lines Matching refs:pattern
162 // Returns the string from the pattern, or nullptr
163 static const char* get_string(FcPattern* pattern, const char field[], int index = 0) {
165 if (FcPatternGetString(pattern, field, index, (FcChar8**)&name) != FcResultMatch) {
363 static int get_int(FcPattern* pattern, const char object[], int missing) {
365 if (FcPatternGetInteger(pattern, object, 0, &value) != FcResultMatch) {
413 static SkFontStyle skfontstyle_from_fcpattern(FcPattern* pattern) {
428 int weight = map_ranges(get_int(pattern, FC_WEIGHT, FC_WEIGHT_REGULAR),
442 int width = map_ranges(get_int(pattern, FC_WIDTH, FC_WIDTH_NORMAL),
446 switch (get_int(pattern, FC_SLANT, FC_SLANT_ROMAN)) {
456 static void fcpattern_from_skfontstyle(SkFontStyle style, FcPattern* pattern) {
494 FcPatternAddInteger(pattern, FC_WEIGHT, weight);
495 FcPatternAddInteger(pattern, FC_WIDTH , width);
496 FcPatternAddInteger(pattern, FC_SLANT , slant);
527 bool SkFontConfigInterfaceDirect::isValidPattern(FcPattern* pattern) {
529 const char* font_format = get_string(pattern, FC_FONTFORMAT);
539 const char* c_filename = get_string(pattern, FC_FILE);
598 FcPattern* pattern = FcPatternCreate();
601 FcPatternAddString(pattern, FC_FAMILY, (FcChar8*)familyName);
603 fcpattern_from_skfontstyle(style, pattern);
605 FcPatternAddBool(pattern, FC_SCALABLE, FcTrue);
607 FcConfigSubstitute(nullptr, pattern, FcMatchPattern);
608 FcDefaultSubstitute(pattern);
639 const char* post_config_family = get_string(pattern, FC_FAMILY);
646 FcFontSet* font_set = FcFontSort(nullptr, pattern, 0, nullptr, &result);
648 FcPatternDestroy(pattern);
654 FcPatternDestroy(pattern);
659 FcPatternDestroy(pattern);