[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
movement in markups like TeX's `em` and `ex` units
From: |
Werner LEMBERG |
Subject: |
movement in markups like TeX's `em` and `ex` units |
Date: |
Fri, 07 Apr 2023 07:42:55 +0000 (UTC) |
Consider the following snippet:
```
Emaj = \markup { E \raise #1 maj }
\markup \Emaj
\markup \fontsize #10 \Emaj
```
As can be seen, `\raise #1` is not the right value in the second case.
What I would like to have instead is an equivalent to TeX's relative
units `em` and `ex`, being multiples of the width of glyph 'm' and the
height of glyph 'x', respectively (HTML/CSS has that too, BTW).
How can I do that in LilyPond? I could imagine code like
```
Emaj = \markup { E \raise #(* 1 ex) maj }
```
In other words, font-related command like `\fontsize` could set up
markup-wide entities `ex` and `em` that can be used for offsets
depending the current (scaled) font dimensions.
Or maybe
```
Emaj = \markup { E \raise #(ex 1) maj }
```
where function `ex` examines the current font and gets the 'ex' value?
Ditto for a function `em`.
Werner
- movement in markups like TeX's `em` and `ex` units,
Werner LEMBERG <=