mirror of
https://github.com/mapbox/node-fontnik.git
synced 2026-02-01 16:47:18 +00:00
create format outside of string loop
This commit is contained in:
parent
a88df4a7f9
commit
a2f8bd54c1
@ -136,7 +136,6 @@ void Tile::AsyncShape(uv_work_t* req) {
|
||||
fset.add_fontstack(baton->fontstack, ',');
|
||||
|
||||
fontserver::face_set_ptr face_set = font_manager.get_face_set(fset);
|
||||
// std::cout << "FONTSTACK " << baton->fontstack << ' ' << face_set->size() << '\n';
|
||||
if (!face_set->size()) return;
|
||||
|
||||
llmr::vector::tile& tile = baton->tile->tile;
|
||||
@ -165,6 +164,10 @@ void Tile::AsyncShape(uv_work_t* req) {
|
||||
llmr::vector::layer* mutable_layer = tile.mutable_layers(i);
|
||||
fontserver::face_set_ptr layer_faces = font_manager.get_face_set();
|
||||
|
||||
fontserver::text_format format(baton->fontstack, 24);
|
||||
fontserver::text_format_ptr format_ptr =
|
||||
std::make_shared<fontserver::text_format>(format);
|
||||
|
||||
// Process strings per layer.
|
||||
for (auto const& key : strings) {
|
||||
const llmr::vector::value& value = layer.values(key);
|
||||
@ -181,10 +184,6 @@ void Tile::AsyncShape(uv_work_t* req) {
|
||||
|
||||
fontserver::text_line line(0, str.length() - 1);
|
||||
|
||||
fontserver::text_format format(baton->fontstack, 24);
|
||||
fontserver::text_format_ptr format_ptr =
|
||||
std::make_shared<fontserver::text_format>(format);
|
||||
|
||||
itemizer.add_text(str, format_ptr);
|
||||
|
||||
const double scale_factor = 1.0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user