Home Forums XMetaL Tips and Tricks Script Example: Custom Special Characters Form (XFT) Reply To: Script Example: Custom Special Characters Form (XFT)

Derek Read

Reply to: Script Example: Custom Special Characters Form (XFT)

  • 1. Can I change the symbol displayed for the character to something more recognizable as non-breaking hyphen?  If so how?
  • 2. Can I change the appearance of the character in the normal view in XmetaL so it looks different from a regular hyphen?

1. I did not design this example to work that way, but I suppose it could be modified to support a “display” character and a “character to insert”. At the moment it uses the same for both.
2. The only way to do this in XMetaL Author at the moment (as of this writing the current release is 5.5) is to specify a font (in the CSS that is used by your DTD or Schema) that uses different glyphs for characters that otherwise look the same. Most fonts do not do this. In particular, for hyphen and non-breaking-hyphen, fonts do not do this precisely because people expect them to look the same.

One solution is to take an existing font file you normally use and modify it using a font editing application to change the particular characters you need to uniquely identify. Then use this new font in your customization when editing in XMetaL. I will not attempt to get into the legalities of modifying fonts. I suspect some might argue that even when not distributed externally this might contravene some licenses for some fonts. However, there are lots of open source fonts out there one could use / modify that would likely have less restrictions. Of course, this means having a font editing application and someone that knows how to use it. The necessary changes (in your case one character) would be very simple for people familiar with such software and might take about 10 minutes to perform.

I can say that long term we are looking into helping people solve this issue by adding features to XMetaL's UI. There are lots of characters in Unicode that tend to be rendered using the same glyphs in most fonts and people sometimes need to be able to identify them separately (there are a few dozen different “invisible” characters including U+0020 vs U+00A0, a bunch of characters that look like hyphens, sometimes with slightly different lengths, and lots of other lesser used characters).