One way to do it would be to use glyphs. We can extract the curves that make up the two characters as follows:
a = First@First@Last@First@First@
ImportString[ExportString[
Style[FromCharacterCode[61440], 24, FontFamily -> "Baskerville Old Face"],
"PDF"], "PDF", "TextMode" -> "Outlines"];
b = First@First@Last@First@First@
ImportString[ExportString[
Style["i", 24, Bold, FontFamily -> "Courier New"],
"PDF"], "PDF", "TextMode" -> "Outlines"];
These each give a FilledCurve
, which I presume defines a spline. The documentation doesn't seem to explain the format given here. But it appears to be a bunch of control information (degree? knots?), then a bunch of points. But we shall not let ignorance stop us.
The main challenge now is morphing one curve into another. Since the apple logo has more points than the 'i', we shall simply force a bunch of repeated points in the 'i' curve to aid in the transition. First grab the data:
control = First@a;
pa = Last@a;
pb = Last@b;
magic = {{2, 8, 3, 8, 2}, {2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1,
2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2}};
Then repeat some points in the 'i':
newb = Map[Sequence @@ ConstantArray[First@#, Last@#] &, Thread /@ Thread[{pb, magic}], {2}];
Now we can just do a simple linear transition between the two:
Table[Graphics@FilledCurve[control, pa + t (newb - pa)], {t, 0, 1, 0.1}]
Using a sinusoidal t
, and some well chosen Export
options (exercise left to the reader), we get: