mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-26 06:15:16 +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;
|
||||
|
||||
// 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
|
||||
unsigned int format = 0;
|
||||
|
@ -2417,7 +2417,6 @@ void GuiApplication::restoreGuiSession()
|
||||
QString const GuiApplication::romanFontName()
|
||||
{
|
||||
QFont font;
|
||||
font.setKerning(false);
|
||||
font.setStyleHint(QFont::Serif);
|
||||
font.setFamily("serif");
|
||||
|
||||
@ -2428,7 +2427,6 @@ QString const GuiApplication::romanFontName()
|
||||
QString const GuiApplication::sansFontName()
|
||||
{
|
||||
QFont font;
|
||||
font.setKerning(false);
|
||||
font.setStyleHint(QFont::SansSerif);
|
||||
font.setFamily("sans");
|
||||
|
||||
@ -2439,7 +2437,6 @@ QString const GuiApplication::sansFontName()
|
||||
QString const GuiApplication::typewriterFontName()
|
||||
{
|
||||
QFont font;
|
||||
font.setKerning(false);
|
||||
font.setStyleHint(QFont::TypeWriter);
|
||||
font.setFamily("monospace");
|
||||
|
||||
|
@ -165,7 +165,8 @@ QFont symbolFont(QString const & family, bool * ok)
|
||||
upper[0] = family[0].toUpper();
|
||||
|
||||
QFont font;
|
||||
font.setKerning(false);
|
||||
if (lyxrc.force_paint_single_char)
|
||||
font.setKerning(false);
|
||||
font.setFamily(family);
|
||||
|
||||
if (isChosenFont(font, family)) {
|
||||
@ -256,7 +257,8 @@ static QString makeFontName(QString const & family, QString const & foundry)
|
||||
GuiFontInfo::GuiFontInfo(FontInfo const & f)
|
||||
: metrics(QFont())
|
||||
{
|
||||
font.setKerning(false);
|
||||
if (lyxrc.force_paint_single_char)
|
||||
font.setKerning(false);
|
||||
QString const pat = symbolFamily(f.family());
|
||||
if (!pat.isEmpty()) {
|
||||
bool ok;
|
||||
|
@ -132,7 +132,6 @@ GuiLog::GuiLog(GuiView & lv)
|
||||
|
||||
logTB->setReadOnly(true);
|
||||
QFont font(guiApp->typewriterFontName());
|
||||
font.setKerning(false);
|
||||
font.setFixedPitch(true);
|
||||
font.setStyleHint(QFont::TypeWriter);
|
||||
logTB->setFont(font);
|
||||
|
@ -314,7 +314,6 @@ static void setComboxFont(QComboBox * cb, string const & family,
|
||||
// for bug 1063.
|
||||
|
||||
QFont font;
|
||||
font.setKerning(false);
|
||||
|
||||
QString const font_family = toqstr(family);
|
||||
if (font_family == guiApp->romanFontName()) {
|
||||
|
@ -61,7 +61,6 @@ GuiProgressView::GuiProgressView(GuiView & parent, Qt::DockWidgetArea area,
|
||||
setWidget(widget_);
|
||||
|
||||
QFont font(guiApp->typewriterFontName());
|
||||
font.setKerning(false);
|
||||
font.setFixedPitch(true);
|
||||
font.setStyleHint(QFont::TypeWriter);
|
||||
widget_->outTE->setFont(font);
|
||||
|
@ -72,7 +72,6 @@ ViewSourceWidget::ViewSourceWidget()
|
||||
///dialog_->viewSourceTV->setAcceptRichText(false);
|
||||
// this is personal. I think source code should be in fixed-size font
|
||||
QFont font(guiApp->typewriterFontName());
|
||||
font.setKerning(false);
|
||||
font.setFixedPitch(true);
|
||||
font.setStyleHint(QFont::TypeWriter);
|
||||
viewSourceTV->setFont(font);
|
||||
|
@ -264,15 +264,7 @@ void RowPainter::paintChars(pos_type & vpos, FontInfo const & font,
|
||||
|
||||
// collect as much similar chars as we can
|
||||
for (++vpos ; vpos < end ; ++vpos) {
|
||||
// Work-around bug #6920
|
||||
// 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)
|
||||
if (lyxrc.force_paint_single_char)
|
||||
break;
|
||||
|
||||
pos = bidi_.vis2log(vpos);
|
||||
|
Loading…
Reference in New Issue
Block a user