File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
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 = unsafe_load ( face. glyph)
10
+ glyph = 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,6 +156,9 @@ 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)
159
162
else
160
163
return field
161
164
end
@@ -205,7 +208,7 @@ function internal_get_extent(face::FTFont, char::Char)
205
208
check_error (err, " Could not load char to get extent." )
206
209
# This gives us the font metrics in normalized units (0, 1), with negative
207
210
# numbers interpreted as an offset
208
- return FontExtent (unsafe_load ( face. glyph) . metrics, Float32 (face. units_per_EM))
211
+ return FontExtent (face. glyph. metrics, Float32 (face. units_per_EM))
209
212
end
210
213
211
214
descender (font) = font. descender / font. units_per_EM
You can’t perform that action at this time.
0 commit comments