Ignore:
Timestamp:
2013-01-15T20:53:38+13:00 (11 years ago)
Author:
davidb
Message:

Working on obtaining the correct font information for text elements on an html page.

File:
1 edited

Legend:

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

    r24944 r26727  
    5555  "tahoma"          => "sans-serif",
    5656  "geneva"          => "sans-serif",
     57  "georgia"         => "serif",
    5758  "times"           => "serif",
    5859  "times new roman"     => "serif",
     
    351352    my $exp_font_size = undef;
    352353
    353     if ($css_font_size =~ m/^(\d+(?:\.\d*))px$/) {
    354     $exp_font_size = int($1);
    355     }
     354   
     355    #if ($css_font_size =~ m/^(\d+(?:\.\d*))px$/) {
     356    #   $exp_font_size = int($1);
     357    #}
     358   
     359    $css_font_size =~ s/[^0-9]//g;
     360   
     361    if(defined $css_font_size){
     362        $exp_font_size = $css_font_size;
     363    }
    356364
    357365    return $exp_font_size;
     
    384392    return $exp_color;
    385393}
     394
     395sub convert_font_family
     396{
     397    my ($css_font_family) = @_;
     398       
     399    print STDERR "*** PASSING PARAMETER css font family: ".$css_font_family."\n";
     400   
     401    my $exp_font_family;
     402   
     403    #use $font_specific_family_lookup and $font_generic_family_lookup
     404    #to find the appropriate font family tag to output to expeditee.
     405    if(defined $font_specific_family_lookup->{lc($css_font_family)}){
     406        $exp_font_family = $css_font_family."_";
     407    }
     408   
     409    print STDERR "**** TESTING TESTING ".$font_specific_family_lookup->{"georgia"}."\n";
     410    print STDERR "**** TESTING TESTING ".$font_specific_family_lookup->{lc($css_font_family)}."\n";
     411    print STDERR "**** TESTING TESTING ".$font_specific_family_lookup->{$css_font_family}."\n";
     412    print STDERR "In CssStyleToExpAttr: font family attribute: $exp_font_family ******* \n";
     413   
     414    return $exp_font_family;
     415}
     416
     417sub convert_font_style
     418{
     419    my ($css_font_style) = @_;
     420
     421    my $exp_font_style;
     422   
     423    return $exp_font_style;
     424}
    386425   
    3874261;
    388    
Note: See TracChangeset for help on using the changeset viewer.