For faster navigation, this Iframe is preloading the Wikiwand page for ゼロ幅スペース.

ゼロ幅スペース

ゼロ幅スペース(ゼロはばスペース、: zero width space, ZWSP)は、コンピュータの組版に用いられる非表示文字で、文書処理システムに対して語の切れ目を示すのに用いる。通常、英語などのわかち書きをする言語において、文の途中で改行を入れる場合はスペースの位置で行われる。しかし、スラッシュなどの記号の後などスペースは入らないが改行をしても良い箇所や、日本語などのわかち書きをしない言語において、改行できる位置を明示するためにゼロ幅スペースが用いられる。

使用法

[編集]

HTMLでは<wbr>要素の代替として、長い単語の途中で改行可能な場所を示すのに使われる。ただし、バージョン6以前のInternet Explorerなど、これを正しく表示できないWebブラウザもある[1]

以下はゼロ幅スペースを使った例である。lorem ipsumキャメルケースでつなぎ、全ての単語の間にゼロ幅スペースを入れている。

Lorem​Ipsum​Dolor​Sit​Amet​Consectetur​Adipiscing​Elit​Sed​Do​Eiusmod​Tempor​Incididunt​Ut​Labore​Et​Dolore​Magna​Aliqua​Ut​Enim​Ad​Minim​Veniam​Quis​Nostrud​Exercitation​Ullamco​Laboris​Nisi​Ut​Aliquip​Ex​Ea​Commodo​Consequat​Duis​Aute​Irure​Dolor​In​Reprehenderit​In​Voluptate​Velit​Esse​Cillum​Dolore​Eu​Fugiat​Nulla​Pariatur​Excepteur​Sint​Occaecat​Cupidatat​Non​Proident​Sunt​In​Culpa​Qui​Officia​Deserunt​Mollit​Anim​Id​Est​Laborum

同じ文でゼロ幅スペースを使用しないと以下のようになる。

LoremIpsumDolorSitAmetConsecteturAdipiscingElitSedDoEiusmodTemporIncididuntUtLaboreEtDoloreMagnaAliquaUtEnimAdMinimVeniamQuisNostrudExercitationUllamcoLaborisNisiUtAliquipExEaCommodoConsequatDuisAuteIrureDolorInReprehenderitInVoluptateVelitEsseCillumDoloreEuFugiatNullaPariaturExcepteurSintOccaecatCupidatatNonProidentSuntInCulpaQuiOfficiaDeseruntMollitAnimIdEstLaborum

ブラウザがゼロ幅スペースに対応しているならば、1つ目の例はブラウザのウィンドウ幅を変えたときに単語の間で改行されるが、2つ目の例は改行されないことがわかる。

文字コード

[編集]

Unicodeでは、ゼロ幅スペースはU+200B zero width space (HTML: &#8203;)に割り当てられている[2]

TeXでは\hskip0ptLaTeXでは\hspace{0pt}[3]groffでは\:[4]と表現される。

出典

[編集]
  1. ^ Better Web Typography with Spaces and Hyphens”. 2010年12月14日時点のオリジナルよりアーカイブ。2016年4月5日閲覧。
  2. ^ General Punctuation – Unicode”. 2013年7月20日閲覧。
  3. ^ The LaTeX Companion. Chapter 3: Basic Formatting Tools”. 2014年2月8日閲覧。
  4. ^ groff(7) - Linux manual page”. 2014年2月8日閲覧。

参考文献

[編集]

関連項目

[編集]
{{bottomLinkPreText}} {{bottomLinkText}}
ゼロ幅スペース
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?