Skip to content

Commit f2e3f03

Browse files
authored
Make broadcasting over fonts easier
Each font is treated as a Ref. This makes broadcasting in the "one or vector" case significantly easier.
1 parent 03616e7 commit f2e3f03

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/types.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ function Base.getproperty(font::FTFont, fieldname::Symbol)
156156
end
157157
end
158158

159+
# Allow broadcasting over fonts
160+
Base.Broadcast.broadcastable(ft::FTFont) = Ref(ft)
161+
159162
get_pixelsize(face::FTFont) = getfield(face, :current_pixelsize)[]
160163

161164
function set_pixelsize(face::FTFont, size::Integer)

0 commit comments

Comments
 (0)