*テーブル内のフォントサイズを一括指定できるように [#vd8de5c7] -ページ: BugTrack -投稿者: [[reimy]] -優先順位: 普通 -状態: 提案 -カテゴリー: 本体新機能 -投稿日: 2003-05-31 (土) 22:58:43 -バージョン: **メッセージ [#nc2d19cf] 現在、テーブル内のフォントサイズは各セル内で&sizeで指定しないと変更できませんが、| |cなどの中で、COLOR:やBGCOLOR:のように一括指定できるようにSIZE:もほしい。 参考:[[pukiwiki:質問箱#tablefont]] ---- -こんな感じで。 -- [[ぱんだ]] &new{2003-06-01 (日) 23:19:39}; diff -u -r1.41 convert_html.php --- convert_html.php 29 May 2003 09:25:43 -0000 1.41 +++ convert_html.php 1 Jun 2003 14:18:39 -0000 @@ -392,18 +392,23 @@ parent::Block(); $this->style = array(); - while (preg_match('/^(?:(LEFT|CENTER|RIGHT)|(BG)?COLOR\(([#\w]+)\)):(.*)$/',$text,$matches)) + while (preg_match('/^(?:(LEFT|CENTER|RIGHT)|(BG)?COLOR\(([#\w]+)\)|SIZE\(([\d\w]+)\)):(.*)$/',$text,$matches)) { if ($matches[1]) { $this->style['align'] = 'text-align:'.strtolower($matches[1]).';'; - $text = $matches[4]; + $text = $matches[5]; } else if ($matches[3]) { $name = $matches[2] ? 'background-color' : 'color'; $this->style[$name] = $name.':'.htmlspecialchars($matches[3]).';'; - $text = $matches[4]; + $text = $matches[5]; + } + else if ($matches[4]) + { + $this->style['size'] = 'font-size:'.htmlspecialchars($matches[4]).';'; + $text = $matches[5]; } } if ($is_template) { -フォントサイズの指定は&size;と同じくpxで統一。 -- [[reimy]] &new{2003-06-03 (火) 05:01:09}; - while (preg_match('/^(?:(LEFT|CENTER|RIGHT)|(BG)?COLOR\(([#\w]+)\)|SIZE\(([\d\w]+)\)):(.*)$/',$text,$matches)) + while (preg_match('/^(?:(LEFT|CENTER|RIGHT)|(BG)?COLOR\(([#\w]+)\)|SIZE\(([\d]+)\)):(.*)$/',$text,$matches)) { if ($matches[1]) { $this->style['align'] = 'text-align:'.strtolower($matches[1]).';'; $text = $matches[5]; } else if ($matches[3]) { $name = $matches[2] ? 'background-color' : 'color'; $this->style[$name] = $name.':'.htmlspecialchars($matches[3]).';'; $text = $matches[5]; } else if ($matches[4]) { - $this->style['size'] = 'font-size:'.htmlspecialchars($matches[4]).';'; + $this->style['size'] = 'font-size:'.htmlspecialchars($matches[4]).'px;'; $text = $matches[5]; } } #comment