Symbols in MapXtreme Java
Just a quick note on how MapXtreme Java MDFs hold a reference to a particular character in a font. We’ve just been creating an individual value thematic on a layer of points so that some of the features can be styled using bitmap symbols and some can use characters from the MapInfo Miscellaneous True Type Font. One of the symbols that we wanted to use (a bird
) is outside the normal ASCII range (which includes numbers, lower and uppercase characters and common punctuation).
When you apply a rendition style to an MDF it is stored as an XML element which defines the font-family font-size etc. plus the position in the font that the character can be found at. For example if you wanted to a feature to be rendered as a exclamation mark (!) you might see:
<br />
<style fill-opacity="1.0" stroke-opacity="1.0" stroke-width="1.0" font-family="Arial" font-size="50.0" symbol-mode="font" symbol-foreground="black" symbol-foreground-opacity="1.0" symbol-background-opacity="1.0"><br />
<text>!</text><br />
</style>
However when you look at the style element for a symbol that is outside the normal ASCII range the text element contains a non printable character and if you make any modifications to the MDF by hand the symbol is not displayed. Luckily to get around this you can use a numeric entity reference containing the ASCII code of the character; therefore to render our bird symbol you can use:
<br />
<style fill-opacity="1.0" stroke-opacity="1.0" stroke-width="1.0" font-family="MapInfo Miscellaneous" font- symbol-mode="font" symbol-foreground="aqua" symbol-foreground-opacity="1.0" symbol-background-opacity="1.0"><br />
<text><span style="font-weight: bold">€<</span>/text><br />
</style><br />
