sivarajankumar / alivepdf

Automatically exported from code.google.com/p/alivepdf
0 stars 0 forks source link

getFontStyleString error with Times-Roman #195

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use Times Roman

What is the expected output? What do you see instead?
Because TImes does not use Oblique and uses Italics the if statements had to be 
changed.

What version of the product are you using? On what operating system?

lastest 0.1.5 RC
Please provide any additional information below.

THE FIX IS

protected function getFontStyleString (  bold : Boolean, italic : Boolean, 
family: String ):String
        {
            var font:String = family;
            var position:int;

            if ( (position = font.indexOf("-")) != -1 )
                font = font.substr(0, position);

            if ( bold && italic )
                if(family == "Times-Roman")
                    font += "-BoldItalic";
                else
                    font += "-BoldOblique";
            else if ( bold )
                font += "-Bold";
            else if ( italic )
                if(family == "Times-Roman")
                    font += "-Italic";
                else
                    font += "-Oblique";
            else if(font == "Times")
                font = "Times-Roman";

            return font;
        }

Original issue reported on code.google.com by wesley.a...@gmail.com on 19 Feb 2010 at 10:48

GoogleCodeExporter commented 8 years ago
Hi Wesley,

Thanks for the fix, nice.

best,

Thibault

Original comment by thibault.imbert on 26 Feb 2010 at 10:13