this.endRes = al.getWidth() - 1;
this.startSeq = 0;
this.endSeq = al.getHeight() - 1;
+ if (applet!=null)
+ {
+ // get the width and height scaling factors if they were specified
+ String param = applet.getParameter("widthScale");
+ if (param!=null)
+ {
+ try {
+ widthScale = new Float(param).floatValue();
+ } catch (Exception e)
+ {
+ }
+ if (widthScale<=1.0)
+ {
+ System.err.println("Invalid alignment character width scaling factor ("+widthScale+"). Ignoring.");
+ widthScale = 1;
+ }
+ if (applet.debug)
+ {
+ System.err.println("Alignment character width scaling factor is now "+widthScale);
+ }
+ }
+ param = applet.getParameter("heightScale");
+ if (param!=null)
+ {
+ try {
+ heightScale = new Float(param).floatValue();
+ } catch (Exception e)
+ {
+ }
+ if (heightScale<=1.0)
+ {
+ System.err.println("Invalid alignment character height scaling factor ("+heightScale+"). Ignoring.");
+ heightScale = 1;
+ }
+ if (applet.debug)
+ {
+ System.err.println("Alignment character height scaling factor is now "+heightScale);
+ }
+ }
+ }
setFont(font);
MAC = new jalview.util.Platform().isAMac();
protected FeatureSettings featureSettings = null;
+ private float heightScale=1,widthScale=1;
+
public void setFont(Font f)
{
font = f;
}
java.awt.FontMetrics fm = nullFrame.getGraphics().getFontMetrics(font);
- setCharHeight(fm.getHeight());
- charWidth = fm.charWidth('M');
+ setCharHeight((int)(heightScale*fm.getHeight()));
+ charWidth = (int)(widthScale*fm.charWidth('M'));
if (upperCasebold)
{
Font f2 = new Font(f.getName(), Font.BOLD, f.getSize());
fm = nullFrame.getGraphics().getFontMetrics(f2);
- charWidth = fm.stringWidth("MMMMMMMMMMM") / 10;
+ charWidth = (int)(widthScale*(fm.stringWidth("MMMMMMMMMMM") / 10));
}
}