Lines Matching refs:stream
28 static void ttf_cb_stream_read(ttf_cb_stream_t * stream, void * data, size_t to_read) in ttf_cb_stream_read() argument
30 if(stream->file != NULL) { in ttf_cb_stream_read()
32 lv_fs_read(stream->file, data, to_read, &br); in ttf_cb_stream_read()
35 if(to_read + stream->position >= stream->size) { in ttf_cb_stream_read()
36 to_read = stream->size - stream->position; in ttf_cb_stream_read()
38 lv_memcpy(data, ((const unsigned char *)stream->data + stream->position), to_read); in ttf_cb_stream_read()
39 stream->position += to_read; in ttf_cb_stream_read()
42 static void ttf_cb_stream_seek(ttf_cb_stream_t * stream, size_t position) in ttf_cb_stream_seek() argument
44 if(stream->file != NULL) { in ttf_cb_stream_seek()
45 lv_fs_seek(stream->file, position, LV_FS_SEEK_SET); in ttf_cb_stream_seek()
48 if(position > stream->size) { in ttf_cb_stream_seek()
49 stream->position = stream->size; in ttf_cb_stream_seek()
52 stream->position = position; in ttf_cb_stream_seek()
69 ttf_cb_stream_t stream; member
71 const uint8_t * stream; member
192 dsc->stream.file = &dsc->file; in lv_tiny_ttf_create()
195 dsc->stream.file = NULL; in lv_tiny_ttf_create()
196 dsc->stream.data = (const uint8_t *)data; in lv_tiny_ttf_create()
197 dsc->stream.size = data_size; in lv_tiny_ttf_create()
198 dsc->stream.position = 0; in lv_tiny_ttf_create()
200 … if(0 == stbtt_InitFont(&dsc->info, &dsc->stream, stbtt_GetFontOffsetForIndex(&dsc->stream, 0))) { in lv_tiny_ttf_create()
206 dsc->stream = (const uint8_t *)data; in lv_tiny_ttf_create()
208 if(0 == stbtt_InitFont(&dsc->info, dsc->stream, stbtt_GetFontOffsetForIndex(dsc->stream, 0))) { in lv_tiny_ttf_create()
274 if(ttf->stream.file != NULL) { in lv_tiny_ttf_destroy()