                                       WBMPcreator FAQ
                                     author: Max Krainov
                                 last updated at: 14.06.2000

1. Fonts.
2. Fonts.
3. WBMP format.
4. java.awt.image.BufferedImage error.
5. Web servers supported
6. How can I add custom font?
7. WBMPChart.setXData() java.lang.ClassCastException error
8. Where can I find the latest version of WBMPcreator?
--------------------------------------------------------------------------------
Q1. Trying to use different fonts, I get the illegible font on the image. What's
    the matter?
A1. It depends on Java version installed on your machine. The following TTF fonts
    work fine with WBMPcreator:
       Font name         Font type  Min. readable size
    1. Courier New Bold  Font.BOLD          8
    2. Arial Bold        Font.PLAIN        10
    3. Arial             Font.PLAIN        10

    NOTE that using only capital letters will improve readability of a font. I.e.
    if a string "Hello world!" is readable using 10 font size, the following
    string: "HELLO WORLD!" will be readable using 8 font size.

Q2. If I want to use my own self-written font, what shall I do?
A2. Certainly, you can spend some time for implementing it using
    the current version of WBMPcreator. Soon you will be able to add and use
    your OWN font written in points.

Q3. Can you explain me the WBMP file format in brief?
A3. No problem.
    first and second bytes are 0
    third byte is the length of a bitmap in points.
    fourth byte is the width of a bitmap in points.
    the other data is the picture itself.
    Note that is your picture's length is 9 pixels you should use 2 bytes: the
    first will contain 8 first bits of a line, and the second byte will contain
    the nineth bit and the other bits are zeroes.

    Example:
      you have a number (in binary representation):
      101010101 - 9 bits
      the first byte is:
      10101010
      the second byte is:
      10000000

    This is enough to understand WBMP.

Q4. When using the draw functions I get errors concerning
    java.awt.image.BufferedImage. What's the matter?
A4. The point is that WBMPcreator is aimed for Java version 1.2.x and higher.
    Try using JDK 1.2.x or higher.

Q5. What shall I do if my WBMPcreator is not compatible with my 
    Java Web Server?
A5. Your problem is solved since version 1.21. You may have problems 
    with the following methods:
      drawPoint, drawLine, drawRect, draw3DRect, drawCircle, drawOval,
      drawArc and drawString.
    All version since 1.21 do not have this stated problem. Moreover, all
    graphics methods work MUCH more quickly than they did in previous versions.

    Still TTF fonts are not supported for Java versions 1.0 and 1.1 but I
    believe it's not too necessary because TTF fonts are not looking as good
    as self-written font (for example, the plain 4x6 font).

Q6. How can I add my own custom font to be used in WBMPCustomFont class?
A6. You should send it to the author to be added into the official
    WBMPcreator package. I hope to add support for user-defined pixel fonts
    in near future but only time will tell my plans for the future. See file
    "custom_fonts.txt" to see what font format is supported. Sorry for
    disconvenience but many people needed 4x6 font to be displayed so I've
    added it to suite their requirements.

Q7. I have the following code :

    import WBMPcreator.WBMPChart;
    import java.util.Vector;

    public class CreateWBMP {
      WBMPChart wch;
      Vector x;
      Vector y;

    public CreateWBMP() {
      x = new Vector();
      x.addElement(new Integer(10));
      x.addElement(new Integer(20));
      x.addElement(new Integer(30));

      y = new Vector();
      y.addElement(new Integer(20));
      y.addElement(new Integer(30));
      y.addElement(new Integer(10));

      wch = new WBMPChart(100,48);
      wch.setXData(x);
      wch.setYData(y);
      wch.drawChart(WBMPChart.CHART_POINT);
      wch.saveWBMP2File("c:/test.wbmp");
	  } // CreateWBMP

    public static void main(String args[]) {
      CreateWBMP w = new CreateWBMP();
      System.out.println("Done");
      System.exit(0);
    } // main

  }

  And I get the following run time error :

  C:\java CreateWBMP
  Exception in thread "main" java.lang.ClassCastException
        at WBMPcreator.WBMPChart.getMinX(WBMPChart.java, Compiled Code)
        at WBMPcreator.WBMPChart.drawChartPoint(WBMPChart.java, Compiled Code)
        at WBMPcreator.WBMPChart.drawChart(WBMPChart.java:117)
        at CreateWBMP.<init>(CreateWBMP.java:24)
        at CreateWBMP.main(CreateWBMP.java:29)

  Am I doing something wrong?
A7. The point is that you should use the following like instead of

      x.addElement(new Integer(10));

    and strings like this:

      x.addElement("10");

    After you fill all Vectors with data you'll have no problems.

Q8. Where can I find the latest version of WBMPcreator?
A8. New versions are always available at:
    http://wbmpcreator.iproject.ru/


--------------------------------------------------------------------------------    
You can always refer with your questions to me and I'll add your questions
into the FAQ. E-mail me at: mkrainov@mail.ru or mkrainov@netcity.ru or ICQ
36688103 with subject: "WBMPcreator question".

                             Max Krainov
                      InformProject, Inc. 2000
