1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2000 The LyX Team.
9 * ====================================================== */
15 #pragma implementation "lyxfont.h"
25 #include "FontLoader.h"
26 #include "support/lstrings.h"
29 // The global fontloader
30 FontLoader fontloader;
36 string const GUIFamilyNames[6] =
37 { N_("Roman"), N_("Sans serif"), N_("Typewriter"), N_("Symbol"), N_("Inherit"),
40 string const GUISeriesNames[4] =
41 { N_("Medium"), N_("Bold"), N_("Inherit"), N_("Ignore") };
43 string const GUIShapeNames[6] =
44 { N_("Upright"), N_("Italic"), N_("Slanted"), N_("Smallcaps"), N_("Inherit"),
47 string const GUISizeNames[14] =
48 { N_("Tiny"), N_("Smallest"), N_("Smaller"), N_("Small"), N_("Normal"), N_("Large"),
49 N_("Larger"), N_("Largest"), N_("Huge"), N_("Huger"), N_("Increase"), N_("Decrease"),
50 N_("Inherit"), N_("Ignore") };
52 string const lGUISizeNames[15] =
53 { N_("tiny"), N_("smallest"), N_("smaller"), N_("small"), N_("normal"), N_("large"),
54 N_("larger"), N_("largest"), N_("huge"), N_("huger"), N_("increase"), N_("decrease"),
55 N_("inherit"), N_("ignore"), string() };
57 string const GUIMiscNames[5] =
58 { N_("Off"), N_("On"), N_("Toggle"), N_("Inherit"), N_("Ignore") };
62 // Strings used to read and write .lyx format files
64 string const LyXFamilyNames[6] =
65 { "roman", "sans", "typewriter", "symbol", "default", "error" };
67 string const LyXSeriesNames[4] =
68 { "medium", "bold", "default", "error" };
70 string const LyXShapeNames[6] =
71 { "up", "italic", "slanted", "smallcaps", "default", "error" };
73 string const LyXSizeNames[14] =
74 { "tiny", "scriptsize", "footnotesize", "small", "normal", "large",
75 "larger", "largest", "huge", "giant",
76 "increase-error", "decrease-error", "default", "error" };
78 string const LyXMiscNames[12] =
79 { "off", "on", "toggle", "default", "error" };
82 // Strings used to write LaTeX files
85 string const LaTeXFamilyNames[6] =
86 { "textrm", "textsf", "texttt", "error1", "error2", "error3" };
88 string const LaTeXSeriesNames[4] =
89 { "textmd", "textbf", "error4", "error5" };
91 string const LaTeXShapeNames[6] =
92 { "textup", "textit", "textsl", "textsc", "error6", "error7" };
94 string const LaTeXSizeNames[14] =
95 { "tiny", "scriptsize", "footnotesize", "small", "normalsize", "large",
96 "Large", "LARGE", "huge", "Huge", "error8", "error9", "error10", "error11" };
99 LyXFont::FontBits LyXFont::sane = {
110 LyXFont::FontBits LyXFont::inherit = {
121 LyXFont::FontBits LyXFont::ignore = {
133 /// Decreases font size by one
134 LyXFont & LyXFont::decSize()
137 case SIZE_HUGER: setSize(SIZE_HUGE); break;
138 case SIZE_HUGE: setSize(SIZE_LARGEST); break;
139 case SIZE_LARGEST: setSize(SIZE_LARGER); break;
140 case SIZE_LARGER: setSize(SIZE_LARGE); break;
141 case SIZE_LARGE: setSize(SIZE_NORMAL); break;
142 case SIZE_NORMAL: setSize(SIZE_SMALL); break;
143 case SIZE_SMALL: setSize(SIZE_FOOTNOTE); break;
144 case SIZE_FOOTNOTE: setSize(SIZE_SCRIPT); break;
145 case SIZE_SCRIPT: setSize(SIZE_TINY); break;
146 case SIZE_TINY: break;
148 lyxerr << "Can't LyXFont::decSize on INCREASE_SIZE" << endl;
151 lyxerr <<"Can't LyXFont::decSize on DECREASE_SIZE" << endl;
154 lyxerr <<"Can't LyXFont::decSize on INHERIT_SIZE" << endl;
157 lyxerr <<"Can't LyXFont::decSize on IGNORE_SIZE" << endl;
164 /// Increases font size by one
165 LyXFont & LyXFont::incSize()
168 case SIZE_HUGER: break;
169 case SIZE_HUGE: setSize(SIZE_HUGER); break;
170 case SIZE_LARGEST: setSize(SIZE_HUGE); break;
171 case SIZE_LARGER: setSize(SIZE_LARGEST); break;
172 case SIZE_LARGE: setSize(SIZE_LARGER); break;
173 case SIZE_NORMAL: setSize(SIZE_LARGE); break;
174 case SIZE_SMALL: setSize(SIZE_NORMAL); break;
175 case SIZE_FOOTNOTE: setSize(SIZE_SMALL); break;
176 case SIZE_SCRIPT: setSize(SIZE_FOOTNOTE); break;
177 case SIZE_TINY: setSize(SIZE_SCRIPT); break;
179 lyxerr <<"Can't LyXFont::incSize on INCREASE_SIZE" << endl;
182 lyxerr <<"Can't LyXFont::incSize on DECREASE_SIZE" << endl;
185 lyxerr <<"Can't LyXFont::incSize on INHERIT_SIZE" << endl;
188 lyxerr <<"Can't LyXFont::incSize on IGNORE_SIZE" << endl;
195 /// Updates a misc setting according to request
196 LyXFont::FONT_MISC_STATE LyXFont::setMisc(FONT_MISC_STATE newfont,
199 if (newfont == TOGGLE) {
205 lyxerr <<"LyXFont::setMisc: Need state"
206 " ON or OFF to toggle. Setting to ON" << endl;
209 } else if (newfont == IGNORE)
216 /// Updates font settings according to request
217 void LyXFont::update(LyXFont const & newfont,
218 Language const * document_language, bool toggleall)
220 if(newfont.family() == family() && toggleall)
221 setFamily(INHERIT_FAMILY); // toggle 'back'
222 else if (newfont.family() != IGNORE_FAMILY)
223 setFamily(newfont.family());
224 // else it's IGNORE_SHAPE
226 // "Old" behaviour: "Setting" bold will toggle bold on/off.
227 switch (newfont.series()) {
230 if (series() == BOLD_SERIES && toggleall)
231 setSeries(MEDIUM_SERIES);
233 setSeries(BOLD_SERIES);
237 setSeries(newfont.series());
243 if(newfont.shape() == shape() && toggleall)
244 setShape(INHERIT_SHAPE); // toggle 'back'
245 else if (newfont.shape() != IGNORE_SHAPE)
246 setShape(newfont.shape());
247 // else it's IGNORE_SHAPE
249 if (newfont.size() != IGNORE_SIZE) {
250 if (newfont.size() == INCREASE_SIZE)
252 else if (newfont.size() == DECREASE_SIZE)
254 else if (newfont.size() == size() && toggleall)
255 setSize(INHERIT_SIZE); // toggle 'back'
257 setSize(newfont.size());
260 setEmph(setMisc(newfont.emph(), emph()));
261 setUnderbar(setMisc(newfont.underbar(), underbar()));
262 setNoun(setMisc(newfont.noun(), noun()));
263 setLatex(setMisc(newfont.latex(), latex()));
265 if (newfont.language() != ignore_language)
266 if (language() == newfont.language())
267 if (language() == document_language)
268 setLanguage(default_language);
270 setLanguage(document_language);
272 setLanguage(newfont.language());
274 if (newfont.color() == color() && toggleall)
275 setColor(LColor::inherit); // toggle 'back'
276 else if (newfont.color() != LColor::ignore)
277 setColor(newfont.color());
281 /// Reduce font to fall back to template where possible
282 void LyXFont::reduce(LyXFont const & tmplt)
284 if (family() == tmplt.family())
285 setFamily(INHERIT_FAMILY);
286 if (series() == tmplt.series())
287 setSeries(INHERIT_SERIES);
288 if (shape() == tmplt.shape())
289 setShape(INHERIT_SHAPE);
290 if (size() == tmplt.size())
291 setSize(INHERIT_SIZE);
292 if (emph() == tmplt.emph())
294 if (underbar() == tmplt.underbar())
295 setUnderbar(INHERIT);
296 if (noun() == tmplt.noun())
298 if (latex() == tmplt.latex())
300 if (color() == tmplt.color())
301 setColor(LColor::inherit);
305 /// Realize font from a template
306 LyXFont & LyXFont::realize(LyXFont const & tmplt)
308 if (bits == inherit) {
313 if (bits.family == INHERIT_FAMILY) {
314 bits.family = tmplt.bits.family;
316 if (bits.series == INHERIT_SERIES) {
317 bits.series = tmplt.bits.series;
319 if (bits.shape == INHERIT_SHAPE) {
320 bits.shape = tmplt.bits.shape;
322 if (bits.size == INHERIT_SIZE) {
323 bits.size = tmplt.bits.size;
325 if (bits.emph == INHERIT) {
326 bits.emph = tmplt.bits.emph;
328 if (bits.underbar == INHERIT) {
329 bits.underbar = tmplt.bits.underbar;
331 if (bits.noun == INHERIT) {
332 bits.noun = tmplt.bits.noun;
334 if (bits.latex == INHERIT) {
335 bits.latex = tmplt.bits.latex;
337 if (bits.color == LColor::inherit) {
338 bits.color = tmplt.bits.color;
345 /// Is font resolved?
346 bool LyXFont::resolved() const
348 return (family() != INHERIT_FAMILY && series() != INHERIT_SERIES &&
349 shape() != INHERIT_SHAPE && size() != INHERIT_SIZE &&
350 emph() != INHERIT && underbar() != INHERIT &&
351 noun() != INHERIT && latex() != INHERIT &&
352 color() != LColor::inherit);
356 /// Build GUI description of font state
357 string LyXFont::stateText() const
360 if (family() != INHERIT_FAMILY)
361 buf += string(_(GUIFamilyNames[family()].c_str())) + ", ";
362 if (series() != INHERIT_SERIES)
363 buf += string(_(GUISeriesNames[series()].c_str())) + ", ";
364 if (shape() != INHERIT_SHAPE)
365 buf += string(_(GUIShapeNames[shape()].c_str())) + ", ";
366 if (size() != INHERIT_SIZE)
367 buf += string(_(GUISizeNames[size()].c_str())) + ", ";
368 if (color() != LColor::inherit)
369 buf += lcolor.getGUIName(color()) + ", ";
370 if (emph() != INHERIT)
371 buf += string(_("Emphasis ")) + _(GUIMiscNames[emph()].c_str()) + ", ";
372 if (underbar() != INHERIT)
373 buf += string(_("Underline ")) + _(GUIMiscNames[underbar()].c_str()) + ", ";
374 if (noun() != INHERIT)
375 buf += string(_("Noun ")) + _(GUIMiscNames[noun()].c_str()) + ", ";
376 if (latex() != INHERIT)
377 buf += string(_("Latex ")) + _(GUIMiscNames[latex()].c_str()) + ", ";
380 buf = strip(buf, ' ');
381 buf = strip(buf, ',');
382 buf += " " + string(_("Language: ")) + _(language()->display.c_str());
387 // Set family according to lyx format string
388 LyXFont & LyXFont::setLyXFamily(string const & fam)
390 string s = lowercase(fam);
393 while (s != LyXFamilyNames[i] && LyXFamilyNames[i] != "error") ++i;
394 if (s == LyXFamilyNames[i]) {
395 setFamily(LyXFont::FONT_FAMILY(i));
397 lyxerr << "LyXFont::setLyXFamily: Unknown family `"
398 << s << '\'' << endl;
403 // Set series according to lyx format string
404 LyXFont & LyXFont::setLyXSeries(string const & ser)
406 string s = lowercase(ser);
409 while (s != LyXSeriesNames[i] && LyXSeriesNames[i] != "error") ++i;
410 if (s == LyXSeriesNames[i]) {
411 setSeries(LyXFont::FONT_SERIES(i));
413 lyxerr << "LyXFont::setLyXSeries: Unknown series `"
414 << s << '\'' << endl;
419 // Set shape according to lyx format string
420 LyXFont & LyXFont::setLyXShape(string const & sha)
422 string s = lowercase(sha);
425 while (s != LyXShapeNames[i] && LyXShapeNames[i] != "error") ++i;
426 if (s == LyXShapeNames[i]) {
427 setShape(LyXFont::FONT_SHAPE(i));
429 lyxerr << "LyXFont::setLyXShape: Unknown shape `"
430 << s << '\'' << endl;
435 // Set size according to lyx format string
436 LyXFont & LyXFont::setLyXSize(string const & siz)
438 string s = lowercase(siz);
440 while (s != LyXSizeNames[i] && LyXSizeNames[i] != "error") ++i;
441 if (s == LyXSizeNames[i]) {
442 setSize(LyXFont::FONT_SIZE(i));
444 lyxerr << "LyXFont::setLyXSize: Unknown size `"
445 << s << '\'' << endl;
449 // Set size according to lyx format string
450 LyXFont::FONT_MISC_STATE LyXFont::setLyXMisc(string const & siz)
452 string s = lowercase(siz);
454 while (s != LyXMiscNames[i] && LyXMiscNames[i] != "error") ++i;
455 if (s == LyXMiscNames[i])
456 return FONT_MISC_STATE(i);
457 lyxerr << "LyXFont::setLyXMisc: Unknown misc flag `"
458 << s << '\'' << endl;
462 /// Sets color after LyX text format
463 LyXFont & LyXFont::setLyXColor(string const & col)
465 setColor(lcolor.getFromLyXName(col));
470 /// Sets size after GUI name
471 LyXFont & LyXFont::setGUISize(string const & siz)
473 #warning this might be wrong.
475 // this is how it was how it was done in the lyx repository...
476 // but this does not make sense.
477 setColor(lcolor.getFromGUIName(siz));
482 // Returns size in latex format
483 string LyXFont::latexSize() const
485 return LaTeXSizeNames[size()];
489 // Read a font definition from given file in lyx format
491 LyXFont & LyXFont::lyxRead(LyXLex & lex)
494 bool finished = false;
495 while (!finished && lex.IsOK() && !error) {
497 string tok = lowercase(lex.GetString());
501 } else if (tok == "endfont") {
503 } else if (tok == "family") {
505 string tok = lex.GetString();
507 } else if (tok == "series") {
509 string tok = lex.GetString();
511 } else if (tok == "shape") {
513 string tok = lex.GetString();
515 } else if (tok == "size") {
517 string tok = lex.GetString();
519 } else if (tok == "latex") {
521 string tok = lowercase(lex.GetString());
523 if (tok == "no_latex") {
525 } else if (tok == "latex") {
528 lex.printError("Illegal LaTeX type`$$Token'");
530 } else if (tok == "misc") {
532 string tok = lowercase(lex.GetString());
534 if (tok == "no_bar") {
536 } else if (tok == "no_emph") {
538 } else if (tok == "no_noun") {
540 } else if (tok == "emph") {
542 } else if (tok == "underbar") {
544 } else if (tok == "noun") {
547 lex.printError("Illegal misc type `$$Token´");
549 } else if (tok == "color") {
551 string tok = lex.GetString();
554 lex.printError("Unknown tag `$$Token'");
562 /// Writes the changes from this font to orgfont in .lyx format in file
563 void LyXFont::lyxWriteChanges(LyXFont const & orgfont, ostream & os) const
566 if (orgfont.family() != family()) {
567 os << "\\family " << LyXFamilyNames[family()] << " \n";
569 if (orgfont.series() != series()) {
570 os << "\\series " << LyXSeriesNames[series()] << " \n";
572 if (orgfont.shape() != shape()) {
573 os << "\\shape " << LyXShapeNames[shape()] << " \n";
575 if (orgfont.size() != size()) {
576 os << "\\size " << LyXSizeNames[size()] << " \n";
578 if (orgfont.emph() != emph()) {
579 os << "\\emph " << LyXMiscNames[emph()] << " \n";
581 if (orgfont.underbar() != underbar()) {
582 // This is only for backwards compatibility
583 switch (underbar()) {
584 case OFF: os << "\\bar no \n"; break;
585 case ON: os << "\\bar under \n"; break;
586 case TOGGLE: lyxerr << "LyXFont::lyxWriteFontChanges: "
587 "TOGGLE should not appear here!"
590 case INHERIT: os << "\\bar default \n"; break;
591 case IGNORE: lyxerr << "LyXFont::lyxWriteFontChanges: "
592 "IGNORE should not appear here!"
597 if (orgfont.noun() != noun()) {
598 os << "\\noun " << LyXMiscNames[noun()] << " \n";
600 if (orgfont.latex() != latex()) {
601 // This is only for backwards compatibility
603 case OFF: os << "\\latex no_latex \n"; break;
604 case ON: os << "\\latex latex \n"; break;
605 case TOGGLE: lyxerr << "LyXFont::lyxWriteFontChanges: "
606 "TOGGLE should not appear here!"
609 case INHERIT: os << "\\latex default \n"; break;
610 case IGNORE: lyxerr << "LyXFont::lyxWriteFontChanges: "
611 "IGNORE should not appear here!"
616 if (orgfont.color() != color()) {
617 os << "\\color " << lcolor.getLyXName(color()) << "\n";
619 if (orgfont.language() != language()) {
621 os << "\\lang " << language()->lang << endl;
623 os << "\\lang unknown\n";
628 /// Writes the head of the LaTeX needed to impose this font
629 // Returns number of chars written.
630 int LyXFont::latexWriteStartChanges(ostream & os, LyXFont const & base,
631 LyXFont const & prev) const
636 if (language() != prev.language()) {
637 if (isRightToLeft() != prev.isRightToLeft()) {
638 if (isRightToLeft()) {
641 env = true; //We have opened a new environment
645 env = true; //We have opened a new environment
649 subst(lyxrc.language_command_begin,
650 "$$lang", language()->lang);
652 count += tmp.length();
653 env = true; //We have opened a new environment
660 if (f.family() != INHERIT_FAMILY) {
662 << LaTeXFamilyNames[f.family()]
664 count += LaTeXFamilyNames[f.family()].length() + 2;
665 env = true; //We have opened a new environment
667 if (f.series() != INHERIT_SERIES) {
669 << LaTeXSeriesNames[f.series()]
671 count += LaTeXSeriesNames[f.series()].length() + 2;
672 env = true; //We have opened a new environment
674 if (f.shape() != INHERIT_SHAPE) {
676 << LaTeXShapeNames[f.shape()]
678 count += LaTeXShapeNames[f.shape()].length() + 2;
679 env = true; //We have opened a new environment
681 if (f.color() != LColor::inherit) {
683 << lcolor.getLaTeXName(f.color())
685 count += lcolor.getLaTeXName(f.color()).length() + 13;
686 env = true; //We have opened a new environment
688 if (f.emph() == ON) {
691 env = true; //We have opened a new environment
693 if (f.underbar() == ON) {
696 env = true; //We have opened a new environment
698 // \noun{} is a LyX special macro
699 if (f.noun() == ON) {
702 env = true; //We have opened a new environment
704 if (f.size() != INHERIT_SIZE) {
705 // If we didn't open an environment above, we open one here
711 << LaTeXSizeNames[f.size()]
713 count += LaTeXSizeNames[f.size()].length() + 2;
719 /// Writes ending block of LaTeX needed to close use of this font
720 // Returns number of chars written
721 // This one corresponds to latexWriteStartChanges(). (Asger)
722 int LyXFont::latexWriteEndChanges(ostream & os, LyXFont const & base,
723 LyXFont const & next) const
728 if (language() != next.language()) {
731 env = true; // Size change need not bother about closing env.
734 LyXFont f = *this; // why do you need this?
735 f.reduce(base); // why isn't this just "reduce(base);" (Lgb)
736 // Because this function is const. Everything breaks if this
737 // method changes the font it represents. There is no speed penalty
738 // by using the temporary. (Asger)
740 if (f.family() != INHERIT_FAMILY) {
743 env = true; // Size change need not bother about closing env.
745 if (f.series() != INHERIT_SERIES) {
748 env = true; // Size change need not bother about closing env.
750 if (f.shape() != INHERIT_SHAPE) {
753 env = true; // Size change need not bother about closing env.
755 if (f.color() != LColor::inherit) {
758 env = true; // Size change need not bother about closing env.
760 if (f.emph() == ON) {
763 env = true; // Size change need not bother about closing env.
765 if (f.underbar() == ON) {
768 env = true; // Size change need not bother about closing env.
770 if (f.noun() == ON) {
773 env = true; // Size change need not bother about closing env.
775 if (f.size() != INHERIT_SIZE) {
776 // We only have to close if only size changed
787 LColor::color LyXFont::realColor() const
790 return LColor::latex;
791 if (color() == LColor::none)
792 return LColor::foreground;
797 // Convert logical attributes to concrete shape attribute
798 LyXFont::FONT_SHAPE LyXFont::realShape() const
800 register FONT_SHAPE s = shape();
814 XFontStruct * LyXFont::getXFontstruct() const
816 return fontloader.load(family(), series(), realShape(), size());
820 int LyXFont::maxAscent() const
822 return getXFontstruct()->ascent;
826 int LyXFont::maxDescent() const
828 return getXFontstruct()->descent;
832 int LyXFont::ascent(char c) const
834 XFontStruct * finfo = getXFontstruct();
835 unsigned int uc = static_cast<unsigned char>(c);
837 && uc >= finfo->min_char_or_byte2
838 && uc <= finfo->max_char_or_byte2)
839 return finfo->per_char[uc - finfo->min_char_or_byte2].ascent;
841 return finfo->ascent;
845 int LyXFont::descent(char c) const
847 XFontStruct * finfo = getXFontstruct();
848 unsigned int uc = static_cast<unsigned char>(c);
850 && uc >= finfo->min_char_or_byte2
851 && uc <= finfo->max_char_or_byte2)
852 return finfo->per_char[uc - finfo->min_char_or_byte2].descent;
854 return finfo->descent;
858 int LyXFont::lbearing(char c) const
860 XFontStruct * finfo = getXFontstruct();
861 unsigned int uc = static_cast<unsigned char>(c);
863 && uc >= finfo->min_char_or_byte2
864 && uc <= finfo->max_char_or_byte2)
865 return finfo->per_char[uc - finfo->min_char_or_byte2].lbearing;
871 int LyXFont::rbearing(char c) const
873 XFontStruct * finfo = getXFontstruct();
874 unsigned int uc = static_cast<unsigned char>(c);
876 && uc >= finfo->min_char_or_byte2
877 && uc <= finfo->max_char_or_byte2)
878 return finfo->per_char[uc - finfo->min_char_or_byte2].rbearing;
884 // Specialized after profiling. (Asger)
885 int LyXFont::width(char c) const
887 if (realShape() != LyXFont::SMALLCAPS_SHAPE){
888 return lyxrc.use_gui ? XTextWidth(getXFontstruct(), &c, 1) : 1;
890 return textWidth(&c, 1);
895 int LyXFont::textWidth(char const * s, int n) const
900 if (realShape() != LyXFont::SMALLCAPS_SHAPE){
901 return XTextWidth(getXFontstruct(), s, n);
903 // emulate smallcaps since X doesn't support this
904 unsigned int result = 0;
906 LyXFont smallfont = *this;
909 smallfont.setShape(LyXFont::UP_SHAPE);
910 for (int i = 0; i < n; ++i) {
912 // when islower is a macro, the cast is needed (JMarc)
913 if (islower(static_cast<unsigned char>(c))){
915 result += XTextWidth(smallfont.getXFontstruct(), &c, 1);
917 result += XTextWidth(getXFontstruct(), &c, 1);
925 int LyXFont::stringWidth(string const & s) const
927 if (s.empty()) return 0;
928 return textWidth(s.c_str(), s.length());
932 int LyXFont::signedStringWidth(string const & s) const
934 if (s.empty()) return 0;
935 if (s.c_str()[0] == '-')
936 return -textWidth(s.c_str()+1, s.length()-1);
938 return textWidth(s.c_str(), s.length());
942 int LyXFont::drawText(char const * s, int n, Pixmap,
945 if (realShape() != LyXFont::SMALLCAPS_SHAPE) {
946 /* XDrawString(fl_display,
951 XFlush(fl_display); */
952 return XTextWidth(getXFontstruct(), s, n);
955 // emulate smallcaps since X doesn't support this
958 LyXFont smallfont = *this;
961 smallfont.setShape(LyXFont::UP_SHAPE);
962 for (int i = 0; i < n; ++i) {
964 if (islower(static_cast<unsigned char>(c))){
966 /* XDrawString(fl_display,
971 x += XTextWidth(smallfont.getXFontstruct(),
973 //XFlush(fl_display);
975 /* XDrawString(fl_display,
980 x += XTextWidth(getXFontstruct(), &c, 1);
981 //XFlush(fl_display);
989 int LyXFont::drawString(string const & s, Pixmap pm, int baseline, int x) const
991 return drawText(s.c_str(), s.length(), pm, baseline, x);
995 bool LyXFont::equalExceptLatex(LyXFont const & f) const
998 f1.setLatex(f.latex());
1002 ostream & operator<<(ostream & o, LyXFont::FONT_MISC_STATE fms)
1004 return o << int(fms);