From 6b8fc61b772b394d7a205531b492101c519dc47d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 17 Aug 2021 17:44:35 +0200 Subject: Add support for gzip compression and prepare for PSF support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libskrift_open_font_fd.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'libskrift_open_font_fd.c') diff --git a/libskrift_open_font_fd.c b/libskrift_open_font_fd.c index e134cd8..0e8b83d 100644 --- a/libskrift_open_font_fd.c +++ b/libskrift_open_font_fd.c @@ -46,7 +46,8 @@ libskrift_open_font_fd(LIBSKRIFT_FONT **fontp, int fd) mmapped = 1; } - if (libskrift_open_font_mem(fontp, mem, size)) { + if ((mmapped ? libskrift_open_font_adopt_mmap + : libskrift_open_font_adopt_mem)(fontp, mem, size)) { if (mmapped) munmap(mem, size); else @@ -54,9 +55,5 @@ libskrift_open_font_fd(LIBSKRIFT_FONT **fontp, int fd) return -1; } - (*fontp)->memory_free = mmapped ? NULL : mem; - (*fontp)->memory_unmap = mmapped ? mem : NULL; - (*fontp)->memory_size = size; - return 0; } -- cgit v1.2.3-70-g09d2