Skip to content

Commit

Permalink
Merge pull request #68 from JuliaGraphics/sd/no-sarray
Browse files Browse the repository at this point in the history
Remove SArray
  • Loading branch information
SimonDanisch authored Apr 4, 2022
2 parents a8fecea + 0789347 commit 0fa364e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ ColorVectorSpace = "c3611d14-8923-5661-9e6a-0046d554d3a4"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
FreeType = "b38be410-82b0-50bf-ab77-7b57e271db43"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

[compat]
ColorVectorSpace = "0.8, 0.9"
Colors = "0.11, 0.12"
FreeType = "4"
GeometryBasics = "0.4.1"
StaticArrays = "0.12, 1.0"
julia = "1"

[extras]
Expand Down
3 changes: 2 additions & 1 deletion src/FreeTypeAbstraction.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
module FreeTypeAbstraction

using FreeType, StaticArrays, Colors, ColorVectorSpace, GeometryBasics
using FreeType, Colors, ColorVectorSpace, GeometryBasics
using Base.Iterators: Repeated, repeated
import Base: /, *, ==
import Base.Broadcast: BroadcastStyle, Style, broadcasted
using GeometryBasics: StaticVector

include("types.jl")
include("findfonts.jl")
Expand Down
2 changes: 1 addition & 1 deletion src/layout.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ iter_or_array(x) = repeated(x)
iter_or_array(x::Repeated) = x
iter_or_array(x::AbstractArray) = x
# We treat staticarrays as scalar
iter_or_array(x::StaticArray) = repeated(x)
iter_or_array(x::Union{Mat, StaticVector}) = repeated(x)


function metrics_bb(char::Char, font::FTFont, pixel_size)
Expand Down
6 changes: 3 additions & 3 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ BroadcastStyle(::Type{<: FontExtent}) = Style{FontExtent}()
BroadcastStyle(::Style{FontExtent}, x) = Style{FontExtent}()
BroadcastStyle(x, ::Style{FontExtent}) = Style{FontExtent}()

function broadcasted(op::Function, f::FontExtent, scaling::StaticVector)
function broadcasted(op, f::FontExtent, scaling::Vec)
return FontExtent(
op.(f.vertical_bearing, scaling[1]),
op.(f.horizontal_bearing, scaling[2]),
Expand All @@ -58,7 +58,7 @@ function broadcasted(op::Function, f::FontExtent, scaling::StaticVector)
)
end

function broadcasted(op::Function, f::FontExtent)
function broadcasted(op, f::FontExtent)
return FontExtent(
op.(f.vertical_bearing),
op.(f.horizontal_bearing),
Expand All @@ -67,7 +67,7 @@ function broadcasted(op::Function, f::FontExtent)
)
end

function broadcasted(op::Function, ::Type{T}, f::FontExtent) where T
function broadcasted(op, ::Type{T}, f::FontExtent) where T
return FontExtent(
map(x-> op(T, x), f.vertical_bearing),
map(x-> op(T, x), f.horizontal_bearing),
Expand Down

0 comments on commit 0fa364e

Please sign in to comment.