mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
Get rid of ugly font metrics workarounds.
Now we have proper ligatures and kerning on screen...
This commit is contained in:
parent
35d47698c6
commit
01c9bcb432
@ -448,7 +448,8 @@ LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
|
|||||||
return ReadError;
|
return ReadError;
|
||||||
|
|
||||||
// default for current rowpainter capabilities
|
// default for current rowpainter capabilities
|
||||||
force_paint_single_char = true;
|
//force_paint_single_char = true;
|
||||||
|
force_paint_single_char = false;
|
||||||
|
|
||||||
// format prior to 2.0 and introduction of format tag
|
// format prior to 2.0 and introduction of format tag
|
||||||
unsigned int format = 0;
|
unsigned int format = 0;
|
||||||
|
@ -2417,7 +2417,6 @@ void GuiApplication::restoreGuiSession()
|
|||||||
QString const GuiApplication::romanFontName()
|
QString const GuiApplication::romanFontName()
|
||||||
{
|
{
|
||||||
QFont font;
|
QFont font;
|
||||||
font.setKerning(false);
|
|
||||||
font.setStyleHint(QFont::Serif);
|
font.setStyleHint(QFont::Serif);
|
||||||
font.setFamily("serif");
|
font.setFamily("serif");
|
||||||
|
|
||||||
@ -2428,7 +2427,6 @@ QString const GuiApplication::romanFontName()
|
|||||||
QString const GuiApplication::sansFontName()
|
QString const GuiApplication::sansFontName()
|
||||||
{
|
{
|
||||||
QFont font;
|
QFont font;
|
||||||
font.setKerning(false);
|
|
||||||
font.setStyleHint(QFont::SansSerif);
|
font.setStyleHint(QFont::SansSerif);
|
||||||
font.setFamily("sans");
|
font.setFamily("sans");
|
||||||
|
|
||||||
@ -2439,7 +2437,6 @@ QString const GuiApplication::sansFontName()
|
|||||||
QString const GuiApplication::typewriterFontName()
|
QString const GuiApplication::typewriterFontName()
|
||||||
{
|
{
|
||||||
QFont font;
|
QFont font;
|
||||||
font.setKerning(false);
|
|
||||||
font.setStyleHint(QFont::TypeWriter);
|
font.setStyleHint(QFont::TypeWriter);
|
||||||
font.setFamily("monospace");
|
font.setFamily("monospace");
|
||||||
|
|
||||||
|
@ -165,6 +165,7 @@ QFont symbolFont(QString const & family, bool * ok)
|
|||||||
upper[0] = family[0].toUpper();
|
upper[0] = family[0].toUpper();
|
||||||
|
|
||||||
QFont font;
|
QFont font;
|
||||||
|
if (lyxrc.force_paint_single_char)
|
||||||
font.setKerning(false);
|
font.setKerning(false);
|
||||||
font.setFamily(family);
|
font.setFamily(family);
|
||||||
|
|
||||||
@ -256,6 +257,7 @@ static QString makeFontName(QString const & family, QString const & foundry)
|
|||||||
GuiFontInfo::GuiFontInfo(FontInfo const & f)
|
GuiFontInfo::GuiFontInfo(FontInfo const & f)
|
||||||
: metrics(QFont())
|
: metrics(QFont())
|
||||||
{
|
{
|
||||||
|
if (lyxrc.force_paint_single_char)
|
||||||
font.setKerning(false);
|
font.setKerning(false);
|
||||||
QString const pat = symbolFamily(f.family());
|
QString const pat = symbolFamily(f.family());
|
||||||
if (!pat.isEmpty()) {
|
if (!pat.isEmpty()) {
|
||||||
|
@ -132,7 +132,6 @@ GuiLog::GuiLog(GuiView & lv)
|
|||||||
|
|
||||||
logTB->setReadOnly(true);
|
logTB->setReadOnly(true);
|
||||||
QFont font(guiApp->typewriterFontName());
|
QFont font(guiApp->typewriterFontName());
|
||||||
font.setKerning(false);
|
|
||||||
font.setFixedPitch(true);
|
font.setFixedPitch(true);
|
||||||
font.setStyleHint(QFont::TypeWriter);
|
font.setStyleHint(QFont::TypeWriter);
|
||||||
logTB->setFont(font);
|
logTB->setFont(font);
|
||||||
|
@ -314,7 +314,6 @@ static void setComboxFont(QComboBox * cb, string const & family,
|
|||||||
// for bug 1063.
|
// for bug 1063.
|
||||||
|
|
||||||
QFont font;
|
QFont font;
|
||||||
font.setKerning(false);
|
|
||||||
|
|
||||||
QString const font_family = toqstr(family);
|
QString const font_family = toqstr(family);
|
||||||
if (font_family == guiApp->romanFontName()) {
|
if (font_family == guiApp->romanFontName()) {
|
||||||
|
@ -61,7 +61,6 @@ GuiProgressView::GuiProgressView(GuiView & parent, Qt::DockWidgetArea area,
|
|||||||
setWidget(widget_);
|
setWidget(widget_);
|
||||||
|
|
||||||
QFont font(guiApp->typewriterFontName());
|
QFont font(guiApp->typewriterFontName());
|
||||||
font.setKerning(false);
|
|
||||||
font.setFixedPitch(true);
|
font.setFixedPitch(true);
|
||||||
font.setStyleHint(QFont::TypeWriter);
|
font.setStyleHint(QFont::TypeWriter);
|
||||||
widget_->outTE->setFont(font);
|
widget_->outTE->setFont(font);
|
||||||
|
@ -72,7 +72,6 @@ ViewSourceWidget::ViewSourceWidget()
|
|||||||
///dialog_->viewSourceTV->setAcceptRichText(false);
|
///dialog_->viewSourceTV->setAcceptRichText(false);
|
||||||
// this is personal. I think source code should be in fixed-size font
|
// this is personal. I think source code should be in fixed-size font
|
||||||
QFont font(guiApp->typewriterFontName());
|
QFont font(guiApp->typewriterFontName());
|
||||||
font.setKerning(false);
|
|
||||||
font.setFixedPitch(true);
|
font.setFixedPitch(true);
|
||||||
font.setStyleHint(QFont::TypeWriter);
|
font.setStyleHint(QFont::TypeWriter);
|
||||||
viewSourceTV->setFont(font);
|
viewSourceTV->setFont(font);
|
||||||
|
@ -264,15 +264,7 @@ void RowPainter::paintChars(pos_type & vpos, FontInfo const & font,
|
|||||||
|
|
||||||
// collect as much similar chars as we can
|
// collect as much similar chars as we can
|
||||||
for (++vpos ; vpos < end ; ++vpos) {
|
for (++vpos ; vpos < end ; ++vpos) {
|
||||||
// Work-around bug #6920
|
if (lyxrc.force_paint_single_char)
|
||||||
// The bug can be reproduced with DejaVu font under Linux.
|
|
||||||
// The issue is that we compute the metrics character by character
|
|
||||||
// in ParagraphMetrics::singleWidth(); but we paint word by word
|
|
||||||
// for performance reason.
|
|
||||||
// Maybe a more general fix would be draw character by character
|
|
||||||
// for some predefined fonts on some platform. In arabic and
|
|
||||||
// Hebrew we already do paint this way.
|
|
||||||
if (prev_char == 'f' || lyxrc.force_paint_single_char)
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
pos = bidi_.vis2log(vpos);
|
pos = bidi_.vis2log(vpos);
|
||||||
|
Loading…
Reference in New Issue
Block a user