Ignore:
Timestamp:
2013-01-15T23:15:34+13:00 (11 years ago)
Author:
davidb
Message:

Now correctly accounts for bold, italic and bold-italic text.

Location:
gs3-extensions/html-to-expeditee/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/html-to-expeditee/trunk/src/perllib/CssStyleToExpAttr.pm

    r26728 r26729  
    367367    if(lc($css_font_face) eq "bold"){
    368368            $exp_font_face = "b";
    369     }else{      #for now - also need to take into account italic and italic bold.
     369    }elsif(lc($css_font_face) eq "italic"){     #for now - also need to take into account italic and italic bold.
     370        $exp_font_face = "i";
     371    }elsif(lc($css_font_face) eq "bold-italic"){
     372        $exp_font_face = "p";
     373    }else{
    370374        $exp_font_face = "r";
    371375    }
  • gs3-extensions/html-to-expeditee/trunk/src/perllib/ExpediteeFrameIO.pm

    r26728 r26729  
    9999    }
    100100   
     101    my $css_font_style;
     102    my $css_font_face;
     103   
    101104    if(defined $css_attr->{'font-style'}){
    102         print STDERR "Font style attribute found: ".$css_attr->{'font-style'}."\n";
    103     }
    104    
    105     if(defined $css_attr->{'font-weight'}){
    106         print STDERR "Font weight attribute found: ".$css_attr->{'font-weight'}."\n";
    107        
    108         my $css_font_face = $css_attr->{'font-weight'};
     105        $css_font_style = $css_attr->{'font-style'};
     106        $exp_font_face = CssStyleToExpAttr::convert_font_face($css_font_style);
     107    }
     108   
     109    if(defined $css_attr->{'font-weight'}){
     110        $css_font_face = $css_attr->{'font-weight'};
    109111        $exp_font_face = CssStyleToExpAttr::convert_font_face($css_font_face);
     112    }
     113   
     114    if(defined $css_attr->{'font-style'} && defined $css_attr->{'font-weight'}){
     115        my $font_face_param = $css_attr->{'font-weight'}.'-'.$css_attr->{'font-style'};
     116        print STDERR "$font_face_param **** \n";
     117        $exp_font_face = CssStyleToExpAttr::convert_font_face($font_face_param);
    110118    }
    111119   
  • gs3-extensions/html-to-expeditee/trunk/src/src/js/html-to-expeditee.js

    r26728 r26729  
    66var font_color;
    77var font_weight;
     8var font_style;
    89
    910Element.prototype.getElementWidth = function() {
     
    161162           
    162163            var new_font_weight = getStyle(parent,"font-weight");
     164            var new_font_style = getStyle(parent,"font-style");
    163165           
    164166            if(new_font_family !== undefined && new_font_family !== null)
     
    173175            if(new_font_weight !== undefined && new_font_weight !== null)
    174176                font_weight = new_font_weight;
     177               
     178            if(new_font_style !== undefined && new_font_style !== null)
     179                font_style = new_font_style;
    175180           
    176181            var data = parent.attributes["data"];
     
    185190            style["color"]            = font_color;
    186191            style["font-weight"]      = font_weight;
     192            style["font-style"]       = font_style;
    187193           
    188194            //TODO: if parent node is a <b> element, then set style["font-weight"] to be "bold".
Note: See TracChangeset for help on using the changeset viewer.