1
\$\begingroup\$

I'm making a Unity app, and would like to apply a zebra-like stripe to various letters:

enter image description here

enter image description here

enter image description here

My first thought was to create a Material Preset with zebra stripes, and apply it to my font using Text Mesh Pro. But all of the zebra stripes are all placed by hand on each letter - as otherwise, it doesn't look that great.

Here's another example, this time of a tiger stripe:

enter image description here

enter image description here

Right now, I'm thinking that the only real option is to create a separate Zebra version of this font with all of the stripes carefully applied by hand. Same with the Tiger-striped letters as well.

However, font's don't have native support for colors... and Unity doesn't yet support OpenType-SVG fonts.

Is it possible to create a range of material presets for say the Zebra font and then apply different materials to different letters via Text Mesh Pro?

Or maybe I could come up with a rule set for the stripes, and apply the stripes to various letters using a shader. Is that possible?

If anyone has other ideas on how to pull off these striped letters inside of Unity and Text Mesh Pro, would love to hear them!

\$\endgroup\$
3
  • \$\begingroup\$ I realized that a Zebra font (and Tiger font) wouldn't work because Unity doesn't support full color fonts... would it be possible to create a range of material presets for say the Zebra font and then apply different materials to different letters via Text Mesh Pro? \$\endgroup\$
    – kanamekun
    Commented Feb 17, 2023 at 11:27
  • 1
    \$\begingroup\$ "Unity doesn't support full color fonts" — yes it does, just not as the signed distance fields used by TextMeshPro (naturally), so you can only do it with the older Text/TextMesh components. You might even be able to hybridize these approaches: get TMPro to use a fixed font atlas, then make a copy of that texture to author the individual letters' stripes so they line up at the same UVs, then make a custom version of the TMPro shader that samples the stripe texture. Wouldn't work for huge character sets like Asian localization, but for ASCII… \$\endgroup\$
    – DMGregory
    Commented Feb 17, 2023 at 12:48
  • \$\begingroup\$ That is amazing insight! I will get to work on trying that... thank you!! \$\endgroup\$
    – kanamekun
    Commented Feb 18, 2023 at 1:55

0

You must log in to answer this question.

Browse other questions tagged .