Skip to content

Commit

Permalink
Filter :all, & :best options from FontCnfig base class
Browse files Browse the repository at this point in the history
These are used by FontConfig::Patter derived class
  • Loading branch information
dwarring committed Oct 6, 2024
1 parent 62572ea commit 7050226
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/FontConfig.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ has FcPattern:D $.pattern handles<elems format Str> = FcPattern::create();
has Bool $.configured is built;
has %!store;

submethod TWEAK(:$configure, :pattern($), *%props) {
submethod TWEAK(:$configure, :pattern($), :all($), :best($), *%props) {
self.configure if $configure;
self{.key} = .value for %props;
}
Expand Down
10 changes: 9 additions & 1 deletion lib/FontConfig/Raw.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,19 @@ class FcValue is repr('CStruct') is export is rw {
}
multi method store(Pointer $f, :$!type = FcTypeFTFace ) { $!u.TWEAK(:$f) }
multi method store($_) { fail "don't know how to set FcValue to {.WHAT.raku}"; }
multi method COERCE($v) {
multi method COERCE(Any:D $v) {
my $obj = self.new;
$obj.store($v);
$obj;
}
multi method COERCE(Any:U $_) {
when Str { FcTypeString }
when Bool { FcTypeBool }
when Int { FcTypeInteger }
when Numeric { FcTypeDouble }
when Range { FcTypeRange }
default { FcTypeUnknown }
}
method CALL-ME is rw {
Proxy.new(
FETCH => { $!u.get($!type) },
Expand Down

0 comments on commit 7050226

Please sign in to comment.