3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS
14 #pragma implementation
17 #include "qt_helpers.h"
24 string makeFontName(string const & family, string const & foundry)
29 return family + " [" + foundry + ']';
31 return foundry + '-' + family;
36 pair<string,string> parseFontName(string const & name)
39 string::size_type const idx = name.find('[');
40 if (idx == string::npos || idx == 0)
41 return make_pair(name, string());
42 return make_pair(name.substr(0, idx - 1),
43 name.substr(idx + 1, name.size() - idx - 2));
45 string::size_type const idx = name.find('-');
46 if (idx == string::npos || idx == 0)
47 return make_pair(name, string());
48 return make_pair(name.substr(idx + 1),