-namespace {
-
-int logoWidth(FontInfo const & font, InsetSpecialChar::Kind kind) {
- frontend::FontMetrics const & fm = theFontMetrics(font);
- double const em = fm.width('M');
- int width = 0;
- // See drawlogo() below to understand what this does.
- switch (kind) {
- case InsetSpecialChar::PHRASE_LYX:
- width = fm.width(from_ascii("L")) - 0.16667 * em
- + fm.width(from_ascii("Y")) - 0.125 * em
- + fm.width(from_ascii("X"));
- break;
-
- case InsetSpecialChar::PHRASE_TEX:
- width = fm.width(from_ascii("T")) - 0.16667 * em
- + fm.width(from_ascii("E")) - 0.125 * em
- + fm.width(from_ascii("X"));
- break;
-
- case InsetSpecialChar::PHRASE_LATEX2E:
- width = logoWidth(font, InsetSpecialChar::PHRASE_LATEX)
- + 0.15 * em
- + fm.width(from_ascii("2") + char_type(0x03b5));
- break;
- case InsetSpecialChar::PHRASE_LATEX: {
- FontInfo smaller = font;
- smaller.decSize().decSize();
- width = fm.width(from_ascii("L")) - 0.36 * em
- + theFontMetrics(smaller).width(from_ascii("A")) - 0.15 * em
- + logoWidth(font, InsetSpecialChar::PHRASE_TEX);
- break;
- }
- default:
- LYXERR0("No information for computing width of logo " << kind);
- }
-
- return width;
-}
-
-}
-
-
-void InsetSpecialChar::metrics(MetricsInfo & mi, Dimension & dim) const