docs: def _getFragWords(frags):
      """
      given a Parafrag list return a list of fragwords
          [[size, (f00,w00), ..., (f0n,w0n)],....,[size, (fm0,wm0), ..., (f0n,wmn)]]
          each pair f,w represents a style and some string
          each sublist represents a word
      """
      R = []
      W = []
      n = 0
      hangingStrip = False
      for f in frags:
          text = f.text
          if type(text) is bytes:
              text = text.decode('utf8')
          # of paragraphs
          if text != '':
              if hangingStrip:
                  hangingStrip = False
                  text = text.lstrip()
  
              S = split(text)
              if S == []:
                  S = ['']
              if W != [] and text[0] in whitespace:
                  W.insert(0, n)
                  R.append(W)
                  W = []
                  n = 0
  
              for w in S[:-1]:
                  W.append((f, w))
                  n += stringWidth(w, f.fontName, f.fontSize)
                  W.insert(0, n)
                  R.append(W)
                  W = []
                  n = 0
  
              w = S[-1]
              W.append((f, w))
              n += stringWidth(w, f.fontName, f.fontSize)
              if text and text[-1] in whitespace:
                  W.insert(0, n)
                  R.append(W)
                  W = []
                  n = 0
          elif hasattr(f, 'cbDefn'):
              w = getattr(f.cbDefn, 'width', 0)
              if w:
                  if W != []:
                      W.insert(0, n)
                      R.append(W)
                      W = []
                      n = 0
                  R.append([w, (f, '')])
              else:
                  W.append((f, ''))
          elif hasattr(f, 'lineBreak'):
              #pass the frag through.  The line breaker will scan for it.
              if W != []:
                  W.insert(0, n)
                  R.append(W)
                  W = []
                  n = 0
              R.append([0, (f, '')])
              hangingStrip = True
  
      if W != []:
          W.insert(0, n)
          R.append(W)
  
      return R