<style>
body {
  font-family: Ahem;
  font-size: 20px;
}

.test {
  width: 2ch;
  white-space: pre-wrap;
  direction: rtl;
  color: red;
}

.ref {
  position: relative;
  top: -40px;
  color: green;
  white-space: pre;
}
</style>
<div class=test>XX X</div>
<div class=ref>XX
 X</div>
