39 |
|
|
40 |
|
|
41 |
|
|
42 |
static GZZGL.Font theStaticFont; |
static GL.Font theStaticFont; |
43 |
static GLTextStyle[] instances = new GLTextStyle[250]; |
static GLTextStyle[] instances = new GLTextStyle[250]; |
44 |
|
|
45 |
static public GLTextStyle create(String family, int style, int size) { |
static public GLTextStyle create(String family, int style, int size) { |
47 |
GLTextStyle s = instances[size]; |
GLTextStyle s = instances[size]; |
48 |
if(s == null) { |
if(s == null) { |
49 |
if(theStaticFont == null) |
if(theStaticFont == null) |
50 |
theStaticFont = GZZGL.createFont("gfx/fonts/a010013l.pfb", 16); |
theStaticFont = GL.createFont("gfx/fonts/a010013l.pfb", 16); |
51 |
s = new GLTextStyle(theStaticFont, size / (float)16); |
s = new GLTextStyle(theStaticFont, size / (float)16); |
52 |
instances[size] = s; |
instances[size] = s; |
53 |
} |
} |
56 |
|
|
57 |
|
|
58 |
float fontScale; |
float fontScale; |
59 |
GZZGL.Font theFont; |
GL.Font theFont; |
60 |
short[] charWidths = new short[256]; |
short[] charWidths = new short[256]; |
61 |
|
|
62 |
private GLTextStyle(GZZGL.Font f, float scale) { |
private GLTextStyle(GL.Font f, float scale) { |
63 |
this.theFont = f; |
this.theFont = f; |
64 |
this.fontScale = scale; |
this.fontScale = scale; |
65 |
f.getWidths(charWidths); |
f.getWidths(charWidths); |