Logo Search packages:      
Sourcecode: yudit version File versions

void SFontTTF::getName ( long  id,
const char *  str,
int  len 
) [protected]

put the string from str into names.

Parameters:
id is SS_TN_ something.
str is the input string
len is the size of the stirng

Definition at line 521 of file SFontTTF.cpp.

References SString::append(), and SHashtable< BType >::put().

Referenced by processName().

{
  SString s;
  for (int i=0; i<len; i++)
  {
    if (str[i] == 0) continue;
    if (id==SS_TN_FONTNAME)
    {
      if (isalnum(str[i]))
      {
        s.append (str[i]);
      }
      else
      {
        s.append ((char)'_');
      }
    }
    /* This is to make postscript files clean */
    else switch (str[i])
    {
    case '(':
      s.append ((char)'[');
      break;
    case ')':
      s.append ((char)']');
      break;
    default:
      s.append (str[i]);
    }
  }
  names.put (id, s);
}


Generated by  Doxygen 1.6.0   Back to index