1

I found today at the web site of the Wolfram Programming Lab the following Code which can create a Pi symbol filled with the digits of Pi:

With[
 {
  pos = PixelValuePositions[
    Rasterize@
     Text@Style[Pi, 
       90, {FontWeight -> "Bold", FontSize -> 70, 
        FontFamily -> "Source Serif Pro"}], 0]
  },
 Graphics[
  MapThread[Text, {Characters@ToString@N[Pi, Length[pos] - 1], pos}], 
  ImageSize -> 400]
 ]

enter image description here

Question:

How can I create a word consisting of the sequence of letters which produce the word?

mrz
  • 11,686
  • 2
  • 25
  • 81

1 Answers1

1

With the code provided, that's easy! Of course I have to repeat the letters... Here I apply it right away to my favorite word along with my favorite font:

word = "Döp";
pos = PixelValuePositions[Rasterize@Style[word, 
  {FontSize -> 50, FontFamily -> "Comic Sans MS"
  }], 0];    
chars = Characters@word;
charlist = chars[[Mod[Range[Length[pos]], Length[chars], 1]]];
g = Graphics[
  MapThread[
   Style[Text[#1, #2], FontWeight -> Bold, FontSize -> 6, 
     FontFamily -> "Courier"] &, {charlist, pos}], ImageSize -> Full]

enter image description here

Edit

Fixed typo in the "word"...

Henrik Schumacher
  • 106,770
  • 7
  • 179
  • 309