Lines Matching refs:stream
44 static void ttf_cb_stream_read(ttf_cb_stream_t * stream, void * data, size_t to_read);
45 static void ttf_cb_stream_seek(ttf_cb_stream_t * stream, size_t position);
58 ttf_cb_stream_t stream; member
60 const uint8_t * stream; member
158 if(ttf->stream.file != NULL) { in lv_tiny_ttf_destroy()
176 static void ttf_cb_stream_read(ttf_cb_stream_t * stream, void * data, size_t to_read) in ttf_cb_stream_read() argument
178 if(stream->file != NULL) { in ttf_cb_stream_read()
180 lv_fs_read(stream->file, data, to_read, &br); in ttf_cb_stream_read()
183 if(to_read + stream->position >= stream->size) { in ttf_cb_stream_read()
184 to_read = stream->size - stream->position; in ttf_cb_stream_read()
186 memcpy(data, ((const unsigned char *)stream->data + stream->position), to_read); in ttf_cb_stream_read()
187 stream->position += to_read; in ttf_cb_stream_read()
190 static void ttf_cb_stream_seek(ttf_cb_stream_t * stream, size_t position) in ttf_cb_stream_seek() argument
192 if(stream->file != NULL) { in ttf_cb_stream_seek()
193 lv_fs_seek(stream->file, position, LV_FS_SEEK_SET); in ttf_cb_stream_seek()
196 if(position > stream->size) { in ttf_cb_stream_seek()
197 stream->position = stream->size; in ttf_cb_stream_seek()
200 stream->position = position; in ttf_cb_stream_seek()
378 dsc->stream.file = &dsc->file; in lv_tiny_ttf_create()
381 dsc->stream.data = (const uint8_t *)data; in lv_tiny_ttf_create()
382 dsc->stream.size = data_size; in lv_tiny_ttf_create()
384 … if(0 == stbtt_InitFont(&dsc->info, &dsc->stream, stbtt_GetFontOffsetForIndex(&dsc->stream, 0))) { in lv_tiny_ttf_create()
391 dsc->stream = (const uint8_t *)data; in lv_tiny_ttf_create()
392 if(0 == stbtt_InitFont(&dsc->info, dsc->stream, stbtt_GetFontOffsetForIndex(dsc->stream, 0))) { in lv_tiny_ttf_create()