summaryrefslogtreecommitdiff
path: root/library/fontdatabase.cpp
Unidiff
Diffstat (limited to 'library/fontdatabase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/fontdatabase.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/fontdatabase.cpp b/library/fontdatabase.cpp
index d94e338..7934a09 100644
--- a/library/fontdatabase.cpp
+++ b/library/fontdatabase.cpp
@@ -122,97 +122,97 @@ QStringList FontDatabase::families() const
122} 122}
123 123
124#ifdef QT_NO_FONTDATABASE 124#ifdef QT_NO_FONTDATABASE
125/*! 125/*!
126 Returns a list of standard fontsizes. 126 Returns a list of standard fontsizes.
127*/ 127*/
128QValueList<int> FontDatabase::standardSizes() 128QValueList<int> FontDatabase::standardSizes()
129{ 129{
130 static int s[]={ 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 130 static int s[]={ 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28,
131 36, 48, 72, 0 }; 131 36, 48, 72, 0 };
132 static bool first = TRUE; 132 static bool first = TRUE;
133 static QValueList<int> sList; 133 static QValueList<int> sList;
134 if ( first ) { 134 if ( first ) {
135 first = FALSE; 135 first = FALSE;
136 int i = 0; 136 int i = 0;
137 while( s[i] ) 137 while( s[i] )
138 sList.append( s[i++] ); 138 sList.append( s[i++] );
139 } 139 }
140 return sList; 140 return sList;
141} 141}
142 142
143#endif 143#endif
144 144
145/*! 145/*!
146 Load any font renderer plugins that are available and make the fonts 146 Load any font renderer plugins that are available and make the fonts
147 that the plugins can read available. 147 that the plugins can read available.
148*/ 148*/
149void FontDatabase::loadRenderers() 149void FontDatabase::loadRenderers()
150{ 150{
151#ifndef QWS 151#ifndef QWS
152 return; 152 return;
153#else 153#else
154 154
155#ifndef QT_NO_COMPONENT 155#ifndef QT_NO_COMPONENT
156 if ( !factoryList ) 156 if ( !factoryList )
157 factoryList = new QValueList<FontFactory>; 157 factoryList = new QValueList<FontFactory>;
158 158
159 QValueList<FontFactory>::Iterator mit; 159 QValueList<FontFactory>::Iterator mit;
160 for ( mit = factoryList->begin(); mit != factoryList->end(); ++mit ) { 160 for ( mit = factoryList->begin(); mit != factoryList->end(); ++mit ) {
161 qt_fontmanager->factories.setAutoDelete( false ); 161 qt_fontmanager->factories.setAutoDelete( false );
162 qt_fontmanager->factories.removeRef( (*mit).factory ); 162 qt_fontmanager->factories.removeRef( (*mit).factory );
163 qt_fontmanager->factories.setAutoDelete( true ); 163 qt_fontmanager->factories.setAutoDelete( true );
164 (*mit).interface->release(); 164 (*mit).interface->release();
165 (*mit).library->unload(); 165 (*mit).library->unload();
166 delete (*mit).library; 166 delete (*mit).library;
167 } 167 }
168 factoryList->clear(); 168 factoryList->clear();
169 169
170 QString path = QPEApplication::qpeDir() + "/plugins/fontfactories"; 170 QString path = QPEApplication::qpeDir() + "plugins/fontfactories";
171#ifdef Q_OS_MACX 171#ifdef Q_OS_MACX
172 QDir dir( path, "lib*.dylib" ); 172 QDir dir( path, "lib*.dylib" );
173#else 173#else
174 QDir dir( path, "lib*.so" ); 174 QDir dir( path, "lib*.so" );
175#endif 175#endif
176 176
177 if ( !dir.exists()) 177 if ( !dir.exists())
178 return; 178 return;
179 179
180 QStringList list = dir.entryList(); 180 QStringList list = dir.entryList();
181 QStringList::Iterator it; 181 QStringList::Iterator it;
182 for ( it = list.begin(); it != list.end(); ++it ) { 182 for ( it = list.begin(); it != list.end(); ++it ) {
183 FontFactoryInterface *iface = 0; 183 FontFactoryInterface *iface = 0;
184 QLibrary *lib = new QLibrary( path + "/" + *it ); 184 QLibrary *lib = new QLibrary( path + "/" + *it );
185 if ( lib->queryInterface( IID_FontFactory, (QUnknownInterface**)&iface ) == QS_OK ) { 185 if ( lib->queryInterface( IID_FontFactory, (QUnknownInterface**)&iface ) == QS_OK ) {
186 FontFactory factory; 186 FontFactory factory;
187 factory.library = lib; 187 factory.library = lib;
188 factory.interface = iface; 188 factory.interface = iface;
189 factory.factory = factory.interface->fontFactory(); 189 factory.factory = factory.interface->fontFactory();
190 factoryList->append( factory ); 190 factoryList->append( factory );
191 qt_fontmanager->factories.append( factory.factory ); 191 qt_fontmanager->factories.append( factory.factory );
192 readFonts( factory.factory ); 192 readFonts( factory.factory );
193 } else { 193 } else {
194 delete lib; 194 delete lib;
195 } 195 }
196 } 196 }
197#endif 197#endif
198#endif 198#endif
199} 199}
200 200
201/*! 201/*!
202 \internal 202 \internal
203*/ 203*/
204void FontDatabase::readFonts( QFontFactory *factory ) 204void FontDatabase::readFonts( QFontFactory *factory )
205{ 205{
206#ifndef QWS 206#ifndef QWS
207return; 207return;
208#else 208#else
209 // Load in font definition file 209 // Load in font definition file
210 QString fn = fontDir() + "fontdir"; 210 QString fn = fontDir() + "fontdir";
211 FILE* fontdef=fopen(fn.local8Bit(),"r"); 211 FILE* fontdef=fopen(fn.local8Bit(),"r");
212 if(!fontdef) { 212 if(!fontdef) {
213 QCString temp=fn.local8Bit(); 213 QCString temp=fn.local8Bit();
214 qWarning("Cannot find font definition file %s - is $QTDIR set correctly?", 214 qWarning("Cannot find font definition file %s - is $QTDIR set correctly?",
215 temp.data()); 215 temp.data());
216 return; 216 return;
217 } 217 }
218 char buf[200]=""; 218 char buf[200]="";