CSS glyph-orientation-vertical Property

The obsolete glyph-orientation-vertical property was designed to control the orientation of individual glyphs in vertically arranged SVG text.

Introduced in SVG 1.1, the property accepted the auto keyword or an angle value to determine how glyphs were displayed in vertical writing. It was removed from SVG 2 and is not recommended for modern projects. Current CSS uses writing-mode and text-orientation to control vertical text layout and glyph orientation.

glyph-orientation-vertical Syntax

The historical syntax accepted the auto keyword or an angle value. The property was intended for SVG text content using a vertical writing direction.

Basic Syntax

selector {
  glyph-orientation-vertical: auto;
}

Upright Glyph Orientation

selector {
  glyph-orientation-vertical: 0deg;
}

Rotate Glyphs 90 Degrees

selector {
  glyph-orientation-vertical: 90deg;
}

Rotate Glyphs 180 Degrees

selector {
  glyph-orientation-vertical: 180deg;
}

SVG Text Selector

svg text {
  glyph-orientation-vertical: auto;
}

Historical Inheritance

svg tspan {
  glyph-orientation-vertical: inherit;
}

These examples document the obsolete syntax. Modern browsers may ignore the property, so they should not be used to implement vertical text orientation.

Property Values

SVG 1.1 defined the following values for glyph-orientation-vertical.

Value Historical Meaning
auto Determines glyph orientation automatically according to the character and the SVG text orientation rules.
0deg Specifies an upright glyph orientation.
90deg Specifies a quarter-turn glyph rotation.
180deg Specifies a half-turn glyph rotation.
270deg Specifies a three-quarter-turn glyph rotation.
<angle> Specifies an angle that was normalized and restricted to the nearest multiple of 90 degrees under the SVG 1.1 rules.
inherit Uses the inherited value from the parent element.

Historical Property Characteristics

Characteristic SVG 1.1 Definition
Initial value auto
Inherited Yes
Applies to SVG text content elements
Value type auto or an angle
Percentage values Not supported
Current status Obsolete; removed from SVG 2

These characteristics describe the historical SVG 1.1 definition. They do not establish support in current browser engines.

How It Works

The property was intended to determine how glyphs appeared when SVG text followed a vertical writing direction.

Automatic Orientation

svg text {
  glyph-orientation-vertical: auto;
}

The browser was expected to choose an appropriate orientation for each glyph according to the historical SVG rules.

Explicit Orientation

svg text {
  glyph-orientation-vertical: 0deg;
}

An explicit angle requested a particular glyph orientation instead of automatic selection.

Vertical Text Progression

Glyphs were arranged along the vertical text progression direction. Their orientation could differ from the direction in which the text advanced.

Character Differences

Automatic orientation was intended to account for differences between character types, including scripts traditionally displayed upright in vertical writing and characters commonly displayed sideways.

Modern Rendering

Modern browsers generally use CSS Writing Modes rules rather than the obsolete glyph orientation properties.

Important Consideration

Glyph orientation and writing direction are separate concepts. Changing the direction in which text flows does not necessarily determine how every character is rotated.

Historical Behavior

The glyph-orientation-vertical property originated in SVG 1.1 as part of its text layout and orientation system.

SVG 1.1

SVG 1.1 provided separate properties for horizontal and vertical glyph orientation.

Automatic Orientation

The vertical property introduced auto to allow character-dependent orientation in vertical text.

Explicit Angles

Authors could specify angles to request a particular orientation for glyphs in vertically arranged text.

SVG 2

SVG 2 removed the legacy glyph orientation properties and aligned SVG text rendering more closely with CSS Writing Modes.

Modern CSS

The writing-mode property controls text flow, while text-orientation controls glyph orientation in vertical writing modes.

Legacy SVG Files

Older SVG files may still contain glyph-orientation-vertical declarations. These declarations may have no effect in current browsers.

Important Consideration

Preserve historical declarations only when documenting or maintaining legacy SVG content. Replace them when modern, predictable rendering is required.

The auto Value

The auto keyword was the initial value of glyph-orientation-vertical in SVG 1.1.

Basic Example

svg text {
  glyph-orientation-vertical: auto;
}

Automatic Glyph Selection

The historical behavior allowed glyph orientation to depend on the character being displayed rather than applying one explicit angle to every character.

Mixed Scripts

Automatic orientation was particularly relevant to vertical text containing characters from different writing systems.

Modern Equivalent

.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

The modern mixed value provides character-dependent orientation in vertical writing modes.

Important Consideration

The modern text-orientation: mixed behavior is not an exact implementation of the obsolete SVG 1.1 auto rules.

Angle Values

The historical property accepted angle values, but SVG 1.1 restricted the effective orientation to multiples of 90 degrees.

Zero Degrees

svg text {
  glyph-orientation-vertical: 0deg;
}

Ninety Degrees

svg text {
  glyph-orientation-vertical: 90deg;
}

One Hundred Eighty Degrees

svg text {
  glyph-orientation-vertical: 180deg;
}

Two Hundred Seventy Degrees

svg text {
  glyph-orientation-vertical: 270deg;
}

Other Angle Values

svg text {
  glyph-orientation-vertical: 45deg;
}

Under SVG 1.1, an angle such as 45 degrees was rounded to the nearest permitted multiple of 90 degrees rather than producing an arbitrary 45-degree glyph rotation.

Angle Equivalents

Degrees Turns Radians (Approx.)
0deg 0turn 0rad
90deg 0.25turn 1.5708rad
180deg 0.5turn 3.1416rad
270deg 0.75turn 4.7124rad

Important Consideration

These values describe historical behavior only. Use modern SVG rotation features when arbitrary character rotation is required.

SVG Vertical Text

SVG text elements can display text vertically using modern writing-mode features.

Basic SVG Text

<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
  <text x="150" y="20" font-size="24">
    SVG Text
  </text>
</svg>

Legacy Vertical Orientation

<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
  <text x="150" y="20" style="writing-mode: vertical-rl; glyph-orientation-vertical: auto;">
    SVG
  </text>
</svg>

This example illustrates historical usage. The obsolete orientation declaration may be ignored.

Modern Vertical SVG Text

<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
  <text x="150" y="20" font-size="24" style="writing-mode: vertical-rl; text-orientation: upright;">
    SVG
  </text>
</svg>

Positioning Vertical Text

The x and y attributes position SVG text. The writing mode determines how the text progresses from that position.

Important Consideration

Vertical text requires enough available height for the characters. Test positioning and overflow when placing vertical text inside a fixed SVG viewport.

Horizontal vs. Vertical Orientation

SVG 1.1 used two related properties to describe glyph orientation in different writing directions.

Horizontal Glyph Orientation

svg text {
  glyph-orientation-horizontal: 0deg;
}

The horizontal property was intended for glyphs in horizontally arranged SVG text.

Vertical Glyph Orientation

svg text {
  glyph-orientation-vertical: auto;
}

The vertical property was intended for glyphs in vertically arranged SVG text.

Historical Differences

Feature Horizontal Property Vertical Property
Initial value 0deg auto
auto keyword Not supported Supported
Angle values Supported Supported
Writing direction Horizontal Vertical
Current status Obsolete Obsolete

Modern Approach

.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

Important Consideration

Neither legacy property should be used for new SVG text layouts. Modern writing-mode properties provide a more consistent approach.

Modern Alternatives

The appropriate modern replacement depends on whether the goal is vertical text flow, glyph orientation, or explicit rotation.

Goal Recommended Feature
Arrange text vertically CSS writing-mode
Choose upright or sideways glyphs CSS text-orientation
Rotate individual SVG characters SVG rotate attribute
Rotate an entire element CSS transform
Combine short horizontal text in vertical writing CSS text-combine-upright

Modern Vertical Text

.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

Modern Upright Text

.upright-text {
  writing-mode: vertical-rl;
  text-orientation: upright;
}

Important Consideration

The modern alternatives do not reproduce every historical detail of SVG 1.1 glyph orientation. Choose the feature that matches the intended visual result.

CSS writing-mode Property

The writing-mode property controls the direction in which lines of text are arranged.

Horizontal Writing

.horizontal-text {
  writing-mode: horizontal-tb;
}

Vertical Right-to-Left Writing

.vertical-text {
  writing-mode: vertical-rl;
}

Vertical Left-to-Right Writing

.vertical-text {
  writing-mode: vertical-lr;
}

SVG Example

<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
  <text x="150" y="20" font-size="24" writing-mode="vertical-rl">
    Vertical
  </text>
</svg>

Important Consideration

The writing-mode property controls text progression and line arrangement. Use text-orientation when glyph orientation within vertical text also needs to be specified.

CSS text-orientation Property

The text-orientation property controls whether characters appear upright or sideways in vertical writing modes.

Mixed Orientation

.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

The mixed value uses character-dependent orientation behavior.

Upright Orientation

.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: upright;
}

The upright value displays characters upright in vertical text.

Sideways Orientation

.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: sideways;
}

The sideways value displays text sideways within the vertical writing direction.

HTML Example

<p class="vertical-text">Vertical Text</p>

Important Consideration

The text-orientation property works with vertical writing modes. It does not provide arbitrary rotation angles for individual characters.

SVG rotate Attribute

The SVG rotate attribute allows individual characters in an SVG text element to receive different rotation angles.

Basic Example

<svg viewBox="0 0 300 120" xmlns="http://www.w3.org/2000/svg">
  <text x="20" y="70" font-size="32" rotate="0 15 -15 0">
    TEXT
  </text>
</svg>

Single Character Rotation

<svg viewBox="0 0 300 120" xmlns="http://www.w3.org/2000/svg">
  <text x="20" y="70" font-size="32">
    A<tspan rotate="30">B</tspan>CD
  </text>
</svg>

Vertical Text with Rotation

<svg viewBox="0 0 200 220" xmlns="http://www.w3.org/2000/svg">
  <text x="100" y="25" font-size="28" writing-mode="vertical-rl" rotate="0 15 -15 0">
    TEXT
  </text>
</svg>

Important Consideration

The SVG rotate attribute is useful for explicit character rotation. It is not the same as automatic script-dependent orientation provided by CSS text-orientation.

CSS transform Property

The CSS transform property can rotate an entire HTML or SVG element.

Rotate an HTML Element

.rotated-label {
  display: inline-block;
  transform: rotate(90deg);
}

Rotate SVG Text

svg .rotated-text {
  transform: rotate(90deg);
  transform-box: fill-box;
  transform-origin: center;
}

SVG Markup

<svg viewBox="0 0 220 180" xmlns="http://www.w3.org/2000/svg">
  <text class="rotated-text" x="40" y="90" font-size="28">
    Rotated
  </text>
</svg>

Transform Origin

The transform-origin property controls the rotation point. For SVG elements, transform-box can establish the reference box used for that point.

Important Consideration

Rotating an entire element does not produce the same result as arranging characters vertically. Use writing-mode for vertical text layout.

Inheritance

Under SVG 1.1, glyph-orientation-vertical was an inherited property.

Historical Parent Declaration

svg text {
  glyph-orientation-vertical: auto;
}

Historical Child Override

svg text {
  glyph-orientation-vertical: auto;
}
svg tspan {
  glyph-orientation-vertical: 0deg;
}

SVG Text Structure

<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
  <text x="150" y="20">
    Parent <tspan>Child</tspan>
  </text>
</svg>

In the historical model, a child text element inherited the parent's orientation value unless another value was specified.

Modern Inheritance

.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

Both writing-mode and text-orientation are inherited CSS properties, allowing vertical text settings to apply to descendants.

Important Consideration

Modern inheritance behavior should be based on current CSS properties rather than obsolete SVG orientation declarations.

glyph-orientation-vertical Example

Because glyph-orientation-vertical is obsolete, this example demonstrates modern vertical text using writing-mode and text-orientation.

HTML Example

<div class="vertical-orientation-demo">
  <div class="vertical-sample">
    <span class="sample-label">mixed</span>
    <div class="vertical-text mixed-text">ABC 123</div>
  </div>
  <div class="vertical-sample">
    <span class="sample-label">upright</span>
    <div class="vertical-text upright-text">ABC 123</div>
  </div>
  <div class="vertical-sample">
    <span class="sample-label">sideways</span>
    <div class="vertical-text sideways-text">ABC 123</div>
  </div>
</div>

CSS Example

.vertical-orientation-demo {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.vertical-orientation-demo .vertical-sample {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #cccccc;
  background-color: #f5f7fa;
}
.vertical-orientation-demo .sample-label {
  font-size: 14px;
  font-weight: bold;
}
.vertical-orientation-demo .vertical-text {
  writing-mode: vertical-rl;
  font-family: Arial, sans-serif;
  font-size: 22px;
  color: #2456a6;
  min-height: 150px;
}
.vertical-orientation-demo .mixed-text {
  text-orientation: mixed;
}
.vertical-orientation-demo .upright-text {
  text-orientation: upright;
}
.vertical-orientation-demo .sideways-text {
  text-orientation: sideways;
}
Browser Result
mixed
ABC 123
upright
ABC 123
sideways
ABC 123

The example compares three modern glyph orientation behaviors in vertical text. The mixed value uses character-dependent orientation, upright displays characters upright, and sideways displays text sideways.

These properties provide a supported approach to vertical text orientation without relying on the obsolete glyph-orientation-vertical property.

Common Mistakes

Common problems arise when obsolete SVG glyph orientation rules are confused with modern CSS writing-mode behavior.

Expecting Modern Browser Support

svg text {
  glyph-orientation-vertical: auto;
}

Modern browsers may ignore this obsolete declaration.

Using the Property on Ordinary HTML Text

p {
  glyph-orientation-vertical: 90deg;
}

The property was defined for SVG text content, not ordinary HTML paragraphs.

Using Percentage Values

svg text {
  glyph-orientation-vertical: 50%;
}

Percentages were not valid values for the historical property.

Assuming Arbitrary Angles Were Preserved

svg text {
  glyph-orientation-vertical: 45deg;
}

SVG 1.1 restricted the effective orientation to multiples of 90 degrees.

Confusing auto with upright

The historical auto value allowed character-dependent orientation. It did not simply force every character upright.

Using text-orientation Without Vertical Writing

.example {
  text-orientation: upright;
}

The text-orientation property is intended for vertical writing modes. Specify an appropriate writing-mode value.

Confusing Rotation with Writing Direction

Rotating an entire text element is different from arranging individual characters along a vertical writing direction.

Assuming Historical Properties Remain Standardized

SVG 2 removed the older glyph orientation properties. Use current specifications when developing new SVG content.

Ignoring Available Space

Vertical text can extend beyond a container or SVG viewport if sufficient height is not available.

Using Legacy Syntax in New Projects

Prefer modern CSS Writing Modes and SVG text positioning features for predictable rendering.

Important Considerations

Keep the following points in mind when reviewing the obsolete glyph-orientation-vertical property:

  • Status: Obsolete and removed from SVG 2.
  • Original purpose: Controlled glyph orientation in vertical SVG text.
  • Historical specification: SVG 1.1.
  • Initial value: auto.
  • Inheritance: Historically inherited.
  • Value types: auto or an angle.
  • auto: Allowed character-dependent orientation.
  • Angle values: Historically restricted to effective rotations in multiples of 90 degrees.
  • Percentages: Not supported.
  • Horizontal counterpart: glyph-orientation-horizontal.
  • HTML text: The property was not intended for ordinary HTML elements.
  • Browser support: Limited and unreliable in modern browsers.
  • SVG 2: Does not retain this property.
  • Vertical writing: Use writing-mode.
  • Glyph orientation: Use text-orientation.
  • Individual character rotation: Use the SVG rotate attribute.
  • Whole-element rotation: Use CSS or SVG transforms.
  • Mixed scripts: Modern text-orientation: mixed supports character-dependent orientation.
  • Legacy SVG: Older documents may contain obsolete declarations.
  • New projects: Avoid using glyph-orientation-vertical.
  • Accessibility: Ensure vertical text remains readable and correctly ordered in the document.
  • Testing: Verify vertical text rendering, positioning, and overflow in modern browsers.

The glyph-orientation-vertical property is primarily relevant when maintaining or interpreting older SVG documents. For new projects, use modern CSS Writing Modes and SVG text positioning features.

Browser Support

The obsolete glyph-orientation-vertical property has Limited availability and is not reliably supported across modern browsers.

The property was defined in SVG 1.1 but removed from SVG 2. Modern browsers may ignore declarations using this property.

Legacy Declaration

svg text {
  glyph-orientation-vertical: auto;
}

Do not rely on this declaration for consistent vertical text rendering.

Recommended Alternative

.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

The modern properties are supported in current browsers and provide a standardized approach to vertical text layout and orientation.

Browser Compatibility

For current compatibility information, visit Can I Use? and search for glyph-orientation-vertical. Because the property is obsolete, a dedicated compatibility entry may not be available.

Specifications

The glyph-orientation-vertical property was defined in SVG 1.1 as part of its text orientation system.

SVG 1.1: glyph-orientation-vertical

SVG 2 removed the legacy glyph orientation properties and uses modern CSS Writing Modes behavior for text orientation.

SVG 2: Text

For modern vertical text orientation, consult the CSS Writing Modes specification.

CSS Writing Modes Level 3