Template:Unichar
Error using {{unichar}}: Input "" is not a hexadecimal value (expected: like "09AF")
このテンプレートは
→{{unichar|a9|Copyright sign}}
は著作 権 表示 のための記号 です。
- U+00A9 © copyright signは
著作 権 表示 のための記号 です。
使用 法
[{{unichar|00A9|Copyright sign}}
→ U+00A9 © copyright sign.
このテンプレートは"U+00A9"のような
使用 例
[{{unichar|00A9|Copyright sign}}
→ U+00A9 © copyright sign{{unichar|00A9|Copyright sign|nlink=
→ U+00A9 © copyright sign著作 権 マーク}}{{unichar|00A9|Copyright sign|nlink=|note=[[コピーレフト]]
→ U+00A9 © copyright sign (コピーレフト記号 も参照 }}記号 も参照 ){{unichar|00A9|Copyright sign|nlink=
→ U+00A9 © copyright sign (169decimal, HTML:著作 権 マーク|dec=|html=}}©
©
){{unichar|00A0|No-break space|note=NBSP}}
→ U+00A0 no-break space (NBSP){{unichar|0007|nlink=Bell character}}
→ U+0007 <control-0007> Bell character{{unichar|0007|Bell character|nlink=}}
→ U+0007 <control-0007> Error using {{unichar}}: Pagename expected in "nlink="
パラメータ
[{{unichar
| <!-- 16進 値 、コードポイント("U+"は付 けないでください) -->
| <!-- Unicodeの名称 -->
| ulink =
| image =
| cwith =
| size =
| use =
| use2 =
| nlink =
| dec =
| html =
| note =
}}
インライン
{{unichar| <!--16進 値 ("U+"は付 けない)-->| <!--Unicodeの名称 -->|ulink= |image= |cwith= |size= |use= |use2= |nlink= |dec= |html= |note= }}
第 1パラメータ, 1=名前 なし,入力 必須 (プレフィックスの "1=" は省略 可 )。コードポイントの16進 値 を記入 (例 :00A9
)。
備考 : このパラメータはA9
、a9
、00A9
のような16進 値 も受 け付 けます。10進 値 は10進 値 であることが検知 されず、予期 しない結果 を返 すことになります(後述 のエラーメッセージを参照 )。
第 2パラメータ, 2=名前 なし(プレフィックスの "2=" は省略 可 )。その文字 のUnicodeでの名称 。このテンプレートはこの入力 値 をname in small capsとして使用 し、いかなる入力 値 も強制 的 に小 さな文字 にされます。この名称 はウィキペディアの記事 に対応 する名称 と異 なる場合 があります(以下 のnlink=を参照 )。
- nlink=
任意 入力 。ウィキリンク。リンク先 となるウィキペディアの記事 名 を記入 。記入 すると、Unicode名 (第 2パラメータ)にウィキリンクが付与 されます。もし記事 名 とUnicode名 が同一 ならば、第 2パラメータを使 わずに "nlink=" の指定 だけで十分 です。
制御 文字 については nlink パラメータを使用 してください。Unicode名 のパラメータ(第 2パラメータ)は使 われません。 nlink パラメータが小 さな文字 にされることなく代 わりに表示 されます。備考 : ページ名 は全 てのウィキページと同様 に大文字 と小文字 を区別 します。
{{unichar|00A9|Copyright sign|nlink=Copyright symbol}}
→ U+00A9 © copyright sign{{unichar|00A3|Pound sign|nlink=}}
→ U+00A3 £ pound sign.
- dec=
任意 入力 。テキストの括弧 内 に10進 値 を追加 します。
- html=
任意 入力 。テキストの括弧 内 にHTML文字 参照 を追加 します(例 : 
)。" "
のような「名前 文字 参照 」が存在 する場合 はそれも追加 されます。
- use=
任意 入力 。通常 のブラウザフォントに文字 が出現 しないかもしれないとき、グリフを取得 するためにフォントヒンティングのテンプレートを指定 します。既定 は{{unicode}}で、他 に{{IPA}}、{{lang}}、{{script}}の選択肢 があります。"use=lang" または "use=script" を指定 すると、use2が使用 され、言語 ("use2=fr") またはスクリプト ("use2=Cyrs") が指定 されるはずです。それでも、ブラウザの影響 のため、グリフが期待 された通 りに表示 されないままであることもあります。詳 しい説明 は各 テンプレートの説明 書 をご参照 ください。
{{unichar|0485|COMBINING CYRILLIC DASIA PNEUMATA|cwith=|use=script|use2=Cyrs}}
→ U+0485 ҅ combining cyrillic dasia pneumata
- image=
任意 入力 。グリフを表現 するために、フォントを完全 に無効 にしてファイル(画像 イメージ)を使用 できるようにします。ファイル名 は".svg"のような拡張子 まで含 めて記入 してください。ただし、"File:"のプレフィックスは不要 です。
- cwith=
任意 入力 。Unicode文字 が「結合 している」ときに有効 です。cwith=
を使用 して文字 の前 に空白 を追加 し、結合 の効果 を表 します。そのため、cwith=a
のような文字 と共 に使用 するとき、その文字 は "a" という文字 と結合 されます。Unicodeで結合 文字 を置 くために使 われる一般 的 なグリフはU+25CC ◌ dotted circle (HTML:◌
)です。
- cwith=
不 使用 時 の例 :{{unichar|0485|COMBINING CYRILLIC DASIA PNEUMATA}}
→ U+0485 ҅ combining cyrillic dasia pneumata
- cwith= パラメータ
未 記入 時 の例 :{{unichar|0485|COMBINING CYRILLIC DASIA PNEUMATA|cwith=}}
→ U+0485 ҅ combining cyrillic dasia pneumata
- cwith= パラメータにDOTTED CIRCLEを
記入 した時 の例 :{{unichar|0485|COMBINING CYRILLIC DASIA PNEUMATA|cwith=◌}}
→ U+0485 ◌҅ combining cyrillic dasia pneumata
- size=
任意 入力 。グリフのサイズを指定 したいときに使用 します。既定 値 は "size=125%" です。フォントについては、"7px", "150%", "2em", "larger"など、全 てのフォントサイズ指定 様式 を受 け付 けます。
{{unichar|0041|LATIN CAPITAL LETTER A|size=2em}}
→ U+0041 A latin capital letter a- フォントの
代 わりに画像 (ファイル)を使用 するときは、"12px"のようなピクセル単位 でのサイズ指定 様式 しか受 け付 けません。画像 を用 いる場合 の既定 値 は "10px" です。
{{unichar | A9 | Copyright sign | ulink = Universal Character Set characters | image = | size = 150% | nlink = Copyright symbol | note = Example }}
- U+00A9 © copyright sign (Example)
提示 形式 の効果
[Since this template is aimed at presenting a formatted, inline description, some effects are introduced to sustain this target.
- Showing space characters: All space characters (those with General Category: Zs) are presented with a light-blue background, to show their actual presence and width:
U+00A0 no-break space
.
- Incidentally, the regular space is replaced with
�A0;
(NBSP) to prevent wiki-markup deleting it as repeated spaces.
- Removing formatting characters: Formatting characters (those with General Category: Cf, Zl and Zp) are removed from the output. By definition, formatting characters have no glyph. By removing them they cannot have a formatting effect.
Exception: five Arabic Cf/formatting number markings U+0600..U+0603 and U+60DD, are shown. While Cf formatting characters usually have no glyph, these five have. By internally adding "(visible)" to the category, these characters are shown.
- Removing whitespace: The template removes formatting code and surrounding whitespace from the input. A <Return> in the Name-input (possibly unintended) would frustrate the in-line behaviour expectation.
- Showing a label like <control-0007>: Unicode states that a code point has no name when it is one of these: a control character, a private use character, a surrogate, a not assigned code point (reserved), or a non-character. These code points instead should be referred to by using a "Code Point Label", such as <private-use> or <private-use-E000>. In this situation, this template replaces the glyph with that label. This way, the correct presentation wins it over Unicode-usage to the letter of the law.
- "Control" general category=Cc:
<control>
or<control-0007>
- "Surrogate" general category=Cs:
<surrogate>
or<surrogate-D800>
- "Private Use": general category=Co:
<private-use>
or<private-use-FFA0>
- "Not a character" (minus the reserved code points, see below): general category=Cn:
<not-a-character>
,<non-character>
or<not-a-character-FFA0>
The second parameter (Unicode name) is not presented, since it cannot exist. It is possible to create a link to an article.
- Note: A <reserved> (unassigned) code point cannot be detected yet, and so is not presented with this label. These code points too are given Cn category.
- (Background on <>-labels: A Name can never have <>-brackets at all. These rules prevent mixing up a name with an actual control-character. So it will not happen that a bell rings when a page is opened that contains a Name of U+0007).
起 こりうるエラー
[- このテンプレートは
第 1パラメータ(16進 値 )に記入 漏 れがあるときにError-messageを返 します。 - 00G9のように
無効 な16進 値 を入力 するとエラーを返 します(G/gは16進 法 にない数値 であるため)。 - U+00A9のようにプレフィックス U+ を
付 け足 さないでください。正 しく認識 されません。 - もしもテンプレートが "2038" のようなコードポイントの
数値 だけを表示 する場合 は、おそらく{{unichar}}とは異 なるテンプレート{{unicode}}を使用 していることが考 えられます。 - グリフは
無効 にされ、<control-0007>のような label に変更 されることがあるかもしれません。これらの文字 にはUnicode名 がありません。nlinkは記事 に直接 リンクします("nlink=Bell signal"と入力 したときなど)。"nlink="(これはポンド記号 のような通常 の文字 については問題 なくリンクします)のように空欄 にした場合 は<labeled>文字 のために機能 しません(リンクとする文字 の名称 は全 くありません)。これはエラーを返 します。 - 1=98 のような10
進 値 の入力 値 は16進 値 の0098として読 み込 まれます。もしあなたが9810=6216のつもりで入力 したとしても、テンプレートがそれを検知 できることは絶対 にありません。これについては警告 は一切 発 せられず、U+0062ではなく、意図 した文字 と異 なるU+009816が誤 って表示 されます。
テクニカルノート
[The word "unichar" is used only in this English Wikipedia, as a name for this template. It has no meaning outside.
The template uses these subtemplates:
- {{unichar/main}} Accepts all the input from
{{unichar}}
. Calls several subtemplates to produce the textstrings, and then strings them together. Also checks for the error non-hex input. - {{unichar/ulink}} creates a piped link for the "U+" prefix.
- {{unichar/gc}} determines the Unicode general category, when this category is special (like, for control characters).
- {{unichar/glyph}} for rendering the glyph by font. Accepts "image=" that overrules the font. Uses also "use", "use2", "size", "cwith".
- {{unichar/na}} Produces the formatted name of the character in smallcaps. Accepts the "nlink=" to create a piped wikilink to an article. When the general category (gc) is special, the name will change into a <label-hhhh>.
- {{unichar/notes}} - Produces the three optional notes in brackets: decimal value, HTML-character reference (both decimal and by name like
&nbsp;
if that exists using{{numcr2namecr}}
) and the free text note as provided by the editor. Also does the brackets themselves.
- Using the main template as an input-easy feature, there are few calculations done (actually only two hex2dec), and allows for adding default values not too deep in the templates.
- The value "<#salted#>" is used internally to pass through a non-defined input parameter. This value is correct when about the Name, because a Unicode name cannot have the characters <##>, and so salted is the right word (meaning uninhibitable). For ease of code maintenance it is used in more places around.
諸 問題
[- Unassigned code points, to be labelled <reserved>, cannot be detected.
- When using use-script, use2 needs lowercase (e.g. 0485, Cyrs or cyrs)
- When using for one off the RTL formatting marks, its effect may break out of the template (text following goed rtl too). As it is now, this requires extra code.
関連 項目
[- {{unicode}} - Unicodeをより
広 く扱 うフォントを使用 して特殊 な文字 を表示 させたいときに使 えます。
外部 リンク
[Unicode
- Unicode charts - Unicodeの
文字 コード表 (PDF形式 ) - Fileformat.com search -
名称 、U+16進 値 またはU+10進 値 、フォントの記号 (コピー&ペースト)で検索 できる。 - Unicode Converter -
複数 文字 コンバータ