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"
22 string makeFontName(string const & family, string const & foundry)
27 return family + " [" + foundry + ']';
29 return foundry + '-' + family;
34 pair<string,string> parseFontName(string const & name)
37 string::size_type const idx = name.find('[');
38 if (idx == string::npos || idx == 0)
39 return make_pair(name, string());
40 return make_pair(name.substr(0, idx - 1),
41 name.substr(idx + 1, name.size() - idx - 2));
43 string::size_type const idx = name.find('-');
44 if (idx == string::npos || idx == 0)
45 return make_pair(name, string());
46 return make_pair(name.substr(idx + 1),