Unicode spaces - Jukka K. Korpela
文章推薦指數: 80 %
Unicode spaces ; U+202F, NARROW NO-BREAK SPACE, foo bar, Narrower than NO-BREAK SPACE (or SPACE), “typically the width of a thin space or a mid space” ; U+205F ...
Unicodespaces
Thisdocumentliststhevarious
spacecharactersinUnicode.
Foradescription,consultchapter
6 WritingSystemsandPunctuation
andblockdescription
GeneralPunctuation
intheUnicodestandard.Thisdocumentalsoliststhreecharacters
thathavenowidthandcanthusbedescribedasno-widthspaces.
Thethirdcolumnofthefollowingtableshowstheappearance
ofthespacecharacter,inthesensethatthecellcontainsthe
words“foo”and“bar”inborderedboxes
separatedbythatcharacter.
Itis
possiblethatyourbrowserdoesnotpresentallthespacecharacters
properly.Thisdependsonthefontused,onthebrowser,
andonthefontsavailableinthesystem.
Spacecharactersand“zero-widthspaces”inUnicode
Code
Nameofthecharacter
Sample
Widthofthecharacter
U+0020SPACEfoobar
Dependsonfont,typically1/4em,oftenadjusted
U+00A0NO-BREAKSPACEfoo bar
Asaspace,butoftennot
adjusted
U+1680OGHAMSPACEMARKfoo bar
Unspecified;usuallynotreallyaspacebutadash
U+180EMONGOLIANVOWELSEPARATORfoobar
0
U+2000ENQUADfoo bar
1en(=1/2em)
U+2001EMQUADfoo bar
1em(nominally,theheightofthefont)
U+2002ENSPACE(nut)foo bar
1en(=1/2em)
U+2003EMSPACE(mutton)foo bar
1em
U+2004THREE-PER-EMSPACE(thickspace)foo bar
1/3em
U+2005FOUR-PER-EMSPACE(midspace)foo bar
1/4em
U+2006SIX-PER-EMSPACEfoo bar
1/6em
U+2007FIGURESPACEfoo bar
“Tabularwidth”,thewidthofdigits
U+2008PUNCTUATIONSPACEfoo bar
Thewidthofaperiod“.”
U+2009THINSPACEfoo bar
1/5em(orsometimes1/6em)
U+200AHAIRSPACEfoo bar
NarrowerthanTHINSPACE
U+200BZEROWIDTHSPACEfoobar
0
U+202FNARROWNO-BREAKSPACEfoo bar
NarrowerthanNO-BREAKSPACE(orSPACE),
“typicallythe
widthofathinspaceoramidspace”
U+205FMEDIUMMATHEMATICALSPACEfoo bar
4/18em
U+3000IDEOGRAPHICSPACEfoo bar
Thewidthofideographic(CJK)characters.
U+FEFFZEROWIDTHNO-BREAKSPACEfoobar
0
“Zero-widthspaces”
Previously
MONGOLIANVOWELSEPARATOR(U+180E)
wasclassifiedasaspacecharacter,nowasformattingcharacters(withnowidth).
Thecharacters
ZEROWIDTHSPACE(U+200B)and
ZEROWIDTHNO-BREAKSPACE(U+FEFF)wereneverclassified
asspacecharactersinUnicode,despitetheirname.
ZEROWIDTHSPACE,whensupported,canbeusedtoindicatealinebreaking
opportunitywithinastring.Similarly,
ZEROWIDTHNO-BREAKSPACEcanbeusedbetweentwocharactersto“glue”
themtogether,sothattheynolinebreakingappearsbetweenthemeven
ifnormalprocessingruleswouldallowthat.
Widthsofspacecharacters
ThecharactersU+2000…U+2006,whenimplementedinafont,usuallyhave
thespecificwidthdefinedforthem,thoughsmalldeviationsexist.
Theirwidthsaredefinedintermsoftheemunit,i.e.thesizeofthefont.
ThecharactersU+2007…U+200AandU+202Fhavenoexactwidthassignedtothem
inthestandard,andimplementationsmaydeviateconsiderablyevenfromthe
suggestedwidths.Moreover,whenconceptswiththesamenames,suchas
“thinspace”,areusedinpublishingsoftware,themeaningscanberatherdifferent.
Forexample,inInDesign,“thinspace”isnow1/8 em
(i.e.0.125 em,asoppositetothesuggested0.2 em)
and
“hairspace”only1/24 em(i.e.about0.042 em,whereasthewidthofa
THINSPACEglyphtypicallyvariesbetween0.1 emand0.2 em).
Notesonsupportinbrowsersandothersoftware
Webbrowsersandotherprogramsmayfail
torenderallspacecharactersaccording
totheirdefinitionsordescriptions.
Manycommonlyusedfontslacksomeofthespacecharacters.
Thesituationhasimprovedovertheyears,butcautionisstill
neededespeciallywhentextdatamayneedtobetransferredfrom
oneprogramtoanotherormaybeviewedusingdifferentfonts.
Modernbrowserscanusuallyfindaglyphforacharacter
ifsomeofthefontsinthesystemcontainit.Thisdoesnot
alwaystakeplace,however,
SeeGuidetousingspecialcharactersinHTML.
Moreover,fontsubstitutionmaycauseundesiredeffects,sincethewidths
ofcharactersvarybyfont.
Theuseofvariousspacecharactersofspecific
width,suchasTHINSPACE,
isoftenanunnecessaryrisk.
Considerusingothermethods,suchasthe
featuresofatextprocessingprogramor(onWebpages)CSSpropertieslike
padding,
margin,
word-spacing,
and
letter-spacing.
Widthadjustments
Intextprocessing,Webpagedisplay,andothercontexts,
spacecharactersareoften“adjustable”inthe
sensethattheyarepresentedindifferentwidths,especially
tosatisfyjustificationrequirements.Youmightseethisineffectin
thisparagraph.Justificationoftenjustmakesspaceswider,though
itmayshrinkthem,too,especiallyintypesetting.
No-breakspaces
aredefinedinUnicodeashavingthesamewidthasspaces.
Thisdoesnotspecifywhatshouldhappentothemin
justification.
Thecommonpracticehasbeentotreatthem
ashavingfixedwidth(ineachfont),whichmeansthat
inadjustedtext,spacesandno-breakspaceshavedifferenteffects.
Onwebbrowsers,no-breakspacestendedtobenon-adjustable,
butmodernbrowsersgenerallystretchthemonjustification.
Within
justifiedtextonwebpages,
authorsmayhaveusedno-breakspacesinsteadofnormalspaces
topreventstretching(e.g.,asin5 minstead
of5 m).Duetochangesinbrowserbehavior,
itisbettertousefixed-widthspacesinstead.Amongthem,thefour-per-em
space
(e.g.,asin5 m)
usuallybestcorrespondstothewidthofanormalunstretched
space.However,thefixed-widthspacesactasnormalspaces
inlinebreaking,soyoumaywishtousesometechniqueto
preventundesiredlinebreaks
(e.g.,
asin
延伸文章資訊
- 1“space” Unicode Characters, Symbols & Entities Search
Discover your character · \000020  " "U+20%20spacebasic latin · ☄ \002604☄☄...
- 2- Space: U+0020 - Unicode Character Table
Symbol meaning. Space. Basic Latin. Space was approved as part of Unicode 1.1 in 1993. Properties...
- 3Unicode spaces - Jukka K. Korpela
Unicode spaces ; U+202F, NARROW NO-BREAK SPACE, foo bar, Narrower than NO-BREAK SPACE (or SPACE),...
- 4Regular and Unusual Space Characters - Unicode Explorer
It is represented by the Unicode code point U+2800, and in Braille ASCII with a space. In all Bra...
- 5空格- 维基百科,自由的百科全书
Unicode定義编辑 ; U+2005 · em之四分之一寬 ; U+2006, Em六分之一空格(Six-Per-Em Space) ...