home *** CD-ROM | disk | FTP | other *** search
- package sun.awt.windows;
-
- import sun.awt.PlatformFont;
- import sun.io.CharToByteConverter;
-
- public class WFontPeer extends PlatformFont {
- private String wfsname;
-
- public WFontPeer(String var1, int var2) {
- super(var1, var2);
- if (super.props != null) {
- this.wfsname = super.props.getProperty("fontset." + super.aliasName + "." + super.styleString);
- }
-
- }
-
- public CharToByteConverter getFontCharset(String var1, String var2) {
- CharToByteConverter var3;
- if (var1.equals("default")) {
- var3 = (CharToByteConverter)PlatformFont.charsetRegistry.get(var2);
- } else {
- var3 = (CharToByteConverter)PlatformFont.charsetRegistry.get(var1);
- }
-
- if (var3 instanceof CharToByteConverter) {
- return var3;
- } else {
- Class var4;
- try {
- var4 = Class.forName(var1);
- } catch (ClassNotFoundException var9) {
- try {
- var4 = Class.forName("sun.io." + var1);
- } catch (ClassNotFoundException var8) {
- try {
- var4 = Class.forName("sun.awt.windows." + var1);
- } catch (ClassNotFoundException var7) {
- return this.getDefaultFontCharset(var2);
- }
- }
- }
-
- try {
- var3 = (CharToByteConverter)var4.newInstance();
- } catch (InstantiationException var5) {
- return this.getDefaultFontCharset(var2);
- } catch (IllegalAccessException var6) {
- return this.getDefaultFontCharset(var2);
- }
-
- if (var1.equals("default")) {
- PlatformFont.charsetRegistry.put(var2, var3);
- } else {
- PlatformFont.charsetRegistry.put(var1, var3);
- }
-
- return var3;
- }
- }
-
- private CharToByteConverter getDefaultFontCharset(String var1) {
- return new WDefaultFontCharset(var1);
- }
- }
-