File tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change 7
7
function renderface (face:: FTFont , c:: Char , pixelsize:: Integer )
8
8
set_pixelsize (face, pixelsize)
9
9
loadchar (face, c)
10
- glyph = face. glyph
10
+ glyph = unsafe_load ( face. glyph)
11
11
@assert glyph. format == FreeType. FT_GLYPH_FORMAT_BITMAP
12
12
return glyphbitmap (glyph. bitmap), FontExtent (glyph. metrics)
13
13
end
Original file line number Diff line number Diff line change @@ -156,9 +156,6 @@ function Base.getproperty(font::FTFont, fieldname::Symbol)
156
156
if field isa Ptr{FT_String}
157
157
field == C_NULL && return " "
158
158
return unsafe_string (field)
159
- # Some fields segfault with unsafe_load...Lets find out which another day :D
160
- elseif field isa Ptr{FreeType. LibFreeType. FT_GlyphSlotRec}
161
- return unsafe_load (field)
162
159
else
163
160
return field
164
161
end
@@ -208,7 +205,7 @@ function internal_get_extent(face::FTFont, char::Char)
208
205
check_error (err, " Could not load char to get extent." )
209
206
# This gives us the font metrics in normalized units (0, 1), with negative
210
207
# numbers interpreted as an offset
211
- return FontExtent (face. glyph. metrics, Float32 (face. units_per_EM))
208
+ return FontExtent (unsafe_load ( face. glyph) . metrics, Float32 (face. units_per_EM))
212
209
end
213
210
214
211
descender (font) = font. descender / font. units_per_EM
You can’t perform that action at this time.
0 commit comments