15 # include <ft2build.h>
16 # include FT_FREETYPE_H
26 # define STREAM_FILE(stream) ((FILE *)stream->descriptor.pointer)
27 # define FT_THROW(e) -1
29 static void ft_ansi_stream_close(FT_Stream stream)
31 fclose(STREAM_FILE(stream));
33 stream->descriptor.pointer =
NULL;
42 static unsigned long ft_ansi_stream_io(FT_Stream stream,
52 file = STREAM_FILE(stream);
54 if (stream->pos !=
offset) {
61 static FT_Error FT_Stream_Open__win32_compat(FT_Stream stream,
const char *filepathname)
66 stream->descriptor.pointer =
NULL;
67 stream->pathname.pointer = (
char *)filepathname;
77 "could not open `%s'\n",
79 return FT_THROW(Cannot_Open_Resource);
83 stream->size = ftell(
file);
87 "opened `%s' but zero-sized\n",
90 return FT_THROW(Cannot_Open_Stream);
95 stream->descriptor.pointer =
file;
96 stream->read = ft_ansi_stream_io;
97 stream->close = ft_ansi_stream_close;
102 FT_Error FT_New_Face__win32_compat(FT_Library
library,
103 const char *pathname,
109 FT_Stream stream =
NULL;
112 open.flags = FT_OPEN_STREAM;
113 open.stream = stream;
114 stream->pathname.pointer = (
char *)pathname;
116 err = FT_Stream_Open__win32_compat(stream, pathname);
122 err = FT_Open_Face(
library, &open, face_index, aface);
File and directory operations.
FILE * BLI_fopen(const char *filepath, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_fseek(FILE *stream, int64_t offset, int whence)
Read Guarded memory(de)allocation.
ccl_global float * buffer
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
static FT_Library library