diff --git a/src/SFML/Graphics/Font.cpp b/src/SFML/Graphics/Font.cpp index 651fa87b..3563091b 100644 --- a/src/SFML/Graphics/Font.cpp +++ b/src/SFML/Graphics/Font.cpp @@ -46,9 +46,15 @@ namespace unsigned long Read(FT_Stream rec, unsigned long offset, unsigned char* buffer, unsigned long count) { sf::InputStream* stream = static_cast(rec->descriptor.pointer); - if (stream->Seek(offset) != offset) - return count ? 1 : 0; // error code is 0 if we're reading, or nonzero if we're seeking - return static_cast(stream->Read(reinterpret_cast(buffer), count)); + if (stream->Seek(offset) == offset) + { + if (count > 0) + return static_cast(stream->Read(reinterpret_cast(buffer), count)); + else + return 0; + } + else + return count > 0 ? 0 : 1; // error code is 0 if we're reading, or nonzero if we're seeking } void Close(FT_Stream) {