Browse Source

Text: correctly propagate errors when delegating to *SingleData() APIs.

The AbstractFontConverter tests now all pass again.
pull/481/head
Vladimír Vondruš 6 years ago
parent
commit
fce8f18d1c
  1. 5
      doc/changelog.dox
  2. 6
      src/Magnum/Text/AbstractFontConverter.cpp

5
doc/changelog.dox

@ -188,6 +188,11 @@ See also:
- @ref Shaders::Phong wasn't normalizing normals coming from normal textures, - @ref Shaders::Phong wasn't normalizing normals coming from normal textures,
which may have caused slight artifacts due to limited precision of 8-bit which may have caused slight artifacts due to limited precision of 8-bit
pixel formats pixel formats
- @ref Text::AbstractFontConverter::exportFontToData() and
@ref Text::AbstractFontConverter::exportGlyphCacheToData() didn't correctly
propagate errors when delegating to
@ref Text::AbstractFontConverter::exportFontToSingleData() /
@ref Text::AbstractFontConverter::exportGlyphCacheToSingleData()
@subsection changelog-latest-deprecated Deprecated APIs @subsection changelog-latest-deprecated Deprecated APIs

6
src/Magnum/Text/AbstractFontConverter.cpp

@ -103,7 +103,8 @@ std::vector<std::pair<std::string, Containers::Array<char>>> AbstractFontConvert
"Text::AbstractFontConverter::exportFontToData(): feature advertised but not implemented", {}); "Text::AbstractFontConverter::exportFontToData(): feature advertised but not implemented", {});
std::vector<std::pair<std::string, Containers::Array<char>>> out; std::vector<std::pair<std::string, Containers::Array<char>>> out;
out.emplace_back(filename, doExportFontToSingleData(font, cache, characters)); Containers::Array<char> result = doExportFontToSingleData(font, cache, characters);
if(result) out.emplace_back(filename, std::move(result));
return out; return out;
} }
@ -155,7 +156,8 @@ std::vector<std::pair<std::string, Containers::Array<char>>> AbstractFontConvert
"Text::AbstractFontConverter::exportGlyphCacheToData(): feature advertised but not implemented", {}); "Text::AbstractFontConverter::exportGlyphCacheToData(): feature advertised but not implemented", {});
std::vector<std::pair<std::string, Containers::Array<char>>> out; std::vector<std::pair<std::string, Containers::Array<char>>> out;
out.emplace_back(filename, doExportGlyphCacheToSingleData(cache)); Containers::Array<char> result = doExportGlyphCacheToSingleData(cache);
if(result) out.emplace_back(filename, std::move(result));
return out; return out;
} }

Loading…
Cancel
Save