29 # include <ft2build.h>
30 # include FT_FREETYPE_H
40 # define STREAM_FILE(stream) ((FILE *)stream->descriptor.pointer)
41 # define FT_THROW(e) -1
43 static void ft_ansi_stream_close(FT_Stream stream)
45 fclose(STREAM_FILE(stream));
47 stream->descriptor.pointer =
NULL;
56 static unsigned long ft_ansi_stream_io(FT_Stream stream,
62 if (!
count && offset > stream->size) {
66 file = STREAM_FILE(stream);
68 if (stream->pos != offset) {
69 fseek(
file, offset, SEEK_SET);
75 static FT_Error FT_Stream_Open__win32_compat(FT_Stream stream,
const char *filepathname)
80 stream->descriptor.pointer =
NULL;
81 stream->pathname.pointer = (
char *)filepathname;
91 "could not open `%s'\n",
93 return FT_THROW(Cannot_Open_Resource);
96 fseek(
file, 0, SEEK_END);
97 stream->size = ftell(
file);
101 "opened `%s' but zero-sized\n",
104 return FT_THROW(Cannot_Open_Stream);
107 fseek(
file, 0, SEEK_SET);
109 stream->descriptor.pointer =
file;
110 stream->read = ft_ansi_stream_io;
111 stream->close = ft_ansi_stream_close;
116 FT_Error FT_New_Face__win32_compat(FT_Library
library,
117 const char *pathname,
123 FT_Stream stream =
NULL;
126 open.flags = FT_OPEN_STREAM;
127 open.stream = stream;
128 stream->pathname.pointer = (
char *)pathname;
130 err = FT_Stream_Open__win32_compat(stream, pathname);
136 err = FT_Open_Face(
library, &open, face_index, aface);
File and directory operations.
FILE * BLI_fopen(const char *filename, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Read Guarded memory(de)allocation.
static FT_Library library
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)