:Unichar/설명문서

위키백과, 우리 모두의 백과사전.

이 틀은 텍스트 사이에 유니코드 문자에 대한 설명을 만들어줍니다.

  • {{unichar|a9|Copyright sign}} 기호는 지적 재산을 뜻한다.
U+00A9 © copyright sign 기호는 지적 재산을 뜻한다.

사용법[편집]

이 틀은 일반적인 텍스트 사이에 유니코드 문자에 대한 "서식화된 설명"을 제공합니다. 유니코드 십육진 코드 값과 이름이 필요합니다. {{unichar|00A9|Copyright sign}}U+00A9 © copyright sign

"U+00A9"와 같은 유니코드 문자에 대한 표준 표현을 따르며, 작은 대문자(small caps)를 이용해서 문자 이름을 모두 대문자로 만듭니다. 십육진 코드 값은 반드시 입력해야 하며, 나머지는 선택입니다. 글자 자형은 유니코드 글꼴의 자형으로 보여질 것이며, 자세한 지정을 통해 언어나 IPA에 특화된 글꼴의 자형으로 보이게 할 수도 있습니다. 또는 글자를 보이게 하기 위해 그림으로 글자를 덮어씌울 수도 있습니다. 문자에 관련된 링크를 만들 수 있으며, 십진 코드값과 참고용 글귀를 달 수 있습니다.

제어 문자 또는 공백 문자와 같이 특별한 코드 포인트는 unichar/gc 틀에 따라 자동으로 따로 처리하게 됩니다.

예시[편집]

  • {{unichar|00A9|Copyright sign}}U+00A9 © copyright sign
  • {{unichar|00A9|Copyright sign|링크=저작권 기호}}U+00A9 © copyright sign
  • {{unichar|00A9|Copyright sign|링크=저작권 기호|참고=[[카피레프트]] 기호 참고}}U+00A9 © copyright sign (카피레프트 기호 참고)
  • {{unichar|00A9|Copyright sign|링크=저작권 기호|십진=|html=}}U+00A9 © copyright sign (169decimal, HTML: © ©)
  • {{unichar|00A0|No-break space|참고=NBSP}}U+00A0   no-break space (NBSP)
  • {{unichar|0007|링크=벨 문자}}U+0007 <control-0007> 벨 문자

변수[편집]

{{unichar
| <!-- 십육진 코드 값 ("U+" 없이 입력)-->
| <!-- 유니코드 이름 -->
| U =
| 그림 =
| 조합 =
| 크기 =
| use =
| use2 =
| 링크 =
| 십진 =
| html =
| 참고 =
}}
{{unichar| <!-- 십육진 코드 값 ("U+" 없이 입력)-->| <!-- 유니코드 이름 -->|U= |그림= |조합= |크기= |use= |use2= |링크= |십진= |html= |참고= }}
  • 1번 변수, 1= (필수, "1="은 생략하여도 된다). 십육진 코드 값입니다.
참고: A9, a9, 00A9와 같이 십육진수로 입력해야 합니다. 십진 값은 자동으로 처리되지 않으며, 오류 메시지를 표출할 수 있습니다.
  • 2번 변수, 2= ("2="은 생략하여도 된다). 문자의 유니코드 이름입니다. 입력한 값은 자동으로 작은 대문자(small caps)로 나타납니다. 이 값은 연결될 위키백과 글과 다를 수도 있습니다: "링크="을 참조하세요.
  • 링크=, nlink= 위키링크를 달아줍니다. 연결되기를 원하는 문서 제목을 입력합니다. 문서 제목이 유니코드 이름과 같다면, 간단히 "링크="만 입력하는 것으로 해결되나, 문자의 유니코드 이름은 로마자이고, 한국어 위키백과의 대부분의 개별 문자에 관한 문서의 제목은 로마자로 쓰인 일이 드무므로, 입력 값 없이 쓰일 일은 거의 없을 것입니다.
제어 문자에 이 변수가 쓰였다면, 유니코드 이름 대신 이 변수에 입력한 값을 작은 대문자로 처리하지 않고 보여줍니다.
참고: 정확한 문서 이름을 입력해 주세요.
{{unichar|00A9|Copyright sign|링크=저작권 기호}}U+00A9 © copyright sign
  • U, ulink U+ 자리에 링크를 만들어줍니다. ulink=|과 같이 값을 입력하지 않았다면 유니코드로 링크가 걸립니다: U+.
  • 십진=, dec= 유니코드 십진 코드 값을 나타냅니다.
  • html= (선택 사항) HTML 문자 참조를 &#160; 꼴처럼 추가로 나타내 줍니다. "&nbsp;"의 예와 같이 이름이 있는 문자 참조가 있다면, 그것 또한 같이 나타납니다.
  • use= (선택 사항) 글리프에 알맞은 글꼴을 지정하게 합니다. 기본값은 {{unicode}}이며, {{IPA}}, {{lang}} 또한 선택할 수 있습니다. "use=lang"이 쓰일 때, use2에는 언어 ("use2=fr") 속성이 반드시 입력되어야 합니다.
  • 그림=, image= (선택 사항) 글리프를 나타내는 파일(그림)을 쓸 수 있습니다. "파일:"은 생략해야 합니다.
  • 조합=, cwith= (선택 사항) 유니코드 글자가 조합용 글자일 때 쓰면 좋습니다. 조합= 꼴로 쓰면 글자 전에 공백을 더해 주어 조합 효과가 나타나게 합니다. cwith=a 꼴과 같이 쓴다면, 글자는 "a"와 같이 조합되어 나타납니다. 유니코드에서 조합용 글자를 나타낼 때 함께 쓰이는 글자는 주로 U+25CC dotted circle (HTML: &#9676;)(점선 원)입니다..
조합= 없을 때:
{{unichar|0485|COMBINING CYRILLIC DASIA PNEUMATA}}U+0485 ҅ combining cyrillic dasia pneumata
변숫값 없는 조합=:
{{unichar|0485|COMBINING CYRILLIC DASIA PNEUMATA|조합=}}U+0485  ҅  combining cyrillic dasia pneumata
점선 원을 넣은 조합=:
{{unichar|0485|COMBINING CYRILLIC DASIA PNEUMATA|cwith=&#9676;}}U+0485 ◌҅ combining cyrillic dasia pneumata
  • 크기=, size= (선택 사항) 글리프의 크기를 조절합니다. 기본값은 "125%"로 되어 있습니다. "7px", "150%", "2em", "larger" 등 어떠한 형태의 크기 값이라도 지정 가능합니다.
{{unichar|0041|LATIN CAPITAL LETTER A|크기=2em}}U+0041 A latin capital letter a
그림=에 그림이 쓰인다면, 픽셀 값만 입력이 가능합니다. 이때 기본값은 10px입니다.
{{unichar
| A9
| Copyright sign
| U = 유니코드
| 그림 = 
| 크기 = 150%
| 링크 = 저작권 기호
| 참고 = 예시
}}

과 같이 쓴다면...

Presentation effects[편집]

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 &#00A0; (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 an 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).

Possible errors[편집]

  • The template produces an Error-message when parameter #1 (hex value) is missing.
  • A non-hexadecimal input like 00G9 produces an error (Because G/g is not hexadecimal).
  • Do not add the U+-prefix like U+00A9. It will not be recognised.
  • If the template only shows the code point number, like "2038", you're probably using the wrong template {{unicode}}, instead of {{unichar}}.
  • The glyph may be overruled and changed into a label like <control-0007>. These characters have no Unicode name. An nlink will be directly to the article (entered in "nlink=Bell signal"). A blank like this "nlink=", (which links fine for regular characters like Pound sign), cannot work for <labeled> characters (there is no character name at all to make into a link). This produces an error.
  • A decimal value input like 1=98 will be read as being hexadecimal value 0098. There is no way that the template can detect you intended to enter 9810=6216.No warning is issued, and the wrong character, U+009816, will be shown (not U+0062).

Technical notes[편집]

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 &amp;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.

Issues[편집]

  • 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.

같이 보기[편집]

  • {{유니코드}} - Produces rare characters, using fonts that cover Unicode more widely.

틀:유니코드 틀

External links[편집]

Useful links for researching Unicode characters:

  • Unicode charts, gives the chart (in PDF) on which the U+value is located.
  • Fileformat.com search, to search by name (whole or partial), by U+ hex value or decimal value, by the font symbol (copy-past it). Extra information per character. One character only.
  • [1] a multi-character converter.