Here is a start. I'm sure others will come up with better solutions, but I think from here it's mostly down to finding a better algorithm to pick the random lines.
First, we get ourselves a Region
representation of the text we want to stylise (thanks to yode for simplifying this part):
textRegion = DiscretizeGraphics[
Text[Style["MUSEUM", FontFamily -> "Arial"]],
_Text,
MaxCellMeasure -> 0.1
]
This is pretty much all you need. Now it's just a question of how to use that region to pick lines. I tried playing with RegionIntersection
and random lines but that didn't seem to work, so here is another idea: we start by splitting the text into its individual letters:
letters = ConnectedMeshComponents@textRegion
Then we simply pick a number of random pairs of points within each letter, and connect them with a line, which we extend a bit on both ends:
Graphics[
{
[email protected],
Line /@ ({2 #2 - #, 2 # - #2} &) @@@ RandomPoint[#, {400, 2}] & /@ letters
},
ImageSize -> 800
]
Voilà:
Doesn't look quite as neat and organised as your example, I admit. That's where choosing a better way to generate the lines comes in, maybe prioritising those with angle close to ±90 degrees or something.
We can also add colour quite easily, either using completely random colours, or a palette of our choice:
palette = ColorData[97, "ColorList"];
Graphics[
{
[email protected],
{RandomChoice@palette, Line@#} &
/@ ({2 #2 - #, 2 # - #2} &) @@@ RandomPoint[#, {400, 2}] & /@ letters
},
ImageSize -> 800
]
Following an idea from Akiiino we can make the letters more pronounced by only selecting points from the boundaries of the letters and not extending all of them:
letters = ConnectedMeshComponents@RegionBoundary@textRegion
Graphics[
{
[email protected],
Line /@
(RandomChoice[{{2 #2 - #, 2 # - #2}, {#, #2}}] &) @@@
RandomPoint[#, {400, 2}] & /@ letters
},
ImageSize -> 800
]
Unfortunately, the letters become a bit too pronounced. This idea could probably be developed further to yield somewhat smoother results though.