Font

A style bean that sets the font of any Text nodes beneath it.

Features

XML Element XML Type Java Class
style font uk.ac.ic.doc.scenebeans.Font

Properties

Name Type Default Value Getter Method Setter Method Description
font java.awt. Font null getFont setFont The font used to render text.

When set from an XML document, the textual value in the document is parsed into a font by calling the static decode method of the java.awt.Font class. The textual value should have one of the following forms:

  • fontname-style-pointsize
  • fontname-pointsize
  • fontname-style
  • fontname
where style is one of the three strings "BOLD", "BOLDITALIC", or "ITALIC", and point size is a decimal representation of the point size. The default style is PLAIN. The default point size is 12.

Example XML

<style type="font">
  <param name="font" value="SansSerif-BOLDITALIC-38"/>
  <primitive type="text">
    <param name="text" value="hello, world!"/>
  </primitive>
</style>