Font changes on export png/eps
authoramwaterhouse <Andrew Waterhouse>
Mon, 12 Dec 2005 12:24:24 +0000 (12:24 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 12 Dec 2005 12:24:24 +0000 (12:24 +0000)
src/jalview/gui/AlignmentPanel.java
src/jalview/gui/AnnotationLabels.java
src/jalview/gui/IdCanvas.java

index af24c9f..c7fccfe 100755 (executable)
@@ -657,6 +657,9 @@ public class AlignmentPanel extends GAlignmentPanel
     Color currentColor = null;\r
     Color currentTextColor = null;\r
 \r
+    pg.setFont(new Font(av.getFont().getName(),\r
+                        Font.ITALIC,\r
+                        av.getFont().getSize()));\r
     for (int i = startSeq; i < endSeq; i++)\r
     {\r
       if ( (av.getSelectionGroup() != null) &&\r
@@ -686,6 +689,8 @@ public class AlignmentPanel extends GAlignmentPanel
                     (av.getCharHeight() / 5));\r
     }\r
 \r
+    pg.setFont(av.getFont());\r
+\r
     // draw main sequence panel\r
     pg.translate(idWidth, 0);\r
     seqPanel.seqCanvas.drawPanel(pg, startRes, endRes, startSeq, endSeq,\r
@@ -693,9 +698,9 @@ public class AlignmentPanel extends GAlignmentPanel
 \r
     if (av.showAnnotation && (endSeq == av.alignment.getHeight()))\r
     {\r
-      pg.translate( -idWidth, (endSeq - startSeq) * av.charHeight + 3);\r
+      pg.translate( -idWidth-3, (endSeq - startSeq) * av.charHeight + 3);\r
       alabels.drawComponent( (Graphics2D) pg, idWidth);\r
-      pg.translate(idWidth, 0);\r
+      pg.translate(idWidth+3, 0);\r
       annotationPanel.drawComponent( (Graphics2D) pg, startRes, endRes +\r
                                     1);\r
     }\r
@@ -773,14 +778,14 @@ public class AlignmentPanel extends GAlignmentPanel
       }\r
       if (labels != null)\r
       {\r
-        pg.translate(0,\r
+        pg.translate(-3,\r
                      ypos +\r
                      (av.getAlignment().getHeight() * av.charHeight));\r
 \r
         pg.setFont(av.getFont());\r
         labels.drawComponent(pg, idWidth);\r
         pg.setFont(italic);\r
-        pg.translate(0,\r
+        pg.translate(+3,\r
                      -ypos -\r
                      (av.getAlignment().getHeight() * av.charHeight));\r
       }\r
@@ -841,15 +846,19 @@ public class AlignmentPanel extends GAlignmentPanel
       if (av.getWrapAlignment())\r
       {\r
         if(im.getGraphics()!=null)\r
+        {\r
           printWrappedAlignment(im.getGraphics(), width, height, 0);\r
+          im.writeImage();\r
+        }\r
       }\r
       else\r
       {\r
         if(im.getGraphics()!=null)\r
+        {\r
           printUnwrapped(im.getGraphics(), width, height, 0);\r
+          im.writeImage();\r
+        }\r
       }\r
-\r
-      im.writeImage();\r
     }\r
     catch (OutOfMemoryError err)\r
     {\r
index 8561e64..5eb5af5 100755 (executable)
@@ -376,6 +376,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
      */\r
     public void drawComponent(Graphics g, int width)\r
     {\r
+        g.setFont(new Font("Arial", Font.PLAIN, av.getFont().getSize()-2));\r
         FontMetrics fm = g.getFontMetrics(g.getFont());\r
         g.setColor(Color.white);\r
         g.fillRect(0, 0, getWidth(), getHeight());\r
index 0c6da36..f4c7380 100755 (executable)
@@ -238,16 +238,16 @@ public class IdCanvas extends JPanel
                 for (int i = starty; i < av.alignment.getHeight(); i++)\r
                 {\r
                     SequenceI s = av.alignment.getSequenceAt(i);\r
+                    gg.setFont(italic);\r
                     drawIdString(gg, s, i, 0, ypos);\r
                 }\r
 \r
                 if(labels!=null)\r
                 {\r
-                  gg.setFont(av.getFont());\r
                   gg.translate(0, ypos+(av.getAlignment().getHeight() * av.charHeight));\r
                   labels.drawComponent(gg, getWidth());\r
                   gg.translate(0, -ypos-(av.getAlignment().getHeight() * av.charHeight));\r
-                  gg.setFont(italic);\r
+\r
                 }\r
             }\r
         }\r