> As a follow-up to this discussion [1], I have created a patch (posted
> directly to Neil) to add a new "Font Quality" setting, to control
> whether or not to enable font anti-aliasing (smoothing) through a
> SCI_SETFONTQUALITY message. The rationale is that there's Windows
> fonts to look good either only with or without anti-aliasing (this may
> be the same on other platforms).
A single setting (per Scintilla instance) doesn't really fix the
original problem which is that particular fonts should have their
quality tweaked. Editors that only use a single font for all text will
be fine with a single setting, but when multiple fonts are used then
this would be better modeled as a per-style setting. This would be a
larger change and I don't know whether it is worth the effort.
> * Where to put #defines required in both Scintilla.h and PlatWin.cxx,
> such as the new font quality options?
If they are are attempting to provide a cross-platform enumeration
then two parallel definitions - one in Scintilla.iface and another in
a new header in the src directory. If they are trying to pass through
platform-specific values then no definitions anywhere.
> * Not sure if the `#if (_WIN32_WINNT >= _WIN32_WINNT_WINXP)' should be
> dropped, making the Scintilla client responsible to specify only
> options supported by the OS.
Probably be simplest as a more limited set of cross-platform
states. Just the minimum needed to meet current needs, with DEFAULT,
ANTIALIASED, and LCD_OPTIMIZED with these mapped to the particular
platform values.
> * There's other spots in PlatWin.cxx to create fonts, their
> LOGFONT::lfQuality setting is currently not changed. This should
> probably go into the documentation?
All of these should be copying from an existing font. There may be
minor issues if you change the setting while, for example, a list box
is on the screen.
> * Please check my modifications to font hashing, they may not be
> adequate.
Since hashes may collide the only issue would be additional clashes
if fonts differed just in their quality. Unlikely with a single
setting (I suppose there could be two windows one aliased and one not)
and not a big problem.
Neil
> That's true, the original problem still exists. The Scintilla client
> or user will have to choose a set of fonts that looks harmonic either
> with or without anti-aliasing. However, there's a little more control
> over which set to choose.
ClearType isn't just anti-aliasing - it is LCD optimized
anti-aliasing and should not be turned on for CRTs.
http://en.wikipedia.org/wiki/Cleartype
I don't think it is sensible to include options no one understands.
From Microsoft's Internationalization guy Michael Kaplan
http://blogs.msdn.com/michkap/archive/2006/10/22/854820.aspx:
"""Yes, there is that extra CLEARTYPE_NATURAL_QUALITY constant which
is defined in the header file and documented all over creation except
on MSDN right now. Good luck trying to determine what it means. :-)
"""
>> Probably be simplest as a more limited set of cross-platform
>> states. Just the minimum needed to meet current needs, with DEFAULT,
>> ANTIALIASED, and LCD_OPTIMIZED with these mapped to the particular
>> platform values.
>
> And also NONANTIALIASED?
I don't think anyone has asked for that. The wxSTC use case seems
to be that there were problems with anti-aliasing so the default on
the Mac (extraFontFlag = false) is no aliasing and on other platforms
it is true -> anti-aliased. So that is equivalent to DEFAULT=0,
ANTIALIASED=1. For Windows now we want a default and a force cleartype
(equivalent to LCD optimization on other platforms) so that fits with
DEFAULT=0, LCD_OPTIMIZED=2.
I suppose we could try to remove the '!' Pango prefix on GTK+ which
could be done with the choices DEFAULT=0, NONANTIALIASED=3 although
that could also be implemented by having vs.extraFontFlag be
ANTIALIASED by default similar to the way each platform has its own
preferred default font name. Since the '!' prefix would have to stay
for a long deprecation period, it doesn't seem like a big win.
Neil
> As a follow-up to this discussion [1], I have created a patch (posted
> directly to Neil) to add a new "Font Quality" setting, to control
> whether or not to enable font anti-aliasing (smoothing) through a
> SCI_SETFONTQUALITY message.
This is now committed. The value of SC_EFF_QUALITY_LCD_OPTIMIZED is
now 3 rather than 4 since these can not be used as bit flags.
Maintainers of other platforms will have to make some changes to
allow extraFontFlag to be an int and may want to make other changes to
implement different quality levels. Each quality level is advisory and
a platform may choose to treat all quality levels as default. Only 4
bits of the extraFontFlag are used for quality level so these should
be masked off so that other bits can be used for other features in the
future.
Neil