Halfwidth and fullwidth forms: Difference between revisions

Content deleted Content added
Undid revision 1295152914 by 27.55.70.178 (talk) Unexplained removal of content
 
(47 intermediate revisions by 36 users not shown)
Line 1:
{{shortShort description|Alternative width characters in East Asian typography}}
{{forFor|the Unicode block|Halfwidth and Fullwidth Forms (Unicode block)}}
[[File:Command Prompt on Windows XP (Korean).png|thumb|349px|A command prompt ([[cmd.exe]]) with Korean Localisationlocalisation, showing halfwidth and fullwidth characters]]
In [[CJK characters|CJK]] (Chinese, Japanese, and Korean) computing, [[graphic character]]s are traditionally classed into '''fullwidth''' (in{{efn|In [[Taiwan]] and [[Hong Kong]]: [[wikt:全形|全形]]; in CJK: [[wikt:全角|全角]]).}} and '''halfwidth''' (in{{efn|In [[Taiwan]] and [[Hong Kong]]: [[wikt:半形|半形]]; in CJK: [[wikt:半角|半角]]).}} characters. WithUnlike [[Monospacedmonospaced font|fixed-width fonts]]s, a halfwidth character occupies half the width of a fullwidth character, hence the name.
 
''[[Halfwidth and Fullwidth Forms (Unicode block)|Halfwidth and Fullwidth Forms]]'' is also the name of a [[Unicode block]] U+FF00–FFEF, provided so that older encodings containing both halfwidth and fullwidth characters can have lossless translation to/ and from Unicode.
 
==Rationale==
{{UnreferencedMore citations needed section|date=NovemberApril 20182021}}
[[File:Alternative names of JIS X 0213.svg|thumb|Characters which appear in both [[JIS X 0201]] (single byte) and [[JIS X 0208]] / [[JIS X 0213]] (double byte) have both a halfwidth and a fullwidth form in [[Shift JIS]].|class=skin-invert]]
In the days of [[text mode]] computing, Western characters were normally laid out in a grid on the screen, often 80 columns by 24 or 25 lines. Each character was displayed as a small [[dot matrix]], often about 8 [[pixel]]s wide, and aan [[SBCS]] (single-byte character set) was generally used to encode characters of Western languages.
 
For aaesthetic numberreasons ofand practicalreadability, andit aestheticis reasonspreferable for [[HanChinese charactercharacters]]s need to be approximately square-shaped, approximatelytherefore twice as wide as these fixed-width SBCS characters. As these were typically encoded in a [[double-byte character set|DBCS]] (double-byte character set), this also meant that their width on screen in a [[duospaced font]] was proportional to their byte length. Some terminals and editing programs could not deal with double-byte characters starting at odd columns, only even ones (some could not even put double-byte and single-byte characters in the same line). So the DBCS sets generally included Roman characters and digits also, for use alongside the CJK characters in the same line.
 
On the other hand, early Japanese computing used a single-byte code page called [[JIS X 0201]] for [[katakana]]. These would be rendered at the same width as the other single-byte characters, making them [[half-width kana]] characters rather than normally proportioned kana. Although the JIS X 0201 standard itself did not specify half-width display for katakana, this became the visually distinguishing feature in [[Shift JIS]] between the single-byte JIS X 0201 and double-byte [[JIS X 0208]] katakana. Some IBM code pages used a similar treatment for [[Hangul#Letters|Korean jamo]],<ref name="ibm933">{{cite web |url=http://demo.icu-project.org/icu-bin/convexp?conv=ibm-933 |title=ICU Demonstration - Converter Explorer|author=|date= |website=demo.icu-project.org |accessdateaccess-date=7 May 2018}}</ref> based on the [[KS C 5601#1974|N-byte Hangul code]] and its [[EBCDIC]] translation.
 
==In Unicode==
{{see also|Halfwidth and Fullwidth Forms (Unicode block)}}
For compatibility with existing character sets that contained both half- and fullwidth versions of the same character, [[Unicode]] allocated a single block at U+FF00&ndash;FFEF containing the necessary "alternative width" characters. This includes a fullwidth version of all the [[ASCII]] characters and some non-ASCII punctuation such as the Yen sign, halfwidth versions of katakana and [[hangul]], and halfwidth versions of some naturally squareother symbols such as circles. Only characters needed for lossless round trip to existing character sets were allocated, rather than (for instance) making a fullwidth version of every Latin accented character.
 
Unicode assigns ''every'' code point an "East Asian width" [[Unicode character property|property]]. This may be:<ref name="uax11">{{cite web |url=https://unicode.org/reports/tr11/ |title=Unicode® Standard Annex #11: East Asian Width |last1=Lunde |first1=Ken |authorlinkauthor-link=Ken Lunde |publisher=[[Unicode Consortium]] |date=2019-01-25}}</ref>
 
{|class=wikitable
Line 47:
|}
 
[[Terminal emulator]]s can use this property to decide ifwhether a character should consume one or two "columns" when figuring out tabs and cursor position.
 
== In OpenType ==
[[OpenType]] has the ''<code>fwid''</code>, ''<code>halt''</code>, ''<code>hwid''</code>, and ''<code>vhal''</code> "feature tags" to be used forto providingreproduce fullwidth or halfwidth form of a character. [[CSS]] provides control over these features using <code>font-variant-east-asian</code> and <code>font-feature-settings</code> properties.<ref>{{cite web |url=https://helpx.adobe.com/fonts/using/open-type-syntax.html |title=Syntax for OpenType features in CSS |publisher=[[Adobe Inc.|Adobe]] |access-date=2023-09-20}}</ref>
 
== See also ==
 
* [[Han unification]]
* [[CJK Symbols and Punctuation (Unicode block)|East Asian punctuation]]
* [[Em size]] – full width forms
* [[Enclosed Alphanumerics]] – bullet point sequences,; some appear as full widthfullwidth (e.g. ⒈, ⓵, ⑴, ⒜, ⓐ)
* [[Han unification]]
* [[Hangul Jamo (Unicode block)]]
* [[Katakana (Unicode block)]]
* [[Latin script in Unicode]]
 
* [[Enclosed Alphanumerics]] – bullet point sequences, some appear as full width (e.g. ⒈,⓵,⑴,⒜,ⓐ)
==Notes==
{{Notelist}}
 
==References==
Line 70 ⟶ 72:
{{Unicode navigation}}
 
[[Category:East Asian typography]]
[[Category:Kana]]
[[Category:Hangul jamo|*Halfwidth]]