2

Wanting to use the new text-stroke css attribute on some fonts, but as of this moment, only webkit has support for it.

Are there any cross-browser compatible methods of applying text-stroke?

I have been looking into javascript solutions such as Cufon and there seems to be a feature request put in for supporting it already: Cufon text-stroke feature request. sIFR doesn't seem to support stroke/outlines either..

4

3 に答える 3

3

少しハックですが、Cufon のテキスト シャドウを使用して実行できます。

Cufon.replace("h2", {hover:'true', textShadow: "#ff0000 1px 1px, #ff0000 -1px -1px"});

2 つのテキスト シャドウを使用し、それらを対角線上に配置します。

于 2010-05-05T17:27:02.097 に答える
0

Drupalソリューションを探している場合。カスタムモジュールとcufonモジュールを依存関係としてインストールして次のことを行いました。

通常どおりcufonをセットアップしてから、次のようにサブモジュールを追加します。

cbi_cufon.module

<?php
// $Id$

/**
 * Implementation of hook_init().
 *
 * Just adding in our cufon definitions.
 */
function cbi_cufon_init() {
  $settings = array(
    array(
      'selector' => '#site-slogan',
      'options' => array(
        'fontFamily' => 'Fontname', // Likely need to change this to match yours or remove this line completely if you will have only one cufon font
        'textShadow' => '1px 0px #FFFFFF, 0px 1px #FFFFFF, -1px 0px #FFFFFF, 0px -1px #FFFFFF, 2px 2px #DDDDDD',
      ),
    ),
  );
  drupal_add_js(array('cufonSelectors' => $settings), 'setting');
}

cbi_cufon.info

;$Id$
name = Cufon font definitions
description = Adds font definitions for CBI.
core = 6.x
version = VERSION
dependencies[] = cufon

これが操作に役立たない場合は、他の誰かに役立つことを願っています。さらに、私はflirモジュールを試しましたが、予測できませんでした

于 2011-02-15T04:24:23.040 に答える
0

あはは!この質問を投稿した直後にFLIRを発見しました。

テキスト ストローク効果の例を次に示します: http://facelift.mawhorter.net/doc/plugins-quickeffects

quickeffects プラグインはダウンロードに含まれています。

興味のある人のための素晴らしい drupal モジュール: http://drupal.org/project/flir

于 2010-04-02T18:53:06.720 に答える