📄 fontinfoimpl.java
字号:
// Decompiled by DJ v3.7.7.81 Copyright 2004 Atanas Neshkov Date: 2007-11-23 16:17:31
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: FontInfoImpl.java
package com.bokai.drawing;
// Referenced classes of package com.bokai.drawing:
// FontGlyph, FontInfo, FontSpec, SimpleFontMetrics
public class FontInfoImpl
implements FontInfo
{
public FontInfoImpl(FontSpec fontspec)
{
_fm = null;
_fontSpec = fontspec;
}
public int charsWidth(char ac[], int i, int j)
{
int k = 0;
for(int l = 0; l < j; l++)
{
FontGlyph fontglyph = getCharGlyph(ac[i + l]);
if(fontglyph == null)
fontglyph = getDefaultCharGlyph();
k += fontglyph.width;
}
return k;
}
public FontGlyph getCharGlyph(char c)
{
if(c >= ' ' && c <= '~')
{
int i = c - 32;
return new FontGlyph(_fontSpec.getGlyphWidths1()[i], _fontSpec.getHeight(), _fontSpec.getGlyphs1()[i]);
}
if(c >= '\240' && c <= '\377')
{
int j = c - 160;
return new FontGlyph(_fontSpec.getGlyphWidths2()[j], _fontSpec.getHeight(), _fontSpec.getGlyphs2()[j]);
} else
{
return null;
}
}
public FontGlyph getDefaultCharGlyph()
{
return getCharGlyph('\244');
}
public SimpleFontMetrics getFontMetrics()
{
if(_fm == null)
synchronized(this)
{
if(_fm == null)
_fm = new SimpleFontMetrics(this, _fontSpec.getMaxAscent(), _fontSpec.getAscent(), _fontSpec.getDescent(), _fontSpec.getLeading());
}
return _fm;
}
private FontSpec _fontSpec;
private SimpleFontMetrics _fm;
private static final char _defaultCharCode = 164;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -