diff --git a/doc/snippets/MagnumText.cpp b/doc/snippets/MagnumText.cpp index 325ca9b68..95de01108 100644 --- a/doc/snippets/MagnumText.cpp +++ b/doc/snippets/MagnumText.cpp @@ -261,8 +261,12 @@ for(std::size_t i = 0; i != fontGlyphIds.size(); ++i) { } { +/* -Wnonnull in GCC 11+ "helpfully" says "this is null" if I don't initialize + the font pointer. I don't care, I just want you to check compilation errors, + not more! */ +PluginManager::Manager manager; /* [AbstractShaper-shape] */ -Containers::Pointer font = DOXYGEN_ELLIPSIS({}); +Containers::Pointer font = DOXYGEN_ELLIPSIS(manager.loadAndInstantiate("SomethingWhatever")); Containers::Pointer shaper = font->createShaper(); /* Set text properties and shape it */ @@ -287,7 +291,11 @@ shaper->glyphOffsetsAdvancesInto( } { -Containers::Pointer font; +/* -Wnonnull in GCC 11+ "helpfully" says "this is null" if I don't initialize + the font pointer. I don't care, I just want you to check compilation errors, + not more! */ +PluginManager::Manager manager; +Containers::Pointer font = manager.loadAndInstantiate("SomethingWhatever"); Containers::Pointer shaper = font->createShaper(); /* [AbstractShaper-shape-features] */ shaper->shape("Hello, world!", { @@ -302,9 +310,13 @@ struct GlyphInfo { Vector2 offset; Vector2 advance; }; +/* -Wnonnull in GCC 11+ "helpfully" says "this is null" if I don't initialize + the font pointer. I don't care, I just want you to check compilation errors, + not more! */ +PluginManager::Manager manager; /* [AbstractShaper-shape-multiple] */ -Containers::Pointer font = DOXYGEN_ELLIPSIS({}); -Containers::Pointer boldFont = DOXYGEN_ELLIPSIS({}); +Containers::Pointer font = DOXYGEN_ELLIPSIS(manager.loadAndInstantiate("SomethingWhatever")); +Containers::Pointer boldFont = DOXYGEN_ELLIPSIS(manager.loadAndInstantiate("SomethingWhatever")); Containers::Pointer shaper = font->createShaper(); Containers::Pointer boldShaper = boldFont->createShaper(); DOXYGEN_ELLIPSIS()