The Art of Word Shaping The Art of Word Shaping
Given a binary matrix, and a string of letters, replace all 1's in the matrix from left, to right with the letters of the string. Once the letters have been formed into the shape of the matrix, print the matrix, replacing 0's with spaces. It's probably easier to just give an example or two.

Case: Base case...
Input One:
[0,0,1,0,0]
[0,1,0,1,0]
[1,0,0,0,1]
[0,1,0,1,0]
[0,0,1,0,0]

&quot;PPCGPPCG&quot;

Output One:
  P    
 P C  
G   P
 P C 
  G  


Case: If the input string is longer than the number of ones...
Input Two:
[1,0,0]
[0,1,0]
[1,0,1]

lambda

Output Two:
l  
 a 
m b


Case: If the input string is shorter than the number of ones...
Input Three:
[1,1,1]
[1,0,1]
[1,1,1]

PPCG

Output Three:
PPC
G P
PCG


Available Assumptions

You may assume the input string is never empty.
You may assume the matrix will never be empty.
You may not assume that the binary matrix will never be all zeros.

Rules

If the string is shorter than the number of ones, repeat the string; all ones must be replaced.
If the string is longer than the number of ones, only use what is needed.
You may use True/False in place of integers/bits for the input.
Trailing spaces ARE REQUIRED, all zeros must be replaced with spaces.
A single trailing newline is acceptable.
This is code-golf, lowest byte count wins.
Vim, 44 42 bytes

qqy$P0xjf1"_xP{@qq@q:s/0/ /g^M:s/,/^V^M/g^M{D


Saved 2 bytes thanks to @DjMcMoylex!

Here, the ^M is a literal newline, and the ^V is CTRL-V

Takes the input in this format:

PPCG
00100,01010,10001,01010,00100


Disclaimer: If the string is longer than ~40 chars long, your computer might run out of ram.

Explanation:

qq             @qq@q                            # Start recording a recursive macro.
  y$P0x                                         # Duplicate the string and cut out the first character
       jf1"_xP{                                 # Find the first 1, and replace it with the cut character from the string.
                                                # Now we have replaced all the 1's with their respective character, but we still have the array in the original format, and we have the string massivly duplicated at the first line, so we need to clean it up:
                    :s/0/ /g^M                  # Replace all 0's with a space
                              :s/,/^V^M/g^M     # Replace all ,'s with a newline. The ^V acts like a backslash, it escapes the newline so that the command isn't run too soon
                                           {D   # Delete the first line


Here's a gif of me "running" the "program":