Method: Fontconfig::Config#substitute
- Defined in:
- ext/fontconfig/fc_config.c
#substitute(*args) ⇒ Object
FcConfigSubstitute – Execute substitutions
238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'ext/fontconfig/fc_config.c', line 238
static VALUE rb_config_substitute(int argc, VALUE *argv, VALUE self){
VALUE pattern, match_kind;
rb_scan_args(argc, argv, "11", &pattern, &match_kind);
if(!is_fc_pattern(pattern)){
rb_raise(rb_eArgError, "argument must be Fontconfig::Pattern");
}
FcMatchKind kind = FcMatchPattern; //TODO: default?
if(RTEST(match_kind))
kind = sym2match_kind(match_kind);
return BOOL2VAL(FcConfigSubstitute(CONFIG_UNWRAP(self), RTYPEDDATA_DATA(pattern), kind));
}
|