Skip to content

Commit 2ab5e00

Browse files
authored
Merge pull request #41 from JuliaGraphics/sd/fix#40
fix #40
2 parents 66769c0 + a3e3ced commit 2ab5e00

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ os:
33
- linux
44
- osx
55
julia:
6-
- 1.3
7-
- nightly
8-
matrix:
9-
allow_failures:
10-
- julia: nightly
6+
- 1
117

128
notifications:
139
email: false
10+
11+
after_success:
12+
- julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'

src/layout.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ function iterate_extents(f, line::AbstractString, fonts, scales)
3434
iterator = zip(line, iter_or_array(scales), iter_or_array(fonts))
3535
lastpos = 0.0
3636
for (char, scale, font) in iterator
37-
extent, glyph_box = metrics_bb(char, font, scale)
38-
mini = minimimum(glyph_box) .+ Vec2f0(lastpos, 0.0)
37+
glyph_box, extent = metrics_bb(char, font, scale)
38+
mini = minimum(glyph_box) .+ Vec2f0(lastpos, 0.0)
3939
glyph_box = Rect2D(mini, widths(glyph_box))
4040
glyph_advance = Point2f0(extent.advance)
4141
lastpos += glyph_advance[1]
@@ -53,5 +53,5 @@ function glyph_rects(line::AbstractString, fonts, scales)
5353
end
5454

5555
function boundingbox(line::AbstractString, fonts, scales)
56-
reduce(union, glyph_rects(lines, fonts, scales))
56+
return reduce(union, glyph_rects(line, fonts, scales))
5757
end

test/runtests.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
using FreeTypeAbstraction, Colors, ColorVectorSpace, GeometryTypes
22
using Test
3-
using FreeTypeAbstraction: Vec, glyph_rects, get_extent, FTFont, kerning
3+
using FreeTypeAbstraction: boundingbox, Vec, glyph_rects, get_extent, FTFont, kerning
44
using FreeType
55

66
face = FreeTypeAbstraction.findfont("hack"; additional_fonts=@__DIR__)
77

8+
bb = boundingbox("asdasd", face, 1.0)
9+
@test bb == Rect(4.0, -1.0, 224.0, 50.0)
10+
811
FA = FreeTypeAbstraction
912

1013
FA.set_pixelsize(face, 64) # should be the default

0 commit comments

Comments
 (0)