1 #ifndef OSMSCOUT_MAP_MAPPAINTERSVG_H 2 #define OSMSCOUT_MAP_MAPPAINTERSVG_H 28 #include <unordered_map> 30 #include <osmscout/MapSVGFeatures.h> 32 #if defined(OSMSCOUT_MAP_SVG_HAVE_LIB_PANGO) 33 #include <pango/pangoft2.h> 44 #if defined(OSMSCOUT_MAP_SVG_HAVE_LIB_PANGO) 47 struct StandaloneGlyph {
48 std::shared_ptr<PangoFont> font;
49 std::shared_ptr<PangoGlyphString> glyphString;
50 std::string character;
56 using FontMap = std::unordered_map<size_t,PangoFontDescription*> ;
57 PangoFontMap *pangoFontMap;
58 PangoContext *pangoContext;
69 static constexpr
double AverageCharacterWidth = 0.75;
83 std::map<FillStyle,std::string> fillStyleNameMap;
84 std::map<BorderStyle,std::string> borderStyleNameMap;
85 std::map<LineStyle,std::string> lineStyleNameMap;
91 std::vector<std::string> images;
94 std::string GetColorValue(
const Color& color);
98 std::shared_ptr<SvgLabel> Layout(
const Projection& projection,
99 const MapParameter& parameter,
100 const std::string& text,
103 bool enableWrapping =
false,
104 bool contourLabel =
false);
107 const MapParameter& parameter,
113 const MapParameter ¶meter,
115 const std::vector<SvgGlyph> &glyphs);
117 #if defined(OSMSCOUT_MAP_SVG_HAVE_LIB_PANGO) 118 PangoFontDescription* GetFont(
const Projection& projection,
119 const MapParameter& parameter,
127 void WriteHeader(
size_t width,
size_t height);
129 const MapParameter& parameter,
133 void StartMainGroup();
134 void FinishMainGroup();
136 std::string StrEscape(
const std::string &str)
const;
139 const MapParameter& parameter);
142 void AfterPreprocessing(
const StyleConfig& styleConfig,
144 const MapParameter& parameter,
145 const MapData& data)
override;
149 const MapParameter& parameter,
150 const MapData& data)
override;
154 const MapParameter& parameter,
155 const MapData& data)
override;
159 const MapParameter& parameter,
162 double GetFontHeight(
const Projection& projection,
163 const MapParameter& parameter,
164 double fontSize)
override;
167 const MapParameter& parameter,
174 virtual void RegisterRegularLabel(
const Projection &projection,
175 const MapParameter ¶meter,
176 const std::vector<LabelData> &labels,
177 const Vertex2D &position,
178 double objectWidth)
override;
183 virtual void RegisterContourLabel(
const Projection &projection,
184 const MapParameter ¶meter,
189 const MapParameter& parameter,
190 const MapData& data)
override;
193 const MapParameter& parameter,
195 double x,
double y)
override;
198 double centerX,
double centerY,
199 double width,
double height)
override;
202 const MapParameter& parameter,
205 const std::vector<double>& dash,
208 size_t transStart,
size_t transEnd)
override;
211 const MapParameter& parameter,
212 const std::string& styleName,
213 const std::optional<Color> &colorOverride,
217 size_t transStart,
size_t transEnd);
219 void DrawWayOutline(
const StyleConfig& styleConfig,
221 const MapParameter& parameter,
226 const MapParameter& parameter,
229 void DrawContourSymbol(
const Projection& projection,
230 const MapParameter& parameter,
233 size_t transStart,
size_t transEnd)
override;
236 const MapParameter& parameter,
245 const MapParameter& parameter,
247 std::ostream& stream);
Definition: LabelLayouter.h:144
std::shared_ptr< FillStyle > FillStyleRef
Definition: Styles.h:349
Index selectors by type and level.
Definition: StyleConfig.h:553
Definition: LabelLayouter.h:87
std::string character
Definition: MapPainterSVG.h:65
Definition: LabelLayouter.h:172
std::shared_ptr< BorderStyle > BorderStyleRef
Definition: Styles.h:458
double height
Definition: MapPainterSVG.h:67
Definition: Projection.h:43
Definition: MapPainter.h:75
std::shared_ptr< PathTextStyle > PathTextStyleRef
Definition: Styles.h:877
Definition: Styles.h:1135
Definition: LabelPath.h:42
Definition: LabelLayouter.h:98
std::shared_ptr< StyleConfig > StyleConfigRef
Definition: StyleConfig.h:849
Definition: MapPainter.h:87
Definition: LabelLayouter.h:129
Definition: MapPainter.h:114
#define OSMSCOUT_MAP_SVG_API
Definition: MapSVGImportExport.h:45
Definition: MapPainterSVG.h:64
std::wstring NativeLabel
Definition: MapPainterSVG.h:63
std::shared_ptr< TypeConfig > TypeConfigRef
Definition: TypeConfig.h:1227
Definition: MapPainter.h:179
double width
Definition: MapPainterSVG.h:66
CapStyle
Definition: Styles.h:69
Definition: MapPainterSVG.h:42