org.stellarium.ui.render
Class SFont

java.lang.Object
  extended by org.stellarium.ui.render.AWTFont
All Implemented Interfaces:
SFontIfc

public class SFont
extends java.lang.Object
implements SFontIfc

Stellarium Font.

See C++ version of this file. http://cvs.sourceforge.net/viewcvs.py/stellarium/stellarium/src/s_font.h?rev=1.15&view=markup

Version:
0.8.2
Author:
Jérôme Beau
See Also:
s_font.h, typeface.cpp, typeface.h

Field Summary
private static java.util.Map<java.lang.String,java.awt.Font> baseFonts
           
private  java.awt.Color color
           
private  java.awt.Font typeFace
           
 
Constructor Summary
SFont(float size, java.lang.String ttfFileName)
          Stellarium 0.8.1 use ttf font names loaded
SFont(float size, java.lang.String ttfFileName, SColor fontColor)
          Stellarium 0.8.1 use ttf font names loaded
 
Method Summary
 void close()
           
 int getAscent()
           
 int getDescent()
           
 int getLineHeight()
           
 float getStrLen(java.lang.String str)
           
 void print(double x, double y, java.lang.String str)
          Method with upsideDown by default
 void print(float x, float y, java.lang.String str, boolean upsidedown)
           
 void printChar(char c)
           
 void printCharOutlined(char c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

baseFonts

private static final java.util.Map<java.lang.String,java.awt.Font> baseFonts

color

private final java.awt.Color color

typeFace

private final java.awt.Font typeFace
Constructor Detail

SFont

public SFont(float size,
             java.lang.String ttfFileName)
      throws StellariumException
Stellarium 0.8.1 use ttf font names loaded

Parameters:
size -
ttfFileName -
Throws:
StellariumException

SFont

public SFont(float size,
             java.lang.String ttfFileName,
             SColor fontColor)
      throws StellariumException
Stellarium 0.8.1 use ttf font names loaded

Parameters:
size -
ttfFileName -
fontColor -
Throws:
StellariumException
Method Detail

close

public void close()
Specified by:
close in interface SFontIfc

print

public void print(double x,
                  double y,
                  java.lang.String str)
Method with upsideDown by default

Specified by:
print in interface SFontIfc

print

public void print(float x,
                  float y,
                  java.lang.String str,
                  boolean upsidedown)
Specified by:
print in interface SFontIfc

printChar

public void printChar(char c)
Specified by:
printChar in interface SFontIfc

printCharOutlined

public void printCharOutlined(char c)
Specified by:
printCharOutlined in interface SFontIfc

getStrLen

public float getStrLen(java.lang.String str)
Specified by:
getStrLen in interface SFontIfc

getLineHeight

public int getLineHeight()
Specified by:
getLineHeight in interface SFontIfc

getAscent

public int getAscent()
Specified by:
getAscent in interface SFontIfc

getDescent

public int getDescent()
Specified by:
getDescent in interface SFontIfc