From 288e896af0f0484ed3a03b5ae87fc867eb1ee1c5 Mon Sep 17 00:00:00 2001 From: Constantin Shalnev Date: Tue, 13 Oct 2015 18:57:51 +0300 Subject: [PATCH] CityRank and PopRank was removed as obsolete --- graphics/font_desc.cpp | 6 - indexer/drawing_rules.cpp | 43 --- indexer/drawing_rules.hpp | 6 - indexer/drules_city_rank_table.cpp | 292 ------------------ indexer/drules_city_rank_table.hpp | 51 --- indexer/indexer.pro | 2 - .../indexer_tests/city_rank_table_test.cpp | 132 -------- indexer/indexer_tests/indexer_tests.pro | 1 - render/cpu_drawer.cpp | 5 - render/drawer.cpp | 6 - render/feature_styler.cpp | 8 - render/feature_styler.hpp | 2 - render/gpu_drawer.cpp | 7 - 13 files changed, 561 deletions(-) delete mode 100644 indexer/drules_city_rank_table.cpp delete mode 100644 indexer/drules_city_rank_table.hpp delete mode 100644 indexer/indexer_tests/city_rank_table_test.cpp diff --git a/graphics/font_desc.cpp b/graphics/font_desc.cpp index aeab8bb9ec..320551aae0 100644 --- a/graphics/font_desc.cpp +++ b/graphics/font_desc.cpp @@ -16,12 +16,6 @@ namespace graphics m_isMasked(isMasked), m_maskColor(maskColor) {} - void FontDesc::SetRank(double rank) - { - if (rank > 0) - m_size += static_cast(rank * m_size); - } - bool FontDesc::IsValid() const { return m_size != -1; diff --git a/indexer/drawing_rules.cpp b/indexer/drawing_rules.cpp index 149634006d..08dd783c5b 100644 --- a/indexer/drawing_rules.cpp +++ b/indexer/drawing_rules.cpp @@ -118,7 +118,6 @@ void BaseRule::SetSelector(unique_ptr && selector) RulesHolder::RulesHolder() : m_bgColors(scales::UPPER_STYLE_SCALE+1, DEFAULT_BG_COLOR) - , m_cityRankTable(GetConstRankCityRankTable()) {} RulesHolder::~RulesHolder() @@ -176,14 +175,6 @@ uint32_t RulesHolder::GetBgColor(int scale) const return m_bgColors[scale]; } -double RulesHolder::GetCityRank(int scale, uint32_t population) const -{ - double rank; - if (!m_cityRankTable->GetCityRank(scale, population, rank)) - return -1.0; // do not draw - return rank; -} - void RulesHolder::ClearCaches() { ForEachRule(bind(static_cast(&BaseRule::MakeEmptyID), _4)); @@ -526,45 +517,11 @@ void RulesHolder::LoadFromBinaryProto(string const & s) InitBackgroundColors(doSet.m_cont); } -void RulesHolder::LoadCityRankTableFromString(string & s) -{ - unique_ptr table; - - if (!s.empty()) - { - table = GetCityRankTableFromString(s); - - if (nullptr == table) - LOG(LINFO, ("Invalid city-rank-table file")); - } - - if (nullptr == table) - table = GetConstRankCityRankTable(); - - m_cityRankTable = move(table); -} - void LoadRules() { string buffer; - - // Load drules_proto GetStyleReader().GetDrawingRulesReader().ReadAsString(buffer); rules().LoadFromBinaryProto(buffer); - - // Load city_rank - buffer.clear(); - try - { - ReaderPtr cityRankFileReader = GetPlatform().GetReader("city_rank.txt"); - cityRankFileReader.ReadAsString(buffer); - } - catch (FileAbsentException & e) - { - // city-rank.txt file is optional, if it does not exist, then default city-rank-table is used - LOG(LINFO, ("File city-rank-table does not exist", e.Msg())); - } - rules().LoadCityRankTableFromString(buffer); } } diff --git a/indexer/drawing_rules.hpp b/indexer/drawing_rules.hpp index af5cac8469..144c5cf47a 100644 --- a/indexer/drawing_rules.hpp +++ b/indexer/drawing_rules.hpp @@ -1,7 +1,6 @@ #pragma once #include "indexer/drawing_rule_def.hpp" -#include "indexer/drules_city_rank_table.hpp" #include "indexer/drules_selector.hpp" #include "base/base.hpp" @@ -80,8 +79,6 @@ namespace drule /// background color for scales in range [0...scales::UPPER_STYLE_SCALE] vector m_bgColors; - unique_ptr m_cityRankTable; - public: RulesHolder(); ~RulesHolder(); @@ -97,15 +94,12 @@ namespace drule uint32_t GetBgColor(int scale) const; - double GetCityRank(int scale, uint32_t population) const; - #ifdef OMIM_OS_DESKTOP void LoadFromTextProto(string const & buffer); static void SaveToBinaryProto(string const & buffer, ostream & s); #endif void LoadFromBinaryProto(string const & s); - void LoadCityRankTableFromString(string & s); template void ForEachRule(ToDo toDo) { diff --git a/indexer/drules_city_rank_table.cpp b/indexer/drules_city_rank_table.cpp deleted file mode 100644 index 59cab838b9..0000000000 --- a/indexer/drules_city_rank_table.cpp +++ /dev/null @@ -1,292 +0,0 @@ -#include "indexer/drules_city_rank_table.hpp" -#include "indexer/scales.hpp" - -#include "std/algorithm.hpp" -#include "std/bind.hpp" -#include "std/exception.hpp" -#include "std/function.hpp" -#include "std/unordered_map.hpp" -#include "std/utility.hpp" -#include "std/vector.hpp" - -#include "base/assert.hpp" - -namespace drule -{ - -namespace -{ - -using TZoomRange = pair; -using TPopulationRange = pair; -using TRankForPopulationRange = pair; -using TCityRankVector = vector; -using TCityRankTable = unordered_map; - -class ConstCityRankTable : public ICityRankTable -{ -public: - explicit ConstCityRankTable(double rank) - : m_rank(rank) - { - } - - bool GetCityRank(uint32_t /*zoomLevel*/, uint32_t /*population*/, double & rank) const override - { - rank = m_rank; - return true; - } - -private: - double const m_rank; -}; - -class CityRankTable : public ICityRankTable -{ -public: - explicit CityRankTable(TCityRankTable && table) - : m_table(move(table)) - { - } - - bool GetCityRank(uint32_t zoomLevel, uint32_t population, double & rank) const override - { - auto const itr = m_table.find(zoomLevel); - if (itr == m_table.cend()) - return false; - - for (auto const & rp : itr->second) - { - if (population >= rp.second.first && population <= rp.second.second) - { - rank = rp.first; - return true; - } - } - - return false; - } - -private: - TCityRankTable const m_table; -}; - -void RemoveSpaces(string & s) -{ - s.erase(remove_if(s.begin(), s.end(), &isspace), s.end()); -} - -bool ParseZoom(string const & s, size_t start, size_t end, - uint32_t & zFrom, uint32_t & zTo) -{ - ASSERT_LESS(start, end, ()); - ASSERT_LESS(end, s.length(), ()); - - // Parse Zoom - // z[zoomFrom]-[zoomTo] - // z[zoom] - - // length of Zoom must be more than 1 because it starts with z - if ((end - start) <= 1) - return false; - - if (s[start] != 'z') - return false; - - string zFromStr, zToStr; - - size_t const d = s.find('-', start + 1); - if (d == string::npos || d >= end) - { - zFromStr.assign(s.begin() + start + 1, s.begin() + end); - zToStr = zFromStr; - } - else - { - zFromStr.assign(s.begin() + start + 1, s.begin() + d); - zToStr.assign(s.begin() + d + 1, s.begin() + end); - } - - try - { - zFrom = zFromStr.empty() ? 0 : stoi(zFromStr); - zTo = zToStr.empty() ? scales::UPPER_STYLE_SCALE : stoi(zToStr); - } - catch (exception &) - { - // stoi has not parsed a number - return false; - } - - if (zFrom > zTo) - return false; - - return true; -} - -bool ParsePopulationRank(string const & s, size_t start, size_t end, - uint32_t & popFrom, uint32_t & popTo, double & rank) -{ - ASSERT_LESS(start, end, ()); - ASSERT_LESS(end, s.length(), ()); - - // Parse PopulationRank - // [populationFrom]-[populationTo]:rank - - size_t const d1 = s.find('-', start); - if (d1 == string::npos || d1 >= end) - return false; - - size_t const d2 = s.find(':', d1 + 1); - if (d2 == string::npos || d2 >= end) - return false; - - string popFromStr(s.begin() + start, s.begin() + d1); - string popToStr(s.begin() + d1 + 1, s.begin() + d2); - string rankStr(s.begin() + d2 + 1, s.begin() + end); - - try - { - popFrom = popFromStr.empty() ? 0 : stoi(popFromStr); - popTo = popToStr.empty() ? numeric_limits::max() : stoi(popToStr); - rank = stod(rankStr); - } - catch (exception &) - { - // stoi, stod has not parsed a number - return false; - } - - if (popFrom > popTo) - return false; - - return true; -} - -bool ParsePopulationRanks(string const & s, size_t start, size_t end, - function const & onPopRank) -{ - ASSERT_LESS(start, end, ()); - ASSERT_LESS(end, s.length(), ()); - - // Parse 0...n of PopulationRank, delimited by ; - - while (start < end) - { - size_t const i = s.find(';', start); - if (i == string::npos || i >= end) - return false; - - if (i > start) - { - uint32_t popFrom, popTo; - double rank; - if (!ParsePopulationRank(s, start, i, popFrom, popTo, rank)) - return false; - - onPopRank(popFrom, popTo, rank); - } - - start = i + 1; - } - - return true; -} - -bool ParseCityRankTable(string const & s, - function const & onZoom, - function const & onPopRank) -{ - // CityRankTable string format is - // z[zoomFrom]-[zoomTo] { [populationFrom]-[populationTo]:rank;[populationFrom]-[populationTo]:rank; } - - size_t const end = s.length(); - size_t start = 0; - - while (start < end) - { - size_t const i = s.find('{', start); - if (i == string::npos) - return false; - - size_t const j = s.find('}', i + 1); - if (j == string::npos) - return false; - - uint32_t zFrom, zTo; - if (!ParseZoom(s, start, i, zFrom, zTo)) - return false; - - if (j > (i + 1)) - { - onZoom(zFrom, zTo); - - if (!ParsePopulationRanks(s, i + 1, j, onPopRank)) - return false; - } - - start = j + 1; - } - - return true; -} - -class CityRankTableBuilder -{ -public: - unique_ptr Parse(string & str) - { - RemoveSpaces(str); - - auto onZoom = bind(&CityRankTableBuilder::OnZoom, this, _1, _2); - auto onPopRank = bind(&CityRankTableBuilder::OnPopulationRank, this, _1, _2, _3); - if (!ParseCityRankTable(str, onZoom, onPopRank)) - return unique_ptr(); - - Flush(); - - return make_unique(move(m_cityRanksTable)); - } - -private: - void OnPopulationRank(uint32_t popFrom, uint32_t popTo, double rank) - { - m_cityRanksForZoomRange.emplace_back(make_pair(rank, make_pair(popFrom, popTo))); - } - void OnZoom(uint32_t zoomFrom, uint32_t zoomTo) - { - Flush(); - - m_zoomRange = make_pair(zoomFrom, zoomTo); - } - void Flush() - { - if (!m_cityRanksForZoomRange.empty()) - { - for (uint32_t z = m_zoomRange.first; z <= m_zoomRange.second; ++z) - { - TCityRankVector & dst = m_cityRanksTable[z]; - dst.insert(dst.end(), m_cityRanksForZoomRange.begin(), m_cityRanksForZoomRange.end()); - } - m_cityRanksForZoomRange.clear(); - } - } - - TZoomRange m_zoomRange; - TCityRankVector m_cityRanksForZoomRange; - TCityRankTable m_cityRanksTable; -}; - -} // namespace - -unique_ptr GetCityRankTableFromString(string & str) -{ - return CityRankTableBuilder().Parse(str); -} - -unique_ptr GetConstRankCityRankTable(double rank) -{ - return unique_ptr(new ConstCityRankTable(rank)); -} - -} // namespace drule diff --git a/indexer/drules_city_rank_table.hpp b/indexer/drules_city_rank_table.hpp deleted file mode 100644 index b43d7cb3f3..0000000000 --- a/indexer/drules_city_rank_table.hpp +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -#include "std/string.hpp" -#include "std/unique_ptr.hpp" - -namespace drule -{ - -class ICityRankTable -{ -public: - virtual ~ICityRankTable() = default; - virtual bool GetCityRank(uint32_t zoomLevel, uint32_t population, double & rank) const = 0; -}; - -// Parses string and returns city-rank table which corresponds to string -// String format similar to mapcss format: -// z[ZOOMLEVEL_FROM]-[ZOOMLEVEL_TP] -// { -// [POPULATION_FROMn]-[POPULATION_TOn]:RANKn; -// } -// -// z[ZOOMLEVEL_FROM]-[ZOOMLEVEL_TO] - specifies zoom range for which population rula is applicable. -// ZOOMLEVEL_FROM and ZOOMLEVEL_TO are non negative integers, ZOOMLEVEL_TO must be not less than -// ZOOMLEVEL_FROM. -// ZOOMLEVEL_FROM may be omitted, then ZOOMLEVEL_FROM is 0 -// ZOOMLEVEL_TO may be omitted, then ZOOMLEVEL_TO is UPPER_SCALE -// if ZOOMLEVEL_FROM equals to ZOOMLEVEL_TO then z can be rewritten as z[ZOOMLEVEL] -// -// [POPULATION_FROMn]-[POPULATION_TOn]:RANKn; - specifies population range and city rank. -// POPULATION_FROMn and POPULATION_TOn are non negative integers, POPULATION_TOn must be not less than -// POPULATION_FROMn. -// Similarly, POPULATION_FROMn can be ommited then, POPULATION_FROMn is 0 -// POPULATION_TOn also can be ommited then POPULATION_FROMn is MAX_UINT -// RANKn is float value. if RANKn is less than 0 then population scope is not drawn, -// if RANKn is 0 then city will be drawn as it specified in mapcss -// if RANKn is more than 0 then font size will be (1.0 + RANKn) * fontSizeInMapcss -// -// Example is: -// z-3 { -10000:-1; 10000-:0; } -// z4 { -10000:0; 10000-:0.5; } -// z5-9 { -10000:0; 10000-100000:0.5;100000-:0.75; } -// z10- { -10000:0.5; 10000-100000:0.75;100000-:1; } - -// Returns city-rank-table if str matches to format, otherwise returns nullptr -unique_ptr GetCityRankTableFromString(string & str); - -// Returns city-rank-table which returns constant rank for any zoom and population. -unique_ptr GetConstRankCityRankTable(double rank = 0.0); - -} // namespace drule diff --git a/indexer/indexer.pro b/indexer/indexer.pro index 61b3e66101..712e09fc2f 100644 --- a/indexer/indexer.pro +++ b/indexer/indexer.pro @@ -18,7 +18,6 @@ SOURCES += \ data_header.cpp \ drawing_rule_def.cpp \ drawing_rules.cpp \ - drules_city_rank_table.cpp \ drules_selector.cpp \ drules_selector_parser.cpp \ feature.cpp \ @@ -60,7 +59,6 @@ HEADERS += \ data_header.hpp \ drawing_rule_def.hpp \ drawing_rules.hpp \ - drules_city_rank_table.hpp \ drules_include.hpp \ drules_selector.cpp \ drules_selector_parser.cpp \ diff --git a/indexer/indexer_tests/city_rank_table_test.cpp b/indexer/indexer_tests/city_rank_table_test.cpp deleted file mode 100644 index 7ad40e17f0..0000000000 --- a/indexer/indexer_tests/city_rank_table_test.cpp +++ /dev/null @@ -1,132 +0,0 @@ -#include "testing/testing.hpp" - -#include "indexer/drules_city_rank_table.hpp" - -UNIT_TEST(TestCityRankTableParser) -{ - string s = - "z-4{\n" - "-10000:0.25;\n" - "10000-1000000:0.5;\n}\n" - " z5 { 1000-10000 : -1; } " - "z6-15{\n" - "-10000:0.25;\n" - "10000-:0.5;\n}\n" - "z16-{\n" - "-10000:0.25;\n" - "10000-10000000:0.5;\n}\n"; - - unique_ptr table = drule::GetCityRankTableFromString(s); - TEST(nullptr != table.get(), ()); - - double rank = 0.0; - - // test zoom > 19 - - // test there is no rank for zoom > 19 - TEST_EQUAL(false, table->GetCityRank(20, 100000, rank), ()); - - // test zoom 0-4 - - // test there is 0.25 rank for city with population = 5K and zoom = 3 - TEST_EQUAL(true, table->GetCityRank(3, 5000, rank), ()); - TEST_EQUAL(0.25, rank, ()); - - // test there is 0.5 rank for city with population = 50K and zoom = 3 - TEST_EQUAL(true, table->GetCityRank(3, 50000, rank), ()); - TEST_EQUAL(0.5, rank, ()); - - // test there is no rank for city with population = 5M and zoom = 3 - TEST_EQUAL(false, table->GetCityRank(3, 50000000, rank), ()); - - // test zoom 5 - - // test there is no rank for city with population = 500 and zoom = 5 - TEST_EQUAL(false, table->GetCityRank(5, 500, rank), ()); - - // test there is -1 rank for city with population = 5K and zoom = 5 - TEST_EQUAL(true, table->GetCityRank(5, 5000, rank), ()); - TEST_EQUAL(-1.0, rank, ()); - - // test there is no rank for city with population = 50K and zoom = 5 - TEST_EQUAL(false, table->GetCityRank(5, 50000, rank), ()); - - // test zoom 6-15 - - // test there is 0.25 rank for city with population = 5K and zoom = 9 - TEST_EQUAL(true, table->GetCityRank(9, 5000, rank), ()); - TEST_EQUAL(0.25, rank, ()); - - // test there is 0.5 rank for city with population = 50K and zoom = 9 - TEST_EQUAL(true, table->GetCityRank(9, 50000, rank), ()); - TEST_EQUAL(0.5, rank, ()); - - // test zoom 16-19 - - // test there is 0.25 rank for city with population = 5K and zoom = 17 - TEST_EQUAL(true, table->GetCityRank(17, 5000, rank), ()); - TEST_EQUAL(0.25, rank, ()); - - // test there is 0.5 rank for city with population = 50K and zoom = 17 - TEST_EQUAL(true, table->GetCityRank(17, 50000, rank), ()); - TEST_EQUAL(0.5, rank, ()); - - // test there is no rank for city with population = 50M and zoom = 17 - TEST_EQUAL(false, table->GetCityRank(17, 50000000, rank), ()); -} - -UNIT_TEST(TestCityRankTableParserInvalidString1) -{ - string s = "z-5{bad_format;}"; - - unique_ptr table = drule::GetCityRankTableFromString(s); - TEST(nullptr == table.get(), ()); -} - -UNIT_TEST(TestCityRankTableParserInvalidString2) -{ - string s = "z-5{0-1000:0.25;} zBadFormat{}"; - - unique_ptr table = drule::GetCityRankTableFromString(s); - TEST(nullptr == table.get(), ()); -} - -UNIT_TEST(TestCityRankTableWithEmptyPopulation1) -{ - string s = "z-5 {} z6-9 {;;;1000-10000:0.25;;;}\n" - "z10-{ -:3.5;;; }"; - - unique_ptr table = drule::GetCityRankTableFromString(s); - TEST(nullptr != table.get(), ()); - - double rank = 0.0; - - // there is no rank for zoom 0-5 - TEST_EQUAL(false, table->GetCityRank(3, 100000, rank), ()); - - // there is no rank for zoom 6-9 and population 100 - TEST_EQUAL(false, table->GetCityRank(7, 100, rank), ()); - - // there is 0.25 rank for zoom 6-9 and population 5000 - TEST_EQUAL(true, table->GetCityRank(7, 5000, rank), ()); - TEST_EQUAL(0.25, rank, ()); - - // there is no rank for zoom 6-9 and population 15000 - TEST_EQUAL(false, table->GetCityRank(7, 15000, rank), ()); - - // there is 3.5 rank for zoom 10+ and any population - TEST_EQUAL(true, table->GetCityRank(17, 1, rank), ()); - TEST_EQUAL(3.5, rank, ()); -} - -UNIT_TEST(TestCityRankTableWithEmptyPopulation2) -{ - string s = "z0-20 {}"; - - unique_ptr table = drule::GetCityRankTableFromString(s); - TEST(nullptr != table.get(), ()); - - // there is no any rank - double rank = 0.0; - TEST_EQUAL(false, table->GetCityRank(3, 100000, rank), ()); -} diff --git a/indexer/indexer_tests/indexer_tests.pro b/indexer/indexer_tests/indexer_tests.pro index ff56761665..23f1c86e8d 100644 --- a/indexer/indexer_tests/indexer_tests.pro +++ b/indexer/indexer_tests/indexer_tests.pro @@ -27,7 +27,6 @@ SOURCES += \ cell_coverer_test.cpp \ cell_id_test.cpp \ checker_test.cpp \ - city_rank_table_test.cpp \ drules_selector_parser_test.cpp \ features_offsets_table_test.cpp \ geometry_coding_test.cpp \ diff --git a/render/cpu_drawer.cpp b/render/cpu_drawer.cpp index 1d49de868e..54fd15f6f9 100644 --- a/render/cpu_drawer.cpp +++ b/render/cpu_drawer.cpp @@ -615,21 +615,16 @@ void CPUDrawer::CallTextRendererFn(TextShape const * shape, TTextRendererCall co ASSERT(shape->m_drawRule.m_rule->GetCaption(0) != nullptr, ()); di::FeatureStyler const & fs = GetInfo(shape->m_geomID, m_stylers); - if (fs.m_popRank < 0.0) - return; // do not draw - CaptionDefProto const * primCaption = shape->m_drawRule.m_rule->GetCaption(0); CaptionDefProto const * secCaption = shape->m_drawRule.m_rule->GetCaption(1); graphics::FontDesc primFont, secFont; m2::PointD primOffset, secOffset; ConvertStyle(primCaption, VisualScale(), primFont, primOffset); - primFont.SetRank(fs.m_popRank); CorrectFont(primFont); if (secCaption != nullptr) { ConvertStyle(secCaption, VisualScale(), secFont, secOffset); - secFont.SetRank(fs.m_popRank); CorrectFont(secFont); } diff --git a/render/drawer.cpp b/render/drawer.cpp index 8c997ebafd..ef380ff017 100644 --- a/render/drawer.cpp +++ b/render/drawer.cpp @@ -64,12 +64,6 @@ void Drawer::GenerateRoadNumbers(di::PathInfo const & path, graphics::FontDesc c void Drawer::Draw(di::FeatureInfo const & fi) { - // [STYLES_HARDCODE] If city population rank is less than zero then - // do not draw node name and node point - if (fi.m_styler.m_geometryType == feature::GEOM_POINT && - fi.m_styler.m_popRank < 0.0) - return; - DrawFeatureStart(fi.m_id); buffer_vector const & rules = fi.m_styler.m_rules; diff --git a/render/feature_styler.cpp b/render/feature_styler.cpp index 368afb33bf..041be2abde 100644 --- a/render/feature_styler.cpp +++ b/render/feature_styler.cpp @@ -110,14 +110,6 @@ namespace di uint32_t const population = ftypes::GetPopulation(f); - // [STYLE_HARDCODE] Calculate population rank for cities and towns only. - // It affects font size. If population rank is less than zero, feature is not drawn. - ftypes::Type const localityType = ftypes::IsLocalityChecker::Instance().GetType(f); - if (localityType == ftypes::CITY || localityType == ftypes::TOWN) - m_popRank = drule::rules().GetCityRank(zoom, population); - else - m_popRank = 0.0; - double area = 0.0; if (m_geometryType != feature::GEOM_POINT) { diff --git a/render/feature_styler.hpp b/render/feature_styler.hpp index 0bfcd52424..842b014746 100644 --- a/render/feature_styler.hpp +++ b/render/feature_styler.hpp @@ -62,8 +62,6 @@ namespace di ScreenBase const * m_convertor; m2::RectD const * m_rect; - double m_popRank; - bool IsEmpty() const; string const GetPathName() const; diff --git a/render/gpu_drawer.cpp b/render/gpu_drawer.cpp index c334fac56b..9e3efec2b4 100644 --- a/render/gpu_drawer.cpp +++ b/render/gpu_drawer.cpp @@ -196,21 +196,14 @@ void GPUDrawer::DrawText(m2::PointD const & pt, di::FeatureStyler const & fs, di::DrawRule const & rule) { - if (fs.m_popRank < 0.0) - return; // do not draw - graphics::FontDesc primaryFont; m2::PointD primaryOffset; ConvertStyle(rule.m_rule->GetCaption(0), VisualScale(), primaryFont, primaryOffset); - primaryFont.SetRank(fs.m_popRank); graphics::FontDesc secondaryFont; m2::PointD secondaryOffset; if (rule.m_rule->GetCaption(1)) - { ConvertStyle(rule.m_rule->GetCaption(1), VisualScale(), secondaryFont, secondaryOffset); - secondaryFont.SetRank(fs.m_popRank); - } graphics::StraightTextElement::Params params; params.m_depth = rule.m_depth;