add debug warnings
This commit is contained in:
@@ -19,6 +19,11 @@ extern const bool styleParseWarnings;
|
||||
extern const bool spriteWarnings;
|
||||
extern const bool renderWarnings;
|
||||
extern const bool renderTree;
|
||||
extern const bool labelTextMissingWarning;
|
||||
extern const bool missingFontStackWarning;
|
||||
extern const bool missingFontFaceWarning;
|
||||
extern const bool glyphWarning;
|
||||
extern const bool shapingWarning;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -163,9 +163,11 @@ std::unique_ptr<Bucket> TileParser::createIconBucket(const VectorTileLayer& laye
|
||||
}
|
||||
|
||||
std::unique_ptr<Bucket> TileParser::createTextBucket(const VectorTileLayer& layer, const BucketDescription& bucket_desc) {
|
||||
|
||||
// Determine the correct text stack.
|
||||
if (!layer.shaping.size()) {
|
||||
if (debug::missingFontStackWarning) {
|
||||
fprintf(stderr, "[WARNING] missing font stack '%s'\n", bucket_desc.geometry.font.c_str());
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -179,6 +181,9 @@ std::unique_ptr<Bucket> TileParser::createTextBucket(const VectorTileLayer& laye
|
||||
auto it = const_faces.find(face);
|
||||
if (it == const_faces.end()) {
|
||||
// This layer references an unknown face.
|
||||
if (debug::missingFontFaceWarning) {
|
||||
fprintf(stderr, "[WARNING] missing font face '%s'\n", face.c_str());
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
faces.push_back(&it->second);
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <llmr/style/style.hpp>
|
||||
#include <llmr/map/vector_tile.hpp>
|
||||
#include <llmr/text/placement.hpp>
|
||||
#include <llmr/util/constants.hpp>
|
||||
|
||||
#include <llmr/util/math.hpp>
|
||||
#include <llmr/platform/gl.hpp>
|
||||
@@ -103,12 +104,18 @@ void TextBucket::addFeature(const VectorTileFeature &feature,
|
||||
auto it_prop = feature.properties.find(geom_desc.field);
|
||||
if (it_prop == feature.properties.end()) {
|
||||
// feature does not have the correct property
|
||||
if (debug::labelTextMissingWarning) {
|
||||
fprintf(stderr, "[WARNING] feature doesn't have property '%s' required for labelling\n", geom_desc.field.c_str());
|
||||
}
|
||||
return;
|
||||
}
|
||||
const Value &value = it_prop->second;
|
||||
|
||||
auto it_shaping = shapings.find(value);
|
||||
if (it_shaping == shapings.end()) {
|
||||
if (debug::shapingWarning) {
|
||||
fprintf(stderr, "[WARNING] missing shaping for '%s'\n", toString(value).c_str());
|
||||
}
|
||||
// we lack shaping information for this label
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7,3 +7,8 @@ const bool llmr::debug::styleParseWarnings = false;
|
||||
const bool llmr::debug::spriteWarnings = false;
|
||||
const bool llmr::debug::renderWarnings = false;
|
||||
const bool llmr::debug::renderTree = false;
|
||||
const bool llmr::debug::labelTextMissingWarning = true;
|
||||
const bool llmr::debug::missingFontStackWarning = true;
|
||||
const bool llmr::debug::missingFontFaceWarning = true;
|
||||
const bool llmr::debug::glyphWarning = true;
|
||||
const bool llmr::debug::shapingWarning = true;
|
||||
|
||||
Reference in New Issue
Block a user