<?php
// an array in the form "value"=>"name":
$GLOBALS['fonts_list_array'] = array(
"Arial, Helvetica, sans-serif" => "-----Web Safe Fonts-----", 
"Arial, Helvetica, sans-serif" => "Arial",
"'Arial Black', Gadget, sans-serif" => "Arial Black", 
"'Bookman Old Style', serif" => "Bookman Old Style", 

"'Comic Sans MS', cursive" => "Comic Sans MS", 
"Courier, monospace" => "Courier", 
"'Courier New', Courier, monospace" => "Courier New", 
"Garamond, serif" => "Garamond", 
"Georgia, serif" => "Georgia", 
"Impact, Charcoal, sans-serif" => "Impact", 
"'Lucida Console', Monaco, monospace" => "Lucida Console", 
"'Lucida Sans Unicode', 'Lucida Grande', sans-serif" => "Lucida Sans Unicode", 
"'MS Sans Serif', Geneva, sans-serif" => "MS Sans Serif", 

"'MS Serif', 'New York', sans-serif" => "MS Serif", 
"'Palatino Linotype', 'Book Antiqua', Palatino, serif" => "Palatino Linotype", 
"Symbol, sans-serif" => "Symbol", 
"Tahoma, Geneva, sans-serif" => "Tahoma", 
"'Times New Roman', Times, serif" => "Times New Roman", 
"'Trebuchet MS', Helvetica, sans-serif" => "Trebuchet MS", 
"Verdana, Geneva, sans-serif" => "Verdana", 
"Webdings, sans-serif" => "Webdings", 
"Wingdings, 'Zapf Dingbats', sans-serif" => "Wingdings", 

"Arial, Helvetica, sans-serif" => "-------Other Fonts-------", 
"Arial, Helvetica, sans-serif" => "Arial", 
"'Arial Black', Gadget, sans-serif" => "Arial Black", 
"'Arial Narrow', Helvetica, sans-serif" => "Arial Narrow", 
"'Arial Rounded MT Bold', Gadget, sans-serif" => "Arial Rounded MT Bold", 
"'Arena Black', sans-serif" => "Arena Black", 
"'Academy Engraved LET', serif" => "Academy Engraved LET", 
"Acklin, sans-serif" => "Acklin", 
"Arcane, sans-serif" => "Arcane", 

"Agatha, sans-serif" => "Agatha", 
"'Agency FB', sans-serif" => "Agency FB", 
"Algerian, sans-serif" => "Algerian", 
"AllensHand, sans-serif" => "AllensHand", 
"Author, cursive" => "Author", 
"Avian, sans-serif" => "Avian", 
"Balogna, sans-serif" => "Balogna", 
"'Bell MT', serif" => "Bell MT", 
"'Benguiat Frisky ATT', sans-serif" => "Benguiat Frisky ATT", 

"'Black Chancery', sans-serif" => "Black Chancery", 
"'Boink LET', sans-serif" => "Boink LET", 
"'Book Antiqua', serif" => "Book Antiqua", 
"'Bookman Old Style', serif" => "Bookman Old Style", 
"Bookplate, serif" => "Bookplate", 
"Boston, serif" => "Boston", 
"'Bradley Hand ITC', cursive" => "Bradley Hand ITC", 
"'Britannic Bold', sans-serif" => "Britannic Bold", 
"Broadway, sans-serif" => "Broadway", 

"'Brush Script', cursive" => "Brush Script", 
"'Brush Script MT', cursive" => "Brush Script MT", 
"'BrushScript BT', cursive" => "BrushScript BT", 
"BrushStroke, cursive" => "BrushStroke", 
"'Calisto MT', serif" => "Calisto MT", 
"'Cataneo BT', serif" => "Cataneo BT", 
"Centaur, sans-serif" => "Centaur", 
"Century, sans-serif" => "Century", 
"'Century Gothic', sans-serif" => "Century Gothic", 

"Chancery, sans-serif" => "Chancery", 
"Chiller, sans-serif" => "Chiller", 
"'Comic Sans MS', cursive" => "Comic Sans MS", 
"'Cooper Black', sans-serif" => "Cooper Black", 
"'Cooper Md BT', sans-serif" => "Cooper Md BT", 
"Courier, monospace" => "Courier", 
"'Courier New', Courier, monospace" => "Courier New", 
"Cricket, sans-serif" => "Cricket", 
"'Curlz MT', sans-serif" => "Curlz MT", 

"Daniela, sans-serif" => "Daniela", 
"Dauphin, serif" => "Dauphin", 
"Dingbats1, Webdings, sans-serif" => "Dingbats1", 
"Dingbats2, Webdings, sans-serif" => "Dingbats2", 
"'DomBold BT', sans-serif" => "DomBold BT", 
"'DomCasual BT', sans-serif" => "DomCasual BT", 
"Fixedsys, monospace" => "Fixedsys", 
"FlamencoD, sans-serif" => "FlamencoD", 
"'Footlight MT Light', serif" => "Footlight MT Light", 

"Forte, sans-serif" => "Forte", 
"'Franklin Gothic Book', sans-serif" => "Franklin Gothic Book", 
"'Franklin Gothic Heavy', sans-serif" => "Franklin Gothic Heavy", 
"'Franklin Gothic Medium', sans-serif" => "Franklin Gothic Medium", 
"'French Script MT', cursive" => "French Script MT", 
"Fritz, serif" => "Fritz", 
"Futurist, sans-serif" => "Futurist", 
"Garamond, serif" => "Garamond", 
"Garnet, serif" => "Garnet", 

"Georgia, serif" => "Georgia", 
"Gigi, cursive" => "Gigi", 
"Gilde, serif" => "Gilde", 
"'Gill Sans MT', sans-serif" => "Gill Sans MT", 
"'Gill Sans MT Shadow', sans-serif" => "Gill Sans MT Shadow", 
"'Goudy Old Style', serif" => "Goudy Old Style", 
"'Hammer Fat', sans-serif" => "Hammer Fat", 
"'Hammer Thin', sans-serif" => "Hammer Thin", 
"Harrington, sans-serif" => "Harrington", 

"Helvetica, Arial, sans-serif" => "Helvetica", 
"'Helvetica Neue', Arial, sans-serif" => "Helvetica Neue", 
"'HelveticaNeue Black', Arial, sans-serif" => "HelveticaNeue Black", 
"'HelveticaNeue Condensed', Arial, sans-serif" => "HelveticaNeue Cond.", 
"'High Tower Text', sans-serif" => "High Tower Text", 
"'Highlight LET', sans-serif" => "Highlight LET", 
"'Hobby Headline', sans-serif" => "Hobby Headline", 
"IceAgeD, serif" => "IceAgeD", 
"'Imprint MT Shadow', sans-serif" => "Imprint MT Shadow", 

"'Informal Roman', sans-serif" => "Informal Roman", 
"Impact, Charcoal, sans-serif" => "Impact", 
"Jokerman, sans-serif" => "Jokerman", 
"Kids, sans-serif" => "Kids", 
"Koffee, cursive" => "Koffee", 
"'Kristen ITC', sans-serif" => "Kristen ITC", 
"Krone, serif" => "Krone", 
"'Lucida Blackletter', sans-serif" => "Lucida Blackletter", 
"'Lucida Calligraphy', cursive" => "Lucida Calligraphy", 

"'Lucida Casual', sans-serif" => "Lucida Casual", 
"'Lucida Console', Monaco, monospace" => "Lucida Console", 
"'Lucida Fax', monotype" => "Lucida Fax", 
"'Lucida Handwriting', cursive" => "Lucida Handwriting", 
"'Lucida Sans Unicode', 'Lucida Grande', sans-serif" => "Lucida Sans Unicode", 
"'Microsoft Sans Serif', Geneva, sans-serif" => "Microsoft Sans Serif", 
"Modern, sans-serif" => "Modern", 
"'Monotype Corsiva', cursive" => "Monotype Corsiva", 
"'MS Sans Serif', Geneva, sans-serif" => "MS Sans Serif", 

"'MS Serif', 'New York', sans-serif" => "MS Serif", 
"'Myriad Roman', sans-serif" => "Myriad Roman", 
"'Palatino Linotype', 'Book Antiqua', Palatino, serif" => "Palatino Linotype", 
"Palisade, sans-serif" => "Palisade", 
"'Papyrus LET', sans-serif" => "Papyrus LET", 
"Perpetua, serif" => "Perpetua", 
"Phyllis, cursive" => "Phyllis", 
"'Poor Richard', serif" => "Poor Richard", 
"Pristina, fantasy, sans-serif" => "Pristina", 

"'Rage Italic LET', cursive" => "Rage Italic LET", 
"Ravie, fantasy, sans-serif" => "Ravie", 
"Rockwell, serif" => "Rockwell", 
"Roman, sans-serif" => "Roman", 
"Schoolbook, serif" => "Schoolbook", 
"Script, cursive" => "Script", 
"Soutane, sans-serif" => "Soutane", 
"Stencil, sans-serif" => "Stencil", 
"Symbol, sans-serif" => "Symbol", 

"System, monospace" => "System", 
"Tahoma, Geneva, sans-serif" => "Tahoma", 
"Terminal, sans-serif" => "Terminal", 
"'Times New Roman', Times, serif" => "Times New Roman", 
"'Trebuchet MS', Helvetica, sans-serif" => "Trebuchet MS", 
"Typewriter, monospace" => "Typewriter", 
"University, sans-serif" => "University", 
"Vagabond, sans-serif" => "Vagabond", 
"Verdana, Geneva, sans-serif" => "Verdana", 

"Webdings, sans-serif" => "Webdings", 
"Wingdings, 'Zapf Dingbats', sans-serif" => "Wingdings", 
"sans-serif" => "------Generic Fonts------", 
"serif" => "Serif", 
"sans-serif" => "Sans-Serif", 
"cursive" => "Cursive", 
"fantasy" => "Fantasy", 
"monospace" => "Monospace"
);




function echo_fonts_options($last_selected){
    if(!isset($last_selected) || !$last_selected){
        $last_selected = "Arial, Helvetica, sans-serif";
    }
    foreach ($GLOBALS['fonts_list_array'] as $value => $name){
        $formattedName = '<span style="font-family:\''.$value.'\'">'.$name.'</span>';
        if($last_selected == $value){
            echo '<option value="'.$value.'" selected="selected">'.$formattedName.'</option>';
        } else {
            echo '<option value="'.$value.'">'.$formattedName.'</option>';
        }
    }        
?>
<?php
}
