The problem seems to be deeper: sf::Text also doesn't draw properly anymore. Very minimal program:
#include <SFML/Graphics.hpp>
#include <iostream>
int main()
{
sf::Font f{};
if (!f.loadFromFile("bkant.ttf"))
{
std::cout<<"font not found\n";
}
sf::Text t{ "hello world", f };
sf::CircleShape c{ 10 };
sf::RenderWindow win{ sf::VideoMode{800, 600}, "test" };
sf::Event ev;
while (win.isOpen())
{
while (win.pollEvent(ev))
{
switch (ev.type)
{
case sf::Event::Closed:
win.close();
break;
}
}
win.clear(sf::Color::Blue);
win.draw(c); // draws without issue
//win.draw(t); // crashes with exception from freetype
win.display();
}
}
Compiled with visual studio 16.11.3
Installed libraries (via vcpkg):
C:\vcpkg>vcpkg.exe list
brotli:x64-windows 1.0.9#1 a generic-purpose lossless compression algorithm...
bzip2:x64-windows 1.0.8#2 bzip2 is a freely available, patent free, high-q...
freetype:x64-windows 2.11.0 A library to render fonts.
freetype[brotli]:x64-windows Support decompression of WOFF2 streams
freetype[bzip2]:x64-windows Support bzip2 compressed fonts.
freetype[png]:x64-windows Support PNG compressed OpenType embedded bitmaps.
freetype[zlib]:x64-windows Use zlib instead of internal library for DEFLATE
libflac:x64-windows 1.3.3#5 Library for manipulating FLAC files
libogg:x64-windows 1.3.5 Ogg is a multimedia container format, and the na...
libpng:x64-windows 1.6.37#15 libpng is a library implementing an interface fo...
libvorbis:x64-windows 1.3.7#1 Ogg Vorbis is a fully open, non-proprietary, pat...
openal-soft:x64-windows 1.21.1#2 OpenAL Soft is an LGPL-licensed, cross-platform,...
sfgui:x64-windows 0.4.0#4 simple and fast graphical user interface library
sfml:x64-windows 2.5.1#10 Simple and fast multimedia library
stb:x64-windows 2020-09-14 public domain header-only libraries
tinyxml2:x64-windows 8.0.0-1 A simple, small, efficient, C++ XML parser
vcpkg-cmake-config:x64-windows 2021-05-22#1
vcpkg-cmake:x64-windows 2021-07-30
zlib:x64-windows 1.2.11#11 A compression library
C:\vcpkg>
interesting detail: the debugger watch suggests that variable t has no vertices
- t {m_string={m_string={_Mypair=allocator } } m_font=0x00d3fd58 {m_library=0x0118c2d8 m_face=0x011ae678 ...} ...} sf::Text {sfml-graphics-d-2.dll!sf::Text}
+ [sf::Text] {m_string={m_string={_Mypair=allocator } } m_font=0x00d3fd58 {m_library=0x0118c2d8 m_face=0x011ae678 ...} ...} sfml-graphics-d-2.dll!sf::Text
+ sf::Drawable {...} sf::Drawable
+ sf::Transformable {m_origin={x=0.00000000 y=0.00000000 } m_position={x=0.00000000 y=0.00000000 } m_rotation=0.00000000 ...} sf::Transformable
+ m_string {m_string={_Mypair=allocator } } sf::String
+ m_font 0x00d3fd58 {m_library=0x0118c2d8 m_face=0x011ae678 m_streamRec=0x00000000 ...} const sf::Font *
m_characterSize 30 unsigned int
m_letterSpacingFactor 1.00000000 float
m_lineSpacingFactor 1.00000000 float
m_style 0 unsigned int
+ m_fillColor {r=255 'ÿ' g=255 'ÿ' b=255 'ÿ' ...} sf::Color
+ m_outlineColor {r=0 '\0' g=0 '\0' b=0 '\0' ...} sf::Color
m_outlineThickness 0.00000000 float
+ m_vertices {m_vertices={ size=0 } m_primitiveType=Triangles (3) } sf::VertexArray
+ m_outlineVertices {m_vertices={ size=0 } m_primitiveType=Triangles (3) } sf::VertexArray
+ m_bounds {left=0.00000000 top=0.00000000 width=0.00000000 ...} sf::Rect<float>
m_geometryNeedUpdate true bool
m_fontTextureId 0 unsigned __int64