Qt 4.8
Macros | Enumerations | Functions | Variables
qfontconfigdatabase.cpp File Reference
#include "qfontconfigdatabase.h"
#include <QtCore/QList>
#include <QtGui/private/qfont_p.h>
#include <QtCore/QElapsedTimer>
#include <QtGui/private/qapplication_p.h>
#include <QtGui/QPlatformScreen>
#include <QtGui/private/qfontengine_ft_p.h>
#include <QtGui/private/qfontengine_p.h>
#include <ft2build.h>
#include <FT_TRUETYPE_TABLES_H>
#include <fontconfig/fontconfig.h>

Go to the source code of this file.

Macros

#define JapaneseCsbBit   17
 
#define KoreanCsbBit   21
 
#define SimplifiedChineseCsbBit   18
 
#define TraditionalChineseCsbBit   20
 

Enumerations

enum  { SpecialLanguageCount = sizeof(specialLanguages) / sizeof(const char *) }
 
enum  { SpecialCharCount = sizeof(specialChars) / sizeof(ushort) }
 
enum  { LanguageCount = sizeof(languageForWritingSystem) / sizeof(const char *) }
 
enum  { SampleCharCount = sizeof(sampleCharForWritingSystem) / sizeof(ushort) }
 

Functions

static const char * getFcFamilyForStyleHint (const QFont::StyleHint style)
 
static int getFCWeight (int fc_weight)
 
static bool requiresOpenType (int writingSystem)
 
static bool scriptRequiresOpenType (int script)
 

Variables

static const char * languageForWritingSystem []
 
static const char * openType []
 
static const ushort sampleCharForWritingSystem []
 
static const ushort specialChars []
 
static const char * specialLanguages []
 

Macro Definition Documentation

◆ JapaneseCsbBit

#define JapaneseCsbBit   17

Definition at line 64 of file qfontconfigdatabase.cpp.

◆ KoreanCsbBit

#define KoreanCsbBit   21

Definition at line 65 of file qfontconfigdatabase.cpp.

◆ SimplifiedChineseCsbBit

#define SimplifiedChineseCsbBit   18

Definition at line 62 of file qfontconfigdatabase.cpp.

◆ TraditionalChineseCsbBit

#define TraditionalChineseCsbBit   20

Definition at line 63 of file qfontconfigdatabase.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SpecialLanguageCount 

Definition at line 123 of file qfontconfigdatabase.cpp.

123 { SpecialLanguageCount = sizeof(specialLanguages) / sizeof(const char *) };
static const char * specialLanguages[]

◆ anonymous enum

anonymous enum
Enumerator
SpecialCharCount 

Definition at line 155 of file qfontconfigdatabase.cpp.

155 { SpecialCharCount = sizeof(specialChars) / sizeof(ushort) };
static const ushort specialChars[]
unsigned short ushort
Definition: qglobal.h:995

◆ anonymous enum

anonymous enum
Enumerator
LanguageCount 

Definition at line 195 of file qfontconfigdatabase.cpp.

195 { LanguageCount = sizeof(languageForWritingSystem) / sizeof(const char *) };
static const char * languageForWritingSystem[]

◆ anonymous enum

anonymous enum
Enumerator
SampleCharCount 

Definition at line 235 of file qfontconfigdatabase.cpp.

235 { SampleCharCount = sizeof(sampleCharForWritingSystem) / sizeof(ushort) };
static const ushort sampleCharForWritingSystem[]
unsigned short ushort
Definition: qglobal.h:995

Function Documentation

◆ getFcFamilyForStyleHint()

static const char* getFcFamilyForStyleHint ( const QFont::StyleHint  style)
static

Definition at line 277 of file qfontconfigdatabase.cpp.

Referenced by QFontconfigDatabase::fallbacksForFamily().

278 {
279  const char *stylehint = 0;
280  switch (style) {
281  case QFont::SansSerif:
282  stylehint = "sans-serif";
283  break;
284  case QFont::Serif:
285  stylehint = "serif";
286  break;
287  case QFont::TypeWriter:
288  stylehint = "monospace";
289  break;
290  default:
291  break;
292  }
293  return stylehint;
294 }

◆ getFCWeight()

static int getFCWeight ( int  fc_weight)
static

Definition at line 78 of file qfontconfigdatabase.cpp.

Referenced by QFontconfigDatabase::populateFontDatabase().

79 {
80  int qtweight = QFont::Black;
81  if (fc_weight <= (FC_WEIGHT_LIGHT + FC_WEIGHT_MEDIUM) / 2)
82  qtweight = QFont::Light;
83  else if (fc_weight <= (FC_WEIGHT_MEDIUM + FC_WEIGHT_DEMIBOLD) / 2)
84  qtweight = QFont::Normal;
85  else if (fc_weight <= (FC_WEIGHT_DEMIBOLD + FC_WEIGHT_BOLD) / 2)
86  qtweight = QFont::DemiBold;
87  else if (fc_weight <= (FC_WEIGHT_BOLD + FC_WEIGHT_BLACK) / 2)
88  qtweight = QFont::Bold;
89 
90  return qtweight;
91 }

◆ requiresOpenType()

static bool requiresOpenType ( int  writingSystem)
inlinestatic

Definition at line 67 of file qfontconfigdatabase.cpp.

Referenced by QFontconfigDatabase::populateFontDatabase().

68 {
69  return ((writingSystem >= QFontDatabase::Syriac && writingSystem <= QFontDatabase::Sinhala)
70  || writingSystem == QFontDatabase::Khmer || writingSystem == QFontDatabase::Nko);
71 }

◆ scriptRequiresOpenType()

static bool scriptRequiresOpenType ( int  script)
inlinestatic

Variable Documentation

◆ languageForWritingSystem

const char* languageForWritingSystem[]
static

Definition at line 159 of file qfontconfigdatabase.cpp.

Referenced by QFontconfigDatabase::populateFontDatabase().

◆ openType

const char* openType[]
static

Definition at line 240 of file qfontconfigdatabase.cpp.

Referenced by QFontconfigDatabase::populateFontDatabase().

◆ sampleCharForWritingSystem

const ushort sampleCharForWritingSystem[]
static

Definition at line 199 of file qfontconfigdatabase.cpp.

Referenced by QFontconfigDatabase::populateFontDatabase().

◆ specialChars

const ushort specialChars[]
static
Initial value:
= {
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0xc15,
0xc95,
0xd15,
0xd9a,
0,
0,
0,
0x1000,
0,
0,
0x1681,
0x16a0,
0,
0x7ca
}

Definition at line 125 of file qfontconfigdatabase.cpp.

◆ specialLanguages

const char* specialLanguages[]
static
Initial value:
= {
"en",
"el",
"ru",
"hy",
"he",
"ar",
"syr",
"div",
"hi",
"bn",
"pa",
"gu",
"or",
"ta",
"te",
"kn",
"ml",
"si",
"th",
"lo",
"bo",
"my",
"ka",
"ko",
"",
"",
"km",
""
}

Definition at line 93 of file qfontconfigdatabase.cpp.

Referenced by QFontconfigDatabase::fallbacksForFamily().