We need to use PKG_CHECK_MODULES(pangoft2) anyhow because we need to
link with its libraries, so make the version check there too and
simplify wxFont::AddPrivateFont() implementation in wxGTK.
This test seems to consistently fail, but the failure can't be
reproduced locally nor debugged on buildbot, so, lacking any other
solution, just disable it.
Commit fc7f20c419 did fix a memory leak in
this test case, but at the price of introducing a crash due to deleting
the same pointer twice.
The real fix would be to change the code here to avoid returning a
pointer which sometimes needs to be deleted and sometimes must not, but
for now just add a crude check to avoid crashing.
There doesn't seem to be any special reason to use wxStyledTextControl
in this sample and doing it unconditionally breaks the build with
--disable-stc, so use wxTextCtrl instead in this case.
Closes#17998.
This should have been done in b8c9cd3528
to avoid all warnings about std::auto_ptr<> being deprecated when using
g++ 6 or later which compiles in C++14 mode by default.
Just "activate" the font immediately when adding it using
AddPrivateFont(), nothing seems to be gained from having two functions
and it just makes things more complicated both when implementing and
when using the API.
Use pango_fc_font_map_set_config() to associate the FcConfig containing
the private fonts with the global Pango context to make them available.
Also use FcInitLoadConfigAndFonts() instead of just FcConfigCreate() to
initialize the new config with all the default fonts instead of just
using our private fonts in it.
FcConfigAppFontAddFile() that we use is only available since 2.8, so
check for at least this version of the library in configure.
Also change the macro guarding its use to the more semantically
appropriate "wxHAVE" rather than "wxUSE" and make it more precise by
adding "2_8_0" suffix to it.
This is necessary to recognize new fonts, for example those added using
AddPrivateFont(), as being valid: otherwise they were not found in the
cache and couldn't be used in wxGTK.
Don't rely on it being done during statics cleanup as this doesn't work
if the library is shutdown and re-initialized.
Use a module to do the cleanup, just as it's already done for a lot of
other global data in wx.
This is required to allow loading private fonts from the bundle
Resources/Fonts subdirectory and doesn't seem to have any negative
consequences for the applications which don't need this functionality.
Add an explicit call to wc_str() in one place where conversion to
wchar_t* is needed and use wxString::operator==() instead of lstrcmp()
to avoid having to perform this conversion explicitly in another place.
Ensure we don't keep the values in the global gs_privateFontFileNames
variable if the library is shutdown and reinitialized later, this would
be unexpected.
This ensures that they will be defined and work even when building with
wxUSE_GRAPHICS_CONTEXT==0 (as can happen even by default with old MinGW
versions).
Private fonts are still made available to wxGraphicsContext as well by
providing access to them from GDI+ code via wxGetPrivateFontFileNames().
wxFont::AddPrivateFont() can now be used to load a font from a file for the
applications private use. Update the font sample to show this.
Closes#13568.
There's a bug in OS X 10.11 where a toll-free bridged font may have an
attributed of private class __NSCFCharacterSet that unlike
NSCharacterSet doesn't conform to NSSecureCoding. This poses a problem
when such font is used in user-editable content, because some Asian
input methods then crash in 10.11 when editing the string. As a
workaround for this bug, don't use toll-free bridging, but re-create
NSFont from the descriptor instead on buggy OS X versions.
Fixes regression introduced in a77066d530
(#507).
It seems that older Git versions don't update submodules when issuing
just "git submodule update" if this option is not set.
We might actually prefer to use "update = rebase" but for now use the
smallest change that will (hopefully) allow people using older Git
versions to get the submodule updates.
Default wxGenericComboCtrl background colour is obtained under wxGTK
with wxComboBox::GetClassDefaultAttributes(). For wxGTK 3 returned colour
is fully transparent (00000000) which can cause problems with
proper drawing of controls deriving from wxGenericComboCtrl, like
wxPGComboBox which in turn is used by wxEnumProperty, wxCursorProperty,
etc.
wxPGComboBox should have background with the same colour as the cell
so we can explicitly set background colour to avoid using default one.
Closes#17986.
Instead, add the base class functions so the derived class always
overrides. If/when wxX11 and wxMotif are removed there won't be an
ifdef that no one ever notices isn't needed anymore.
Rely on the default initialization, this is arguably slightly less
clear, but allows to avoid the warning (which is disabled by default,
but still).
Closes#17997.
This warning is difficult to avoid as we don't want to initialize the
unused/reserved fields of SecretSchema struct, yet the compiler warns
about it (when using -Wextra).
There don't seem to be any really important changes affecting our use of
the library, but it seems better to use the 2016 version instead of the
1998 one and it also allows to get rid of many hacks that were needed
before as the things they worked around are now taken care of by the
library itself.
Use libjpeg-turbo repository as upstream, even if we don't use
libjpeg-turno library itself (yet?) because it also has all the historic
libjpeg versions in its repository, including 6b (dating from 1998!)
that our sources were based on.
Try to preserve most of the manual changes done to libtiff sources in
wxWidgets, dropping just some VC6-specific workarounds which are not
needed any more.