🥑 Developer Advocate 🥑
Typography is the art and technique of arranging type to make written language legible, readable, and appealing when displayed.
—Wikipedia
Typography is the visual component of the written word.
—Matthew Butterick
Typography, the design, or selection, of letter forms to be organized into words and sentences to be disposed in blocks of type as printing upon a page.
—Encyclopedia Britannica
✨ Typography is writing with prefabricated letters. ✨
—Gerrit Noordzij
A, a | Ă, ă | Â, â | B, b | C, c | D, d |
E, e | F, f | G, g | H, h | I, i | Î, î |
J, j | K, k | L, l | M, m | N, n | O, o |
P, p | Q, q | R, r | S, s | Ș, ș | T, t |
Ț, ț | U, u | V, v | W, w | X, x | Y, y |
Z, z | Romanian (31) |
ا | ب | ج | د | ه | و |
ز | ح | ط | ي | ك | ل |
م | ن | س | ع | ف | ص |
ق | ر | ش | ت | ث | خ |
ذ | ض | ظ | غ | Arabic (28) |
א | ב | ג | ד | ה | ו |
ז | ח | ט | י | ך כ | ל |
ם מ | ן נ | ס | ע | ף פ | ץ צ |
ק | ר | ש | ת | Hebrew (22) |
A a | B b | C c | D d | E e | F f |
G g | H h | I i | J j | K k | L l |
M m | N n | O o | P p | Q q | R r |
S s | T t | U u | V v | W w | X x |
Y y | Z z | English (26) |
Sources: W3Techs
When you lose your language, you lose your soul.
—Ghil’ad Zuckermann
Authors should language-tag their content accurately for the best typographic behaviour.
—CSS Text Module Level 3
WOFF2 (Web Open Font Format 2) | |
WOFF (Web Open Font Format) | |
OTF (OpenType) | |
TTF (TrueType) | |
EOT (Embedded Open Type) | |
SVG (Scalable Vector Graphics) |
Dependent on OS, HTML language, character set and browser.
serif | Times New Roman, SimSun, SongTi SC |
sans-serif | Arial, Microsoft Yahei, PingFang SC |
monospace | Consolas, SimSun, PingFang SC |
cursive | Comic Sans MS, Apple Chancery, SimSun (oblique), SongTi SC (oblique) |
fantasy | Gabriola, Impact, Papyrus, Microsoft Yahei, PingFang SC |
Level 4 is adding system-ui
, emoji
, math
and fangsong
@font-face {
font-family: 'Bellato';
src: url('Bellota-Regular.woff2') format('woff2'),
url('Bellota-Regular.woff') format('woff');
}
@font-face
rule@font-face {
font-family: <family-name>;
src: [ <url> [format(<string> #)]? | <font-face-name> ] #;
font-style: normal | italic | oblique ;
font-weight: normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
font-stretch: normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded;
unicode-range: <urange> #;
font-variant: normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> || stylistic(<feature-value-name>) || historical-forms || styleset(<feature-value-name> #) || character-variant(<feature-value-name> #) || swash(<feature-value-name>) || ornaments(<feature-value-name>) || annotation(<feature-value-name>) || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <east-asian-variant-values> || <east-asian-width-values> || ruby ];
font-feature-settings: normal | <feature-tag-value> #;
}
@font-face {
font-family: 'Raleway';
src: url('fonts/raleway-regular.woff2') format('woff2'),
url('fonts/raleway-regular.woff') format('woff');
/* no range specified, defaults to entire range */
}
@font-face {
font-family: 'Raleway';
src: url('fonts/comfortaa_regular.woff2') format('woff2'),
url('fonts/comfortaa_regular.woff') format('woff');
unicode-range: U+0400–U+04FF; /* Unicode range for Cyrillic characters */
}
font-size |
Indicates the desired height of the glyphs. Takes absolute or relative values. |
font-weight |
Specifies the weight of the glyphs in the font. Can use keywords or numerical values. |
font-style |
Allows italic or oblique faces to be selected. |
font-stretch |
Selects a normal, condensed or expanded face from a font family. Range spans over 9 keywords. |
font-size-adjust |
Adjusts the font-size to preserve the x-height of the first choice font. |
font-synthesis |
Controls whether user agents are allowed to synthesize bold or oblique font faces when missing. |
Dragons
font-synthesis
font-kerning
|
font-variant-position
|
font-variant-position-ligatures
|
font-variant-numeric
|
font-variant-caps
|
font-variant-alternates
|
font-variant-east-asian
Allows control of glyph substitution and sizing in East Asian text
一个简体字可能对应多个繁体字,如简体字「发」,其相应的繁体字可能为「發」或「髮」;一个繁体汉字对应多个简体汉字的情况与前者相比数量极少但仍需注意,如繁体字「乾」可能对应简体字「干」或「乾」。繁简汉字的对应关系具体应由上下文决定。
唖 芦 溢 茨 鰯 嘘 欝 厩 噂
font-language-override
To control the use of language-specific glyph substitutions and positioning
<!-- Macedonian lang code -->
<body lang="mk">
<h4>Члeн 9</h4>
<p>Никoj чoвeк нeмa дa бидe пoдлoжeн нa прoизвoлнo aпсeњe, притвoр или прoгoнувaњe.</p>
</body>
body {
/* Serbian OpenType language tag */
font-language-override: "SRB";
}
Example lifted from CSS Fonts Module Level 4
text-transform
propertyIf I want [flowers], I’m going to send them to myself.
Süße Soßen-Klöße genießen maßgeblich gefräßige preußische Nutznießer.
Ουδέν κακόν αμιγές καλού.
ァィゥェ ォヵㇰヶ
If an element generates zero boxes, was it really there at all?
If an element generates zero boxes, was it really there at all?
line-break |
allows choosing various levels of “strictness” for line breaking restrictions |
word-break |
controls what types of letters are glommed together to form unbreakable “words”, causing CJK characters to behave like non-CJK text or vice versa |
hyphens |
controls whether automatic hyphenation is allowed to break words in scripts that hyphenate |
overflow-wrap |
allows the UA to take a break anywhere in otherwise-unbreakable strings that would otherwise overflow |
Line breaking by Florian Rivoal @ dotCSS
If you don't give a lang attribute, you don't get automatic hyphenation.
—Florian Rivoal
Browsers use language-specific dictionaries to figure out where the hyphenation points should be.
text-align
& text-justify
text-align-all
and text-align-last
propertiestext-align: start | end | left | right | center | justify | match-parent | justify-all
Values other than justify-all
or match-parent
are assigned to text-align-all
and reset text-align-last
to auto
.
Selects the justification method used when a line’s alignment is set to justify
text-justify: auto | none | inter-word | inter-character
定义了CSS如何支持各种不同国际化语言的书写模式,例如拉丁(Latin)语系及印度(Indic)语系采用从左到右的书写模式,希尔伯特语(Hebrew)或阿拉伯语(Arabic)采用从右到左的书写模式,一些混合了拉丁语和阿拉伯语的文字可能采用双向书写(bidirectional),而一些东亚文字则需要竖排(从上到下)的书写模式。
CSS Writing Modes Level 3 defines CSS features to support for various international writing modes, such as left-to-right (e.g. Latin or Indic), right-to-left (e.g. Hebrew or Arabic), bidirectional (e.g. mixed Latin and Arabic) and vertical (e.g. Asian scripts).
writing-mode
propertyhorizontal-tb | 从1987到现在 |
vertical-rl | 从1987到现在 |
vertical-lr | 从1987到现在 |
sideways-rl* | 从1987到现在 |
sideways-lr* | 从1987到现在 |
text-orientation
propertytext-combine-upright
property“Nu pot fi fericiţi decât oamenii care nu gândesc nimic, adică aceia care gândesc numai cât trebuie vieţii.”
Din umbra falnicelor bolți
Ea pasul și-l îndreaptă
Lângă fereastră, unde-n colț
Luceafărul așteaptă.
Privea în zare cum pe mări
Răsare și străluce,
Pe mișcătoarele cărări
Corăbii negre duce.
Font used is Bellato, by Kemie Guaida