Skip to content

Commit

Permalink
remove redundant cfunctions
Browse files Browse the repository at this point in the history
  • Loading branch information
arhik committed Apr 14, 2024
1 parent 7f32667 commit 80d2ca1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ FreeType = "b38be410-82b0-50bf-ab77-7b57e271db43"
GLFW = "f7f18e0c-5ee9-5ccd-a5bf-e8befd85ed98"
GLFW_jll = "0656b61e-2033-5cc2-a64a-77c0f6c09b89"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
Lazy = "50d2b5c4-7a5e-59d5-8109-a42b560f39c0"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
19 changes: 2 additions & 17 deletions src/glyph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ for op in [:+, :-, :/, :*]
end |> eval
end


# Base.show(io::IO, ::MIME"text/plain", p::Point) = println("Point [$(p.x), $(p.y)]")

Base.convert(::Type{FontPoint}, p::FT_Vector) = FontPoint(p.x, p.y)
Expand Down Expand Up @@ -116,20 +115,6 @@ function getCurvePoints(outline, firstIdx, lastIdx)

end

moveToFunc = Ref{FT_Outline_MoveTo_Func}()
lineToFunc = Ref{FT_Outline_LineTo_Func}()
conicToFunc = Ref{FT_Outline_ConicTo_Func}()
cubicToFunc = Ref{FT_Outline_CubicTo_Func}()

global funcsRef = CStruct(FT_Outline_Funcs)

funcsRef.move_to = moveToFunc[]
funcsRef.line_to = lineToFunc[]
funcsRef.conic_to = conicToFunc[]
funcsRef.cubic_to = cubicToFunc[]
funcsRef.delta = (0 |> Int32)
funcsRef.shift = (0 |> Int32)

function createGlyph(charCode)
global curves
ftLib = Ref{FT_Library}(C_NULL)
Expand All @@ -145,7 +130,7 @@ function createGlyph(charCode)
return face[]
end

face = loadFace(joinpath(@__DIR__, "..", "..", "assets", "JuliaMono", "JuliaMono-Light.ttf"))
face = loadFace(joinpath(pkgdir(WGPUgfx), "assets", "JuliaMono", "JuliaMono-Light.ttf"))

FT_Set_Pixel_Sizes(face, 1.0, 1.0)

Expand All @@ -162,7 +147,7 @@ function createGlyph(charCode)
outlineFuncs |> Ref,
C_NULL
)

@assert status == 0 "FreeType Decompose failed!!!"

for contourIdx in 1:nContours
Expand Down

0 comments on commit 80d2ca1

Please sign in to comment.