FreeType callbacks that operate on a sf::InputStream
| 56 | { |
| 57 | // FreeType callbacks that operate on a sf::InputStream |
| 58 | unsigned long read(FT_Stream rec, unsigned long offset, unsigned char* buffer, unsigned long count) |
| 59 | { |
| 60 | auto* stream = static_cast<sf::InputStream*>(rec->descriptor.pointer); |
| 61 | if (stream->seek(offset) == offset) |
| 62 | { |
| 63 | if (count > 0) |
| 64 | return static_cast<unsigned long>(stream->read(reinterpret_cast<char*>(buffer), count).value()); |
| 65 | |
| 66 | return 0; |
| 67 | } |
| 68 | |
| 69 | return count > 0 ? 0 : 1; // error code is 0 if we're reading, or nonzero if we're seeking |
| 70 | } |
| 71 | void close(FT_Stream) |
| 72 | { |
| 73 | } |
no test coverage detected