public int getStringWidth(String par1Str)
    {
        if (par1Str == null)
        {
            return 0;
        }

        int i = 0;
        boolean flag = false;

        for (int j = 0; j < par1Str.length(); j++)
        {
            char c = par1Str.charAt(j);
            int k = getCharWidth(c);

            if (k < 0 && j < par1Str.length() - 1)
            {
                char c1 = par1Str.charAt(++j);

                if (c1 == 'l' || c1 == 'L')
                {
                    flag = true;
                }
                else if (c1 == 'r' || c1 == 'R')
                {
                    flag = false;
                }

                k = getCharWidth(c1);
            }

            i += k;

            if (flag)
            {
                i++;
            }
        }

        return i;
    }