Dotclear

Changeset 376:e3fd223da7f8


Ignore:
Timestamp:
06/16/11 13:01:26 (14 years ago)
Author:
Franck <carnet.franck.paul@…>
Branch:
themes
Message:

Configuration des polices - step 1 : family

Location:
themes/ductile
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • themes/ductile/_config.php

    r357 r376  
    1313 
    1414l10n::set(dirname(__FILE__).'/locales/'.$_lang.'/main'); 
     15 
     16$fonts = array( 
     17     __('default') => '', 
     18     __('Ductile primary') => 'Ductile body', 
     19     __('Ductile secondary') => 'Ductile alternate', 
     20     __('Times New Roman') => 'Times New Roman', 
     21     __('Georgia') => 'Georgia', 
     22     __('Garamond') => 'Garamond', 
     23     __('Helvetica/Arial') => 'Helvetica/Arial', 
     24     __('Verdana') => 'Verdana', 
     25     __('Trebuchet MS') => 'Trebuchet MS', 
     26     __('Impact') => 'Impact', 
     27     __('Monospace') => 'Monospace' 
     28); 
    1529 
    1630function adjustColor($c) 
     
    4054     'body_link_c' => null, 
    4155     'body_link_v_c' => null, 
    42      'body_link_f_c' => null 
     56     'body_link_f_c' => null, 
     57     'body_font' => null, 
     58     'alternate_font' => null 
    4359); 
    4460 
     
    5975          $ductile_user['body_link_v_c'] = adjustColor($_POST['body_link_v_c']); 
    6076           
     77          $ductile_user['body_font'] = $_POST['body_font']; 
     78          $ductile_user['alternate_font'] = $_POST['alternate_font']; 
     79           
    6180          $core->blog->settings->addNamespace('themes'); 
    6281          $core->blog->settings->themes->put('ductile_style',serialize($ductile_user)); 
     
    7493} 
    7594 
     95echo '<fieldset><legend>'.__('Fonts').'</legend>'. 
     96'<p class="field"><label for="body_font">'.__('Main font:').' '. 
     97form::combo('body_font',$fonts,$ductile_user['body_font']).'</label></p>'. 
     98 
     99'<p class="field"><label for="alternate_font">'.__('Alternate font:').' '. 
     100form::combo('alternate_font',$fonts,$ductile_user['alternate_font']).'</label></p>'. 
     101'</fieldset>'; 
     102 
    76103echo '<fieldset><legend>'.__('Links').'</legend>'. 
    77104'<p class="field"><label for="body_link_c">'.__('Links color:').' '. 
  • themes/ductile/_public.php

    r357 r376  
    4343          # Properties 
    4444 
     45          # Main font 
     46          $main_font_selectors = 'body, #supranav li a span, #comments.me, a.comment-number'; 
     47          self::prop($css,$main_font_selectors,'font-family',self::fontDef($s['body_font'])); 
     48 
     49          # Alternate font 
     50          $alternate_font_selectors = '#blogdesc, #supranav li, #content-info, #subcategories, #comments-feed, #sidebar h2, #sidebar h3, #footer p'; 
     51          self::prop($css,$alternate_font_selectors,'font-family',self::fontDef($s['alternate_font'])); 
     52 
     53          # Link colors 
    4554          self::prop($css,'a','color',$s['body_link_c']); 
    4655          self::prop($css,'a:visited','color',$s['body_link_v_c']); 
    4756          self::prop($css,'a:hover, a:focus, a:active','color',$s['body_link_f_c']); 
    4857 
     58          # Style directives 
    4959          $res = ''; 
    5060          foreach ($css as $selector => $values) { 
     
    5969     } 
    6070 
     71     protected static $fonts = array( 
     72          'Ductile body' => '"Century Schoolbook", "Century Schoolbook L", Georgia, serif', 
     73          'Ductile alternate' => '"Franklin gothic medium", "arial narrow", "DejaVu Sans Condensed", "helvetica neue", helvetica, sans-serif', 
     74          'Times New Roman' => 'Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif', 
     75          'Georgia' => 'Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif," "Bitstream Vera Serif", "Liberation Serif", Georgia, serif', 
     76          'Garamond' => '"Palatino Linotype", Palatino, Palladio, "URW Palladio L", "Book Antiqua", Baskerville, "Bookman Old Style", "Bitstream Charter", "Nimbus Roman No9 L", Garamond, "Apple Garamond", "ITC Garamond Narrow", "New Century Schoolbook", "Century Schoolbook", "Century Schoolbook L", Georgia, serif', 
     77          'Helvetica/Arial' => 'Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif', 
     78          'Verdana' => 'Corbel, "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", "Bitstream Vera Sans", "Liberation Sans", Verdana, "Verdana Ref", sans-serif', 
     79          'Trebuchet MS' => '"Segoe UI", Candara, "Bitstream Vera Sans", "DejaVu Sans", "Bitstream Vera Sans", "Trebuchet MS", Verdana, "Verdana Ref", sans-serif', 
     80          'Impact' => 'Impact, Haettenschweiler, "Franklin Gothic Bold", Charcoal, "Helvetica Inserat", "Bitstream Vera Sans Bold", "Arial Black", sans-serif', 
     81          'Monospace' => 'Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace' 
     82     ); 
     83 
     84     protected static function fontDef($c) 
     85     { 
     86          return isset(self::$fonts[$c]) ? self::$fonts[$c] : null; 
     87     } 
     88 
    6189     protected static function prop(&$css,$selector,$prop,$value) 
    6290     { 
  • themes/ductile/locales/fr/main.po

    r357 r376  
    11msgid "Style sheet upgraded." 
    22msgstr "Feuille de style mise à jour." 
     3 
     4msgid "Fonts" 
     5msgstr "Polices de caractère" 
     6 
     7msgid "Main font:" 
     8msgstr "Famille de police principale :" 
     9 
     10msgid "Alternate font:" 
     11msgstr "Famille de police secondaire :" 
     12 
     13msgid "Ductile primary" 
     14msgstr "Principale de Ductile" 
     15 
     16msgid "Ductile secondary" 
     17msgstr "Secondaire de Ductile" 
     18 
     19msgid "Times New Roman" 
     20msgstr "Times New Roman" 
     21 
     22msgid "Georgia" 
     23msgstr "Georgia" 
     24 
     25msgid "Garamond" 
     26msgstr "Garamond" 
     27 
     28msgid "Helvetica/Arial" 
     29msgstr "Helvetica/Arial" 
     30 
     31msgid "Verdana" 
     32msgstr "Verdana" 
     33 
     34msgid "Trebuchet MS" 
     35msgstr "Trebuchet MS" 
     36 
     37msgid "Impact" 
     38msgstr "Impact" 
     39 
     40msgid "Monospace" 
     41msgstr "Monospace" 
Note: See TracChangeset for help on using the changeset viewer.

Sites map