Update of /cvsroot/osmose-dev/osmose/src/osmose/application/export
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1174/src/osmose/application/export
Modified Files:
OSMExportHTML.java
Log Message:
Select good fonts for mac systems (bugs #1277552 and #1442631).
Index: OSMExportHTML.java
===================================================================
RCS file: /cvsroot/osmose-dev/osmose/src/osmose/application/export/OSMExportHTML.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** OSMExportHTML.java 19 Dec 2005 22:03:16 -0000 1.4
--- OSMExportHTML.java 6 Jul 2006 14:24:50 -0000 1.5
***************
*** 1109,1115 ****
* Dialog and dialoginput are different from cursive and fantasy, but in Sun
* JRE they use the same font as sansserif and monospaced (respectively).
! *
! * Physical fonts are quoted, but not generic CSS fonts, according to CSS
! * specifications.
*
* @param javaFont the Java font to be converted
--- 1109,1115 ----
* Dialog and dialoginput are different from cursive and fantasy, but in Sun
* JRE they use the same font as sansserif and monospaced (respectively).
! *
! * Physical fonts are quoted, but not generic CSS fonts, according to CSS
! * specifications.
*
* @param javaFont the Java font to be converted
***************
*** 1118,1122 ****
public String convertJavaFontToCSSFont(Font javaFont)
{
! String javaFt = javaFont.getName();
String cssFont = "\"" + javaFt + "\"";
if (javaFt.equals("sansserif")) cssFont = "sans-serif";
--- 1118,1126 ----
public String convertJavaFontToCSSFont(Font javaFont)
{
! // for MacOS systems, the font name must be the one returned by
! // getFamily, in order to keep white spaces.
! String javaFt = javaFont.getName();
! if(System.getProperty("os.name").toLowerCase().startsWith("mac"))
! javaFt = javaFont.getFamily();
String cssFont = "\"" + javaFt + "\"";
if (javaFt.equals("sansserif")) cssFont = "sans-serif";
|