Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
DISCONTINUED:openSUSE:11.1:Update
kdelibs3
fontconfig-reverse-lookup.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fontconfig-reverse-lookup.diff of Package kdelibs3
Index: kdeui/Makefile.am =================================================================== --- kdeui/Makefile.am (Revision 502726) +++ kdeui/Makefile.am (Arbeitskopie) @@ -20,7 +20,7 @@ SUBDIRS = . kdetrayproxy tests about -INCLUDES= -I$(top_srcdir)/kdefx -I$(top_srcdir)/interfaces $(all_includes) +INCLUDES= -I/usr/include/freetype2/ -I$(top_srcdir)/kdefx -I$(top_srcdir)/interfaces $(all_includes) # For the future: examine if condensing the tons of *_LDFLAGS variables # into $(all_libraries) isn't better Index: kdeui/kaction.cpp =================================================================== --- kdeui/kaction.cpp (Revision 502726) +++ kdeui/kaction.cpp (Arbeitskopie) @@ -42,6 +42,17 @@ #include <ktoolbar.h> #include <ktoolbarbutton.h> +#include <ft2build.h> +#include FT_FREETYPE_H +#include <X11/Xdefs.h> +#include <X11/Xlib.h> +#include <X11/Xatom.h> +#include <X11/Intrinsic.h> +#include <X11/StringDefs.h> +#include <X11/Shell.h> + +#include <X11/Xft/Xft.h> + /** * How it works. * KActionCollection is an organizing container for KActions. Index: kdeui/kactionclasses.cpp =================================================================== --- kdeui/kactionclasses.cpp (Revision 502726) +++ kdeui/kactionclasses.cpp (Arbeitskopie) @@ -27,6 +27,9 @@ #include "kactionclasses.h" #include <assert.h> +#include <ft2build.h> +#include FT_FREETYPE_H +#include <fontconfig/fontconfig.h> #include <qcursor.h> #include <qclipboard.h> @@ -35,6 +38,7 @@ #include <qwhatsthis.h> #include <qtimer.h> #include <qfile.h> +#include <qregexp.h> #include <dcopclient.h> #include <dcopref.h> @@ -1502,7 +1506,24 @@ return; } } - kdDebug(129) << "Font not found " << family.lower() << endl; + + // nothing matched yet, try a fontconfig reverse lookup and + // check again to solve an alias + FcPattern *pattern = NULL; + FcConfig *config = NULL; + QString realFamily; + QRegExp regExp("[-:]"); + pattern = FcNameParse( (unsigned char*) family.ascii() ); + FcDefaultSubstitute(pattern); + FcConfigSubstitute (config, pattern, FcMatchPattern); + pattern = FcFontMatch(NULL, pattern, NULL); + realFamily = (char*)FcNameUnparse(pattern); + realFamily.remove(realFamily.find(regExp), realFamily.length()); + + if ( !realFamily.isEmpty() && realFamily != family ) + setFont( realFamily ); + else + kdDebug(129) << "Font not found " << family.lower() << endl; } int KFontAction::plug( QWidget *w, int index ) Index: kdeui/kfontcombo.cpp =================================================================== --- kdeui/kfontcombo.cpp (Revision 502726) +++ kdeui/kfontcombo.cpp (Arbeitskopie) @@ -20,6 +20,7 @@ #include <qfontdatabase.h> #include <qlistbox.h> #include <qpainter.h> +#include <qregexp.h> #include <kcharsets.h> #include <kconfig.h> @@ -29,6 +30,18 @@ #include "kfontcombo.h" #include "kfontcombo.moc" +#include <ft2build.h> +#include FT_FREETYPE_H +#include <fontconfig/fontconfig.h> +#include <X11/Xlib.h> +#include <X11/Xatom.h> +#include <X11/Intrinsic.h> +#include <X11/StringDefs.h> +#include <X11/Shell.h> + +#include <X11/Xft/Xft.h> + + struct KFontComboPrivate { KFontComboPrivate() @@ -227,6 +240,22 @@ return; } } + + // nothing matched yet, try a fontconfig reverse lookup and + // check again to solve an alias + FcPattern *pattern = NULL; + FcConfig *config = NULL; + QString realFamily; + QRegExp regExp("[-:]"); + pattern = FcNameParse( (unsigned char*) family.ascii() ); + FcDefaultSubstitute(pattern); + FcConfigSubstitute (config, pattern, FcMatchPattern); + pattern = FcFontMatch(NULL, pattern, NULL); + realFamily = (char*)FcNameUnparse(pattern); + realFamily.remove(realFamily.find(regExp), realFamily.length()); + + if ( !realFamily.isEmpty() && realFamily != family ) + setCurrentFont( realFamily ); } void KFontCombo::slotModified( int )
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor