Could Unicode deliver the level of paleographic detail needed for encoding ancient Egyptian hieroglyphs?
James Kass
jameskass at code2001.com
Wed Mar 6 10:31:58 CST 2024
Here’s an idea. It’s called mark-up, but most people currently spell it
as “markup”.
<rotation=90>○</rotation>
<rotation=47>○</rotation>
As proof of concept, this is already working here! But, alas, only for
a limited subset of Unicode characters. I tend to think of my
suggestion in this thread of being like putting the cart before the
horse. But if I had not put my suggestion forward, nobody would have
considered fine glyph rotation to be impossible, because any list member
here could have conjured up something just as elegant in less than a minute.
Seriously, but also in the department of “nobody asked”, here’s how to
rotate glyphs by any angle:
x1 = x0cos(θ) - y0sin(θ) (Equation 1 calculating the new x co-ordinate)
y1 = x0sin(θ) + y0cos(θ) (Equation 2 calculating the new y co-ordinate)
where
θ (theta) ⇒ degrees of desired rotation
x0,y0 ⇒ the original x and y co-ordinates
x1,y1 ⇒ the target x and y co-ordinates (after rotation)
cos(θ),sin(θ) ⇒ the cosine and sine of theta
Equation 1 in plain English:
x1 (the new x coordinate) equals
the old x coordinate times the cosine of the desired rotation angle
minus
the old y coordinate times the sine of the desired rotation angle.
Of course, the glyph has now likely shifted out of its “boundary box”
and will need to be repositioned appropriately. The lowest values of
any glyph’s x and y co-ordinates are stored in the font’s glyph data.
The lowest values of x and y in the rotated glyph would need to be
determined programatically. Then get the deltas between the original
and rotated x and y minimums. Apply the x delta to all x co-ordinates
and the y delta to all y co-ordinates in the rotated glyph, and presto!
The above is for “simple” glyphs only. For “composite” glyphs (or to
accomodate anything done by OpenType features such as glyph
positioning), the font engine would establish an appropriate series of
Cartesian points and then perform the equations on that new data.
More information about the Unicode
mailing list