package defpackage;

import java.io.DataInputStream;
import javax.microedition.lcdui.Image;

/* renamed from: mFont */
public final class mFont {
    public static mFont run;
    public static mFont z5;
    public static mFont z7;
    public static mFont zg;
    public static mFont zi;
    public static mFont zk;
    public static mFont zl;
    public static mFont zn;
    public static mFont zr;
    public static mFont zu;
    public static mFont zz5;
    public static mFont zz7;
    public static mFont zzg;
    public static mFont zzi;
    public static mFont zzk;
    public static mFont zzl;
    public static mFont zzn;
    public static mFont zzr;
    public static mFont zzu;
    public static mFont zzz5 = zzk;
    public static mFont zzz7 = zzn;
    public static mFont zzzg = zz5;
    public static mFont zzzi;
    public static mFont zzzk = zzzzzu;
    public static mFont zzzl = zzzzzn;
    public static mFont zzzn = zzzzz5;
    public static mFont zzzr;
    public static mFont zzzu = zzzzz7;
    public static mFont zzzz7;
    public static mFont zzzzi = zzu;
    public static mFont zzzzk = zzg;
    public static mFont zzzzl = zn;
    public static mFont zzzzn = zzr;
    public static mFont zzzzr = zzk;
    public static mFont zzzzu = z7;
    private static mFont zzzzz5;
    private static mFont zzzzz7;
    private static String zzzzzk = " 0123456789+-*='_?.,<>/[]{}!@#$%^&*():aáàảãạâấầẩẫậăắằẳẵặbcdđeéèẻẽẹêếềểễệfghiíìỉĩịjklmnoóòỏõọôốồổỗộơớờởỡợpqrstuúùủũụưứừửữựvxyýỳỷỹỵzwAÁÀẢÃẠĂẰẮẲẴẶÂẤẦẨẪẬBCDĐEÉÈẺẼẸÊẾỀỂỄỆFGHIÍÌỈĨỊJKLMNOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢPQRSTUÚÙỦŨỤƯỨỪỬỮỰVXYÝỲỶỸỴZW";
    private static mFont zzzzzn;
    private static mFont zzzzzu;
    private int zzzz5;
    private int zzzzg;
    private String zzzzzg;
    private Image zzzzzi;
    private int[][] zzzzzl;
    private String zzzzzr;

    static {
        mFont mfont = r6;
        mFont mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7b_purple.png", "/myfont/tahoma_7b", 1);
        zzzz7 = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7b_red.png", "/myfont/tahoma_7b", 0);
        run = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7b_blue.png", "/myfont/tahoma_7b", 0);
        zi = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7b_white.png", "/myfont/tahoma_7b", 0);
        zr = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7b_yellow.png", "/myfont/tahoma_7b", 0);
        zl = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7b_yellow.png", "/myfont/tahoma_7b", 0);
        zk = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7b_brown.png", "/myfont/tahoma_7b", 0);
        zu = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7b_green2.png", "/myfont/tahoma_7b", 0);
        zn = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7b_green.png", "/myfont/tahoma_7b", 0);
        z7 = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7b_focus.png", "/myfont/tahoma_7b", 0);
        z5 = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7b_unfocus.png", "/myfont/tahoma_7b", 0);
        zg = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7.png", "/myfont/tahoma_7", 0);
        zzi = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7_blue1.png", "/myfont/tahoma_7", 0);
        zzr = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7_green2.png", "/myfont/tahoma_7", 0);
        zzl = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7_yellow.png", "/myfont/tahoma_7", 0);
        zzk = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7_grey.png", "/myfont/tahoma_7", 0);
        zzu = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7_red.png", "/myfont/tahoma_7", 0);
        zzn = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7_blue.png", "/myfont/tahoma_7", 0);
        zz7 = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7_green.png", "/myfont/tahoma_7", 0);
        zz5 = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_7_white.png", "/myfont/tahoma_7", 0);
        zzg = mfont;
        mfont = r6;
        mfont2 = new mFont(zzzzzk, "/myfont/tahoma_8b.png", "/myfont/tahoma_8b", -1);
        zzzi = mfont;
        mfont = r6;
        mfont2 = new mFont(" 0123456789+-", "/myfont/number_yellow.png", "/myfont/number", 0);
        zzzzzu = mfont;
        mfont = r6;
        mfont2 = new mFont(" 0123456789+-", "/myfont/number_red.png", "/myfont/number", 0);
        zzzzzn = mfont;
        mfont = r6;
        mfont2 = new mFont(" 0123456789+-", "/myfont/number_green.png", "/myfont/number", 0);
        zzzzz7 = mfont;
        mfont = r6;
        mfont2 = new mFont(" 0123456789+-", "/myfont/number_gray.png", "/myfont/number", 0);
        zzzr = mfont;
        mfont = r6;
        mfont2 = new mFont(" 0123456789+-", "/myfont/number_orange.png", "/myfont/number", 0);
        zzzzz5 = mfont;
    }

    private mFont(String str, String str2, String str3, int i) {
        String str4 = str2;
        String str5 = str3;
        int i2 = i;
        try {
            this.zzzzzr = str;
            this.zzzz5 = i2;
            this.zzzzzg = str4;
            this.zzzzzi = bk.zi(this.zzzzzg);
            try {
                DataInputStream dataInputStream = r8;
                DataInputStream dataInputStream2 = new DataInputStream(dr.run(str5));
                DataInputStream dataInputStream3 = dataInputStream;
                this.zzzzzl = new int[dataInputStream3.readShort()][];
                for (int i3 = 0; i3 < this.zzzzzl.length; i3++) {
                    this.zzzzzl[i3] = new int[4];
                    this.zzzzzl[i3][0] = dataInputStream3.readShort();
                    this.zzzzzl[i3][1] = dataInputStream3.readShort();
                    this.zzzzzl[i3][2] = dataInputStream3.readShort();
                    this.zzzzzl[i3][3] = dataInputStream3.readShort();
                    this.zzzzg = this.zzzzzl[i3][3];
                }
            } catch (Exception e) {
            }
        } catch (Throwable e2) {
            Throwable th = e2;
            Throwable th2 = th;
            th.printStackTrace();
            System.out.println("paht data:".concat(String.valueOf(str4)));
        }
    }

    public final int run() {
        return this.zzzzg;
    }

    public final int run(String str) {
        String str2 = str;
        int i = 0;
        for (int i2 = 0; i2 < str2.length(); i2++) {
            int indexOf = this.zzzzzr.indexOf(str2.charAt(i2));
            int i3 = indexOf;
            if (indexOf == -1) {
                i3 = 0;
            }
            i += this.zzzzzl[i3][2] + this.zzzz5;
        }
        return i;
    }

    public final void run(cr crVar, String str, int i, int i2) {
        run(crVar, str, i, i2, 2);
    }

    public final void run(cr crVar, String str, int i, int i2, int i3) {
        cr crVar2 = crVar;
        String str2 = str;
        int i4 = i;
        int i5 = i2;
        int i6 = i3;
        int length = str2.length();
        i6 = i6 == 0 ? i4 : i6 == 1 ? i4 - run(str2) : i4 - (run(str2) >> 1);
        for (int i7 = 0; i7 < length; i7++) {
            int indexOf = this.zzzzzr.indexOf(str2.charAt(i7));
            i4 = indexOf;
            if (indexOf == -1) {
                i4 = 0;
            }
            if (i4 >= 0) {
                crVar2.run(this.zzzzzi, this.zzzzzl[i4][0], this.zzzzzl[i4][1], this.zzzzzl[i4][2], this.zzzzzl[i4][3], 0, i6, i5, 20);
            }
            i6 += this.zzzzzl[i4][2] + this.zzzz5;
        }
    }

    public final void run(cr crVar, String str, int i, int i2, int i3, mFont mfont) {
        cr crVar2 = crVar;
        String str2 = str;
        int i4 = i;
        int i5 = i2;
        int i6 = i3;
        mFont mfont2 = mfont;
        int length = str2.length();
        i6 = i6 == 0 ? i4 : i6 == 1 ? i4 - run(str2) : i4 - (run(str2) >> 1);
        for (int i7 = 0; i7 < length; i7++) {
            int indexOf = this.zzzzzr.indexOf(str2.charAt(i7));
            i4 = indexOf;
            if (indexOf == -1) {
                i4 = 0;
            }
            if (i4 >= 0) {
                if (!ew.run) {
                    crVar2.run(mfont2.zzzzzi, this.zzzzzl[i4][0], this.zzzzzl[i4][1], this.zzzzzl[i4][2], this.zzzzzl[i4][3], 0, i6 + 1, i5, 20);
                    crVar2.run(mfont2.zzzzzi, this.zzzzzl[i4][0], this.zzzzzl[i4][1], this.zzzzzl[i4][2], this.zzzzzl[i4][3], 0, i6, i5 + 1, 20);
                }
                crVar2.run(this.zzzzzi, this.zzzzzl[i4][0], this.zzzzzl[i4][1], this.zzzzzl[i4][2], this.zzzzzl[i4][3], 0, i6, i5, 20);
            }
            i6 += this.zzzzzl[i4][2] + this.zzzz5;
        }
    }

    public final void run(cr crVar, String str, int i, int i2, mFont mfont) {
        run(crVar, str, i, i2, 2, mfont);
    }

    public final String[] run(String str, int i) {
        int i2 = i;
        String str2 = str;
        cu cuVar = r12;
        cu cuVar2 = new cu("vLine");
        cu cuVar3 = cuVar;
        String str3 = "";
        int i3 = 0;
        while (i3 < str2.length()) {
            if (str2.charAt(i3) == 10 || str2.charAt(i3) == 8) {
                cuVar3.addElement(str3);
                str3 = "";
            } else {
                StringBuffer stringBuffer = r12;
                cuVar2 = new cu(String.valueOf(str3));
                str3 = stringBuffer.append(str2.charAt(i3)).toString();
                if (run(str3) > i2) {
                    int length = str3.length() - 1;
                    while (length >= 0 && str3.charAt(length) != ' ') {
                        length--;
                    }
                    if (length < 0) {
                        length = str3.length() - 1;
                    }
                    cuVar3.addElement(str3.substring(0, length));
                    i3 = (i3 - (str3.length() - length)) + 1;
                    str3 = "";
                }
                if (i3 == str2.length() - 1 && !str3.trim().equals("")) {
                    cuVar3.addElement(str3);
                }
            }
            i3++;
        }
        cu cuVar4 = cuVar3;
        String[] strArr = new String[cuVar3.size()];
        for (i2 = 0; i2 < cuVar4.size(); i2++) {
            strArr[i2] = cuVar4.elementAt(i2).toString();
        }
        return strArr;
    }
}