[mapguide-users] extended characters with .NET
Dave Wilson
dave.wilson at autodesk.com
Fri Mar 13 12:52:45 EDT 2009
Have you tried the MSGothic or PGothic type fonts?
Dave
________________________________________
From: mapguide-users-bounces at lists.osgeo.org [mapguide-users-bounces at lists.osgeo.org] On Behalf Of Darren Karasiuk [darren.karasiuk at aldatasoftware.com]
Sent: Friday, March 13, 2009 10:20 AM
To: 'MapGuide Users Mail List'
Subject: RE: [mapguide-users] extended characters with .NET
Well, I'm still having trouble with getting characters above 127 to work
with .NET. I've tried using different fonts but the images don't appear on
the map. (-.-;)
I've searched for symbol resources but couldn't find any. Is there an easy
way of making a symbol without having MapGuide Enterprise?
-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Aldata
Sent: March 11, 2009 4:50 PM
To: mapguide-users at lists.osgeo.org
Subject: [mapguide-users] extended characters with .NET
Hi everyone,
I have a problem with using extended characters with fonts.
When I create a layer with Autodesk Map Guide Studio and use a Wingdings
arrow as the point style, there is no problem.
I load the exported xml layer.definition in my .NET application, change the
filter, save the resource, and add the layer to the the map. At this point,
the data loads and plots successfully, but the point style that is expected
to be an arrow, is now a picture of hand holding a pen, the equivalent of a
the question mark (?) in a normal text font.
I figure it's .NET converting the UTF-8 character into ASCII or UNICODE that
is trouble. The Webdings font works fine up until character decimal 127.
After that, the hand holding a pen again.
I tried to use the notation & #xE9; (space added so webpage doesn't
interpret) but again, no go. I also tried the decimal version with no
success.
How can I load, edit, and output layer.definition containing extended
characters using .NET?
What I have:
Dim layerXMLDoc As XmlDocument = New XmlDocument()
Dim XMLDocPath As String =
Server.MapPath("layerdef\trucks.LayerDefinition.xml")
Dim sr As New IO.StreamReader(XMLDocPath, System.Text.Encoding.UTF8)
layerXMLDoc.LoadXml(sr.ReadToEnd())
sr.Close()
...
Dim newLayer As MgLayer = add_layer_definition_to_map(layerXMLDoc.OuterXml,
"layer-eq" + EquipmentList.SelectedValue.ToString,
EquipmentList.SelectedItem.ToString)
....
-----
This function was more or less copied from the api documents which receives
the layerXMLDoc as the first parameter. Is the problem with out it's
passed?
Public Function add_layer_definition_to_map(ByVal layerDefinition As
String, ByVal layerName As String, ByVal layerLegendLabel As String) As
MgLayer
'Validate the XML
Dim XmlDoc As New XmlDocument
XmlDoc.LoadXml(layerDefinition)
'don't understand validation yet
Dim encoding As New System.Text.ASCIIEncoding() ' Is the problem
here???
Dim byteSource As New
MgByteSource(encoding.GetBytes(layerDefinition.ToString),
layerDefinition.Length)
byteSource.SetMimeType(MgMimeType.Xml)
....
-------
Thanks for your time!
--
View this message in context:
http://n2.nabble.com/extended-characters-with-.NET-tp2464283p2464283.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
More information about the mapguide-users
mailing list