diff --git a/SLNKDWF.sln b/SLNKDWF.sln index 8ed722d..d447d1c 100644 --- a/SLNKDWF.sln +++ b/SLNKDWF.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B0573FCD-8E98-421C-8BA3-F47CEB1F1047}" EndProject @@ -26,114 +26,40 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QRCode", "QRCode\QRCode.vcx EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 - Release|Mixed Platforms = Release|Mixed Platforms - Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B2601E72-4FF4-4B9C-A89F-C2E7DACF36FD}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {B2601E72-4FF4-4B9C-A89F-C2E7DACF36FD}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {B2601E72-4FF4-4B9C-A89F-C2E7DACF36FD}.Debug|Win32.ActiveCfg = Debug|Win32 {B2601E72-4FF4-4B9C-A89F-C2E7DACF36FD}.Debug|x64.ActiveCfg = Debug|x64 {B2601E72-4FF4-4B9C-A89F-C2E7DACF36FD}.Debug|x64.Build.0 = Debug|x64 - {B2601E72-4FF4-4B9C-A89F-C2E7DACF36FD}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {B2601E72-4FF4-4B9C-A89F-C2E7DACF36FD}.Release|Mixed Platforms.Build.0 = Release|Win32 - {B2601E72-4FF4-4B9C-A89F-C2E7DACF36FD}.Release|Win32.ActiveCfg = Release|Win32 - {B2601E72-4FF4-4B9C-A89F-C2E7DACF36FD}.Release|Win32.Build.0 = Release|Win32 {B2601E72-4FF4-4B9C-A89F-C2E7DACF36FD}.Release|x64.ActiveCfg = Release|x64 {B2601E72-4FF4-4B9C-A89F-C2E7DACF36FD}.Release|x64.Build.0 = Release|x64 - {6DFC9788-904C-4724-A734-06634061EF00}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {6DFC9788-904C-4724-A734-06634061EF00}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {6DFC9788-904C-4724-A734-06634061EF00}.Debug|Win32.ActiveCfg = Debug|Win32 {6DFC9788-904C-4724-A734-06634061EF00}.Debug|x64.ActiveCfg = Debug|x64 {6DFC9788-904C-4724-A734-06634061EF00}.Debug|x64.Build.0 = Debug|x64 - {6DFC9788-904C-4724-A734-06634061EF00}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {6DFC9788-904C-4724-A734-06634061EF00}.Release|Mixed Platforms.Build.0 = Release|Win32 - {6DFC9788-904C-4724-A734-06634061EF00}.Release|Win32.ActiveCfg = Release|Win32 - {6DFC9788-904C-4724-A734-06634061EF00}.Release|Win32.Build.0 = Release|Win32 {6DFC9788-904C-4724-A734-06634061EF00}.Release|x64.ActiveCfg = Release|x64 {6DFC9788-904C-4724-A734-06634061EF00}.Release|x64.Build.0 = Release|x64 - {92F5EB69-069C-43EA-97E7-2F6507AA5873}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {92F5EB69-069C-43EA-97E7-2F6507AA5873}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {92F5EB69-069C-43EA-97E7-2F6507AA5873}.Debug|Win32.ActiveCfg = Debug|Win32 {92F5EB69-069C-43EA-97E7-2F6507AA5873}.Debug|x64.ActiveCfg = Debug|x64 - {92F5EB69-069C-43EA-97E7-2F6507AA5873}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {92F5EB69-069C-43EA-97E7-2F6507AA5873}.Release|Mixed Platforms.Build.0 = Release|Win32 - {92F5EB69-069C-43EA-97E7-2F6507AA5873}.Release|Win32.ActiveCfg = Release|Win32 {92F5EB69-069C-43EA-97E7-2F6507AA5873}.Release|x64.ActiveCfg = Release|x64 - {2F492A95-A23D-45C9-BBD9-E5B9325B22C1}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {2F492A95-A23D-45C9-BBD9-E5B9325B22C1}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {2F492A95-A23D-45C9-BBD9-E5B9325B22C1}.Debug|Win32.ActiveCfg = Debug|Win32 {2F492A95-A23D-45C9-BBD9-E5B9325B22C1}.Debug|x64.ActiveCfg = Debug|x64 - {2F492A95-A23D-45C9-BBD9-E5B9325B22C1}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {2F492A95-A23D-45C9-BBD9-E5B9325B22C1}.Release|Mixed Platforms.Build.0 = Release|Win32 - {2F492A95-A23D-45C9-BBD9-E5B9325B22C1}.Release|Win32.ActiveCfg = Release|Win32 {2F492A95-A23D-45C9-BBD9-E5B9325B22C1}.Release|x64.ActiveCfg = Release|x64 - {18EC7157-E263-458C-A41C-52E9538A642F}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {18EC7157-E263-458C-A41C-52E9538A642F}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {18EC7157-E263-458C-A41C-52E9538A642F}.Debug|Win32.ActiveCfg = Debug|Win32 {18EC7157-E263-458C-A41C-52E9538A642F}.Debug|x64.ActiveCfg = Debug|x64 - {18EC7157-E263-458C-A41C-52E9538A642F}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {18EC7157-E263-458C-A41C-52E9538A642F}.Release|Mixed Platforms.Build.0 = Release|Win32 - {18EC7157-E263-458C-A41C-52E9538A642F}.Release|Win32.ActiveCfg = Release|Win32 {18EC7157-E263-458C-A41C-52E9538A642F}.Release|x64.ActiveCfg = Release|x64 - {CF524F70-4DDD-4040-803B-41B5DE7B1CF9}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {CF524F70-4DDD-4040-803B-41B5DE7B1CF9}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {CF524F70-4DDD-4040-803B-41B5DE7B1CF9}.Debug|Win32.ActiveCfg = Debug|Win32 {CF524F70-4DDD-4040-803B-41B5DE7B1CF9}.Debug|x64.ActiveCfg = Debug|x64 - {CF524F70-4DDD-4040-803B-41B5DE7B1CF9}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {CF524F70-4DDD-4040-803B-41B5DE7B1CF9}.Release|Mixed Platforms.Build.0 = Release|Win32 - {CF524F70-4DDD-4040-803B-41B5DE7B1CF9}.Release|Win32.ActiveCfg = Release|Win32 {CF524F70-4DDD-4040-803B-41B5DE7B1CF9}.Release|x64.ActiveCfg = Release|x64 - {7F9F1060-C14D-4DD5-91D3-FA7263FECF5E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {7F9F1060-C14D-4DD5-91D3-FA7263FECF5E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {7F9F1060-C14D-4DD5-91D3-FA7263FECF5E}.Debug|Win32.ActiveCfg = Debug|Win32 - {7F9F1060-C14D-4DD5-91D3-FA7263FECF5E}.Debug|Win32.Build.0 = Debug|Win32 {7F9F1060-C14D-4DD5-91D3-FA7263FECF5E}.Debug|x64.ActiveCfg = Debug|x64 {7F9F1060-C14D-4DD5-91D3-FA7263FECF5E}.Debug|x64.Build.0 = Debug|x64 - {7F9F1060-C14D-4DD5-91D3-FA7263FECF5E}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {7F9F1060-C14D-4DD5-91D3-FA7263FECF5E}.Release|Mixed Platforms.Build.0 = Release|Win32 - {7F9F1060-C14D-4DD5-91D3-FA7263FECF5E}.Release|Win32.ActiveCfg = Release|Win32 - {7F9F1060-C14D-4DD5-91D3-FA7263FECF5E}.Release|Win32.Build.0 = Release|Win32 {7F9F1060-C14D-4DD5-91D3-FA7263FECF5E}.Release|x64.ActiveCfg = Release|x64 {7F9F1060-C14D-4DD5-91D3-FA7263FECF5E}.Release|x64.Build.0 = Release|x64 - {6EA5FCEC-1DB0-4542-8E41-9423021BD460}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {6EA5FCEC-1DB0-4542-8E41-9423021BD460}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {6EA5FCEC-1DB0-4542-8E41-9423021BD460}.Debug|Win32.ActiveCfg = Debug|Win32 - {6EA5FCEC-1DB0-4542-8E41-9423021BD460}.Debug|Win32.Build.0 = Debug|Win32 {6EA5FCEC-1DB0-4542-8E41-9423021BD460}.Debug|x64.ActiveCfg = Debug|x64 {6EA5FCEC-1DB0-4542-8E41-9423021BD460}.Debug|x64.Build.0 = Debug|x64 - {6EA5FCEC-1DB0-4542-8E41-9423021BD460}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {6EA5FCEC-1DB0-4542-8E41-9423021BD460}.Release|Mixed Platforms.Build.0 = Release|Win32 - {6EA5FCEC-1DB0-4542-8E41-9423021BD460}.Release|Win32.ActiveCfg = Release|Win32 - {6EA5FCEC-1DB0-4542-8E41-9423021BD460}.Release|Win32.Build.0 = Release|Win32 {6EA5FCEC-1DB0-4542-8E41-9423021BD460}.Release|x64.ActiveCfg = Release|x64 {6EA5FCEC-1DB0-4542-8E41-9423021BD460}.Release|x64.Build.0 = Release|x64 - {0E49D578-377F-4C07-8339-8737AA9FA0EC}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {0E49D578-377F-4C07-8339-8737AA9FA0EC}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {0E49D578-377F-4C07-8339-8737AA9FA0EC}.Debug|Win32.ActiveCfg = Debug|Win32 - {0E49D578-377F-4C07-8339-8737AA9FA0EC}.Debug|Win32.Build.0 = Debug|Win32 {0E49D578-377F-4C07-8339-8737AA9FA0EC}.Debug|x64.ActiveCfg = Debug|x64 {0E49D578-377F-4C07-8339-8737AA9FA0EC}.Debug|x64.Build.0 = Debug|x64 - {0E49D578-377F-4C07-8339-8737AA9FA0EC}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {0E49D578-377F-4C07-8339-8737AA9FA0EC}.Release|Mixed Platforms.Build.0 = Release|Win32 - {0E49D578-377F-4C07-8339-8737AA9FA0EC}.Release|Win32.ActiveCfg = Release|Win32 - {0E49D578-377F-4C07-8339-8737AA9FA0EC}.Release|Win32.Build.0 = Release|Win32 {0E49D578-377F-4C07-8339-8737AA9FA0EC}.Release|x64.ActiveCfg = Release|x64 {0E49D578-377F-4C07-8339-8737AA9FA0EC}.Release|x64.Build.0 = Release|x64 - {3EA5B7D3-EA9B-420B-B283-0D92E620B970}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {3EA5B7D3-EA9B-420B-B283-0D92E620B970}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {3EA5B7D3-EA9B-420B-B283-0D92E620B970}.Debug|Win32.ActiveCfg = Debug|Win32 - {3EA5B7D3-EA9B-420B-B283-0D92E620B970}.Debug|Win32.Build.0 = Debug|Win32 {3EA5B7D3-EA9B-420B-B283-0D92E620B970}.Debug|x64.ActiveCfg = Debug|x64 {3EA5B7D3-EA9B-420B-B283-0D92E620B970}.Debug|x64.Build.0 = Debug|x64 - {3EA5B7D3-EA9B-420B-B283-0D92E620B970}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {3EA5B7D3-EA9B-420B-B283-0D92E620B970}.Release|Mixed Platforms.Build.0 = Release|Win32 - {3EA5B7D3-EA9B-420B-B283-0D92E620B970}.Release|Win32.ActiveCfg = Release|Win32 - {3EA5B7D3-EA9B-420B-B283-0D92E620B970}.Release|Win32.Build.0 = Release|Win32 {3EA5B7D3-EA9B-420B-B283-0D92E620B970}.Release|x64.ActiveCfg = Release|x64 {3EA5B7D3-EA9B-420B-B283-0D92E620B970}.Release|x64.Build.0 = Release|x64 EndGlobalSection diff --git a/SlnkDWFCom/SLNKSymbolDefImpl.cpp b/SlnkDWFCom/SLNKSymbolDefImpl.cpp index c7a1718..b89d2b4 100644 --- a/SlnkDWFCom/SLNKSymbolDefImpl.cpp +++ b/SlnkDWFCom/SLNKSymbolDefImpl.cpp @@ -44,6 +44,7 @@ CSLNKSymbolDefinition::CSLNKSymbolDefinition(int count, WT_Logical_Point const * m_wtFile.set_eplotsection(NULL); this->m_dwgScale = 1.0; m_AsBitmap = NULL; + m_hasBitmap = false; m_BoundingContour.m_Units = units; m_BoundingContour.set(count, points, false); m_Origin = CSLNKContourImpl::Centroid(m_BoundingContour); diff --git a/SlnkDWFCom/SLNKSymbolImpl.cpp b/SlnkDWFCom/SLNKSymbolImpl.cpp index 50d94dd..121422e 100644 --- a/SlnkDWFCom/SLNKSymbolImpl.cpp +++ b/SlnkDWFCom/SLNKSymbolImpl.cpp @@ -45,12 +45,15 @@ WT_Result CSLNKSymbolImpl::serialize (WT_File & file, WT_Units & units, file.desired_rendition().fill() = file.rendition().fill() = WT_Fill(); WT_Font default_font; - default_font.width_scale() = 0; // Triggert FONT_WIDTH_SCALE_BIT bitje zetten - default_font.rotation() = 0; - default_font.height() = 0; - default_font.flags() = 0; - default_font.serialize(file); // Op de default zetten. - file.desired_rendition().font() = file.rendition().font() = default_font; + if (!this->m_unicode.length()) + { + default_font.width_scale() = 0; // Triggert FONT_WIDTH_SCALE_BIT bitje zetten + default_font.rotation() = 0; + default_font.height() = 0; + default_font.flags() = 0; + default_font.serialize(file); // Op de default zetten. + file.desired_rendition().font() = file.rendition().font() = default_font; + } WT_Point3D insertion(m_dwgX, m_dwgY); @@ -136,6 +139,24 @@ WT_Result CSLNKSymbolImpl::serialize (WT_File & file, WT_Units & units, { // Skip want toch onzichtbaar } + else if (this->m_unicode.length()) + { + if (m_ColorSet) + m_Color.serialize(file); + + // Het roteren en verschalen gebeurt via WT_Transform SymbolTrans + // Een gewijzigde rotatie of schaal maakt dat we een (Font) moeten wegschrijven naar de DWF + // De toolkit snapt echter niet goed dat het nodig is bij gewijzigde Transform, daarom hieronder expliciet + file.desired_rendition().font().height() = 1000; // Zorg dat FONT_HEIGHT_BIT gezet raakt + file.desired_rendition().font().rotation() = 0; // Zorg dat FONT_ROTATION_BIT gezet raakt + file.desired_rendition().font().serialize(file); + + //https://stackoverflow.com/questions/32781414/what-is-the-baseline-font-height-of-fontawesome-font + // Waarom moet ik hier 125 gebruiken? Omdat dat in de svg descent (64) / units-per-em (512) is! + WT_Text my_text(WT_Logical_Point(0, 125), this->m_unicode); + // het font is in CWhipFile::GenerateSymbols al goed gezet + my_text.serialize(file); + } else symbdef->serialize(file, m_Color, m_ColorSet, myRound(m_Lineweight * scale)); @@ -193,8 +214,11 @@ WT_Result CSLNKSymbolImpl::serialize (WT_File & file, WT_Units & units, WT_Fill().serialize(file); // Ook op de default zetten. file.desired_rendition().fill() = file.rendition().fill() = WT_Fill(); - default_font.serialize(file); // Ook op de default zetten. - file.desired_rendition().font() = file.rendition().font() = default_font; + if (!this->m_unicode.length()) + { + default_font.serialize(file); // Ook op de default zetten. + file.desired_rendition().font() = file.rendition().font() = default_font; + } file.heuristics().set_apply_transform(WD_False); // Hebben we al rechtstreeks op de contour gedaan m_SLNKContour.serialize(file, node_num, true, forFind, scale); diff --git a/SlnkDWFCom/SLNKSymbolImpl.h b/SlnkDWFCom/SLNKSymbolImpl.h index accbd96..3e67fe1 100644 --- a/SlnkDWFCom/SLNKSymbolImpl.h +++ b/SlnkDWFCom/SLNKSymbolImpl.h @@ -22,6 +22,7 @@ public: double m_dwgX, m_dwgY; CString m_symbolName; + WT_String m_unicode; int m_Rotation; double m_Scale; CSLNKContourImpl m_SLNKContour; diff --git a/SlnkDWFCom/WhipFile.cpp b/SlnkDWFCom/WhipFile.cpp index 4bbdbd9..7c31866 100644 --- a/SlnkDWFCom/WhipFile.cpp +++ b/SlnkDWFCom/WhipFile.cpp @@ -1016,6 +1016,9 @@ bool CWhipFile::GenerateSymbols(myWT_File &my_file) for (size_t i=0; im_unicode.length()) // die doen we allemaal tegelijk + continue; + if (symbol->m_symbolName == "" || !m_SLNKSymbolDefinitions.Lookup(symbol->m_symbolName)) symbol->serialize(my_file, m_contunits, NULL, m_next_node_num, @@ -1029,6 +1032,62 @@ bool CWhipFile::GenerateSymbols(myWT_File &my_file) m_hintScale, m_forFind, scale); } } + + // + // nu de unicode symbolen + // + tempFontDC myDC("Font Awesome 5 Pro Regular"); // TODO + TEXTMETRIC tm; + int delta = 0; // zo ver moet het karakter nog omhoog om het precies in het midden aan te grijpen + if (GetTextMetrics(myDC, &tm) != 0) + { + delta = MulDiv(tm.tmDescent, FONT_SIZER, tm.tmHeight + 250); // waarom is die 250 nodig om 125 te krijgen? Nu nog hardcoded in SLNKSymbolImpl.cpp + } + int size = ::GetOutlineTextMetricsW(myDC, 0, NULL); // alleen voor TrueType! + if (size != 0) + { + OUTLINETEXTMETRICW *otm = (OUTLINETEXTMETRICW *)new char[size]; + WD_Assert(otm != NULL); + + UINT status = GetOutlineTextMetricsW(myDC, size, otm); + WD_Assert(status != 0); + + delta = otm->otmDescent; + + // if (status != 0) + // logfont.lfHeight = otm->otmEMSquare; + + delete[] otm; + } + + WT_Font myfont; + int fontheight = 1000; // 1000 sluit aan bij onze ingebouwde symbolen + myfont.font_name().set("Font Awesome 5 Pro Regular"); + myfont.height() = fontheight; // echte komt nog wel + myfont.rotation() = 0; + myfont.width_scale() = 0; + myfont.flags() = 0; + my_file.desired_rendition().font() = myfont; + myfont.serialize(my_file); + + for (size_t i = 0; im_unicode.length()) // die doen we nu + { + CString s; s.Format("About to insert symbol %d %s (%s)", m_next_node_num, symbol->m_SLNKContour.m_Key, symbol->m_symbolName); + comment(my_file, s); + symbol->serialize(my_file, m_contunits, m_SLNKSymbolDefinitions[symbol->m_symbolName], + m_next_node_num, + m_hintScale, m_forFind, scale); + } + } + + // Onze labels kunnen later door een achtergrondkleur een polygon hebben + // Zorg dat die niet binnen een node valt + WT_Object_Node my_node(my_file, 0); + my_file.desired_rendition().object_node() = my_node; + return true; } @@ -1137,6 +1196,11 @@ bool CWhipFile::GenerateContouren(WT_File &my_planfile, myWT_File &my_file, my_file.desired_rendition().font() = my_file.rendition().font() = keepFont; keepFont.serialize(my_file); // + // Onze labels kunnen later door een achtergrondkleur een polygon hebben + // Zorg dat die niet binnen een node valt + WT_Object_Node my_node(my_file, 0); + my_file.desired_rendition().object_node() = my_node; + return true; } @@ -1367,15 +1431,29 @@ STDMETHODIMP CWhipFile::get_AddSymbol(DOUBLE dwgX, DOUBLE dwgY, BSTR symbolName, if(FAILED(hr)) return hr; theSymbol->SetImpl(mySymbol); // Heel belangrijk: zet de implementatie waar we een interface op bieden - if (!m_SLNKSymbolDefinitions.Lookup(name)) + if (name[0] == '@') // unicode karakter @0000F134 voor fa-fire-extinguisher + { + long bytes = strtol(name.Mid(1), NULL, 16); + mySymbol->m_unicode.set(4, (WT_Unsigned_Integer16 *) &bytes); + name = "*SQUARE"; // voor de extents + } + else if (!m_SLNKSymbolDefinitions.Lookup(name)) name = "*STAR"; // Die vinden we altijd ja ATLASSERT(m_SLNKSymbolDefinitions.Lookup(name)); mySymbol->m_symbolName = name; mySymbol->m_SLNKContour.set(m_SLNKSymbolDefinitions[name]->m_BoundingContour.count(), m_SLNKSymbolDefinitions[name]->m_BoundingContour.points(), true); // TODO: Is copy wel nodig?==>Ja, we gaan ze later transformeren! + // De voorgedefinieerde symbolen hebben alleen maar een contour. Die activeren we hier - if (name[0] == '*') + if (mySymbol->m_unicode.length()) + { + mySymbol->m_SLNKContour.m_Color = WT_Color(0, 0, 0, 0); // de square zelf willen we niet zien +#ifdef _DEBUG + mySymbol->m_SLNKContour.m_outlineColor = WT_Color(255, 0, 0, 64); // Even met outline +#endif + } + else if (name[0] == '*') { // Default rood mySymbol->m_SLNKContour.m_Color = WT_Color(255,0,0,255); diff --git a/SlnkDWFImpl/SLNKContourImpl.cpp b/SlnkDWFImpl/SLNKContourImpl.cpp index 3c075f8..85d04ae 100644 --- a/SlnkDWFImpl/SLNKContourImpl.cpp +++ b/SlnkDWFImpl/SLNKContourImpl.cpp @@ -609,6 +609,8 @@ CSize CSLNKContourImpl::DrawOneLabel(WT_File &my_file, else { // Use UNICODE for example for Michaël CStringW s(token); + //s = L"Buro euro \u20AC pin \U0001F4CD star: \u2733 snowman: \u2603 facepalm \U0001F926"; + //s = L"FontAwesome pin \U0000e002 fire \U0000F134"; txt.set(s.GetLength(), s); } diff --git a/SlnkDWFImpl/SLNKDWFStaticRW.vcxproj b/SlnkDWFImpl/SLNKDWFStaticRW.vcxproj index 54c4a4d..f094c60 100644 --- a/SlnkDWFImpl/SLNKDWFStaticRW.vcxproj +++ b/SlnkDWFImpl/SLNKDWFStaticRW.vcxproj @@ -148,7 +148,7 @@ - cximage.lib;jpeg.lib;png.lib;tiff.lib;dwfcore.1.7.0.lib;dwftk.7.7.0.lib;whiptk.7.13.601.lib;msimg32.lib;%(AdditionalDependencies) + cximage.lib;jpeg.lib;png.lib;dwfcore.1.7.0.lib;dwftk.7.7.0.lib;whiptk.7.13.601.lib;msimg32.lib;%(AdditionalDependencies) cximage/lib/x64/$(Configuration);$(DWFTKPATH)\lib\x64\static\$(Configuration)\vc14.0;%(AdditionalLibraryDirectories) @@ -246,7 +246,7 @@ - cximage.lib;jpeg.lib;png.lib;tiff.lib;dwfcore.1.7.0.lib;dwftk.7.7.0.lib;whiptk.7.13.601.lib;msimg32.lib;%(AdditionalDependencies) + cximage.lib;jpeg.lib;png.lib;dwfcore.1.7.0.lib;dwftk.7.7.0.lib;whiptk.7.13.601.lib;msimg32.lib;%(AdditionalDependencies) cximage/lib/x64/$(Configuration);$(DWFTKPATH)\lib\x64\static\$(Configuration)\vc14.0;%(AdditionalLibraryDirectories) diff --git a/SlnkDWFImpl/Whip2DCImpl.cpp b/SlnkDWFImpl/Whip2DCImpl.cpp index ca87d81..dd0281c 100644 --- a/SlnkDWFImpl/Whip2DCImpl.cpp +++ b/SlnkDWFImpl/Whip2DCImpl.cpp @@ -1038,7 +1038,8 @@ CString CWhip2DCImpl::PolyToMap(WT_Polygon & polygon, // ttl = objKey; // Is dit wel zo logisch/wenselijk? ttl.Replace("\\n", "\n"); - Title.Format("title=\"%s\"", ttl); + if (ttl.GetLength()) + Title.Format(" title=\"%s\"", ttl); CString smbl = ""; if (objKey != "") @@ -1050,8 +1051,11 @@ CString CWhip2DCImpl::PolyToMap(WT_Polygon & polygon, smbl.Format(" SLNKKey=\"%s\"", objKey); } + if (smbl == "" && Title == "" && Href == "") // Area zonder iets interessants gewoon achterwege laten + return ""; + CString Builder; - Builder.Format("\n", + Builder.Format("\n", smbl, Title, shape, Coords, Href); return Builder; };