Hello !
 
When using the svgen package to convert Java2D stuff to SVG, the default font-family declaration for each Node is always enclosed in the classic &apos constructions (for " ' "), for example :
 
<g ... font-family="&apos;Courier New&apos; ...
 
Althrough the corresponding SVG image can be opened without problem (because when a text Node is encountered, the actual font declaration coming with the text don't have this particularity), I found that this construction was a bit odd...
 
After browsing through the sources, I discovered that the class that is directly responsible for this &apos stuff is the SVGFont class in package svggen. In the static familyToSVG(Font font) method, we have this code :
 
    StringBuffer fontFamily = new StringBuffer("'");
    fontFamily.append(fontFamilyStr);
    fontFamily.append("'");
 
It is obvious that, when trying to write the corresponding SVG Document to a file, the XMLWriter will have to write a " ' " character, so it will transforms it to &apos;, which is perfectly normal.
 
What's the reason for this " ' " enclosing, is it a bug or is there a reason for that that I don't see yet ?
 

Reply via email to