Am 14.04.2016 um 19:28 schrieb Guillaume Munch <g...@lyx.org>:
> 
> Le 14/04/2016 18:10, Stephan Witt a écrit :
>> Am 14.04.2016 um 18:18 schrieb Joel Kulesza <jkule...@gmail.com>:
>>> 
>>> On Thu, Apr 14, 2016 at 10:24 AM, Guillaume Munch <g...@lyx.org>
>>> wrote:
>>> 
>>> Can you please try the attached patch?
>>> 
>>> That patch seemed to work to correct the issue in both places (see
>>> attached). The font seems small (I'm not sure if that's perception
>>> or reality).  Regardless, it is fixed width.  Thank you! <Screen
>>> Shot 2016-04-14 at 12.18.34 PM.png>
>> 
>> Good idea. I can confirm this. Though some refactoring should be
>> done, IMO. See the attached patch. This allows some consistent
>> tweaking of font site too.
>> 
>> Stephan
>> 
> 
> Thanks for your patch. Then it should probably more be as the attached.

Yes, Qt < 5.2 doesn’t have the QFontDatabase::systemFont etc.

While googling I found this (and adapted it) for Mac:

=====
static bool isFixedPitch(const QFont & font) {
        const QFontInfo fi(font);
        return fi.fixedPitch();
}


QFont const GuiApplication::typewriterSystemFont()
{
#if QT_VERSION >= 0x050200
        QFont font = QFontDatabase::systemFont(QFontDatabase::FixedFont);
#else
        QFont font("monospace");
#endif
        if (!isFixedPitch(font)) {
                font.setStyleHint(QFont::Monospace);
                if (!isFixedPitch(font)) {
                        font.setStyleHint(QFont::TypeWriter);
                        if (!isFixedPitch(font)) font.setFamily("courier");
                }
        }
#ifdef Q_OS_MAC
        font.setPointSize(12);
#endif 
        return font;
}
=====


> 
> The font size of 12 appears too big here.

I couldn’t come up with a solution to configure Qt system settings on Mac.
I already searched for something like that to solve the cursor thickness 
issue (should be configurable too) and failed.

> I'm more thinking of a local
> configuration issue. I do not recommend keeping this font size line.

Yes, probably better.

Stephan

> 
> <0001-Fix-monospace-fonts-on-Mac.patch>

Reply via email to