Display SWkeys TTF font in XML Author

Having trouble installing Oxygen? Got a bug to report? Post it all here.
reinierk
Posts: 36
Joined: Tue Feb 21, 2012 8:22 pm
Location: Rotterdam, the Netherlands
Contact:

Display SWkeys TTF font in XML Author

Post by reinierk »

I modified the css_classed to change the font of uicontrol in the user interface to use font SWkeys. However the XML author editor only shows squares. Apparently the editor has trouble with the glyphs in Swkeys. Why?
This is my css_classed modification:

Code: Select all

*[class~="ui-d/menucascade"] > *[class~="ui-d/uicontrol"]{
display: inline;
font-weight: bold;
font-family: Sans;
}
*[class~="ui-d/uicontrol"]{
display: inline;
font-family: SWkeys;
No problems in FOP/PDF output. There I see SWkey glyphs!
This is inconvenient because now it is very hard to spot mistakes in the editor...
I am doing it wrong, or is it an editor problem?
Kind Regards,
Reinier Kleipool,
Course Materials editor,
Open Source Academy
http://www.OpenSourceAcademy.eu
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Display SWkeys TTF font in XML Author

Post by Radu »

Hi,

Oxygen is a Java application and in order for Oxygen to support certain fonts for visual editing the fonts need to be properly installed in the operating system (on Windows this means copying the fonts to the Fonts directory).
I will consider that you have already done this.

The SWKeys font family can only render a very limited range of characters starting about from decimal 61473 to decimal 61695.

You can go to the Edit menu and choose Insert from character map, then change the font family to SWkeys and see exactly the characters which can be rendered with the font.

But the trick is that some fonts can specify that its glyph range can be mapped to multiple character ranges.
So probably this particular font specifies that the usual character '1' should be rendered as if it were the character f031.

Oxygen does not have custom code to draw the characters in one way or the other so it relies explicitly on the Java VM to translate characters to their visual representation.
On the other side Apache FOP has its own implementation which reads and interprets True Type font files.
So this is the reason for the difference in behavior, probably the Java VM does not properly support such mappings on certain fonts.

Sorry but the only workaround I can suggest would be to use the default font family for rendering *[class~="ui-d/uicontrol"] in the Author page. Maybe you can add a :before or after static content to it to remind technical writers that it will be rendered differently.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
reinierk
Posts: 36
Joined: Tue Feb 21, 2012 8:22 pm
Location: Rotterdam, the Netherlands
Contact:

Re: Display SWkeys TTF font in XML Author

Post by reinierk »

I think the problem is with the fact that the SWKeys font in encoded in ISO-8859-1, not unicode. I downloaded free font KCaps from http://www.searchfreefonts.com/download ... x?d=207934 and this is Unicode. When I use this, the GUI does show key-cap glyphs.
Kind Regards,
Reinier Kleipool,
Course Materials editor,
Open Source Academy
http://www.OpenSourceAcademy.eu
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Display SWkeys TTF font in XML Author

Post by Radu »

Hi,

Thanks for posting the workaround. I have no idea why one works and the other doesn't in the Java VM, it would probably take a lot of digging to find out.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply