42 #define QT_FATAL_ASSERT 44 #include "qplatformdefs.h" 56 #include <private/qunicodetables_p.h> 62 #include <private/qt_x11_p.h> 69 #define QFONTLOADER_DEBUG 70 #define QFONTLOADER_DEBUG_VERBOSE 80 return (pointSize * dpi) /72.;
89 return pixelSize * 72. / ((double) dpi);
106 XFreeFontNames(fontNames);
117 return hash->
value(script);
125 hash->
insert(script, family);
138 int mib = codec ? codec->
mibEnum() : 4;
192 int QFont::x11Screen()
const 203 void QFont::x11SetScreen(
int screen)
220 engine = static_cast<QFontEngineMulti *>(engine)->engine(0);
222 return static_cast<QFontEngineXLFD *>(engine)->fontStruct()->fid;
229 #ifndef QT_NO_FREETYPE 232 engine = static_cast<QFontEngineMulti *>(engine)->engine(0);
233 #ifndef QT_NO_FONTCONFIG 252 engine = static_cast<QFontEngineMulti *>(engine)->engine(0);
317 "-*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*",
318 "-*-courier-medium-r-*-*-*-120-*-*-*-*-*-*",
319 "-*-times-medium-r-*-*-*-120-*-*-*-*-*-*",
320 "-*-lucida-medium-r-*-*-*-120-*-*-*-*-*-*",
321 "-*-helvetica-*-*-*-*-*-120-*-*-*-*-*-*",
322 "-*-courier-*-*-*-*-*-120-*-*-*-*-*-*",
323 "-*-times-*-*-*-*-*-120-*-*-*-*-*-*",
324 "-*-lucida-*-*-*-*-*-120-*-*-*-*-*-*",
325 "-*-helvetica-*-*-*-*-*-*-*-*-*-*-*-*",
326 "-*-courier-*-*-*-*-*-*-*-*-*-*-*-*",
327 "-*-times-*-*-*-*-*-*-*-*-*-*-*-*",
328 "-*-lucida-*-*-*-*-*-*-*-*-*-*-*-*",
329 "-*-fixed-*-*-*-*-*-*-*-*-*-*-*-*",
343 if (fontNames) XFreeFontNames(fontNames);
368 #if defined(CHECK_NULL) 369 qFatal(
"QFontPrivate::lastResortFont: Cannot find any reasonable font");
static QTextCodec * codecForLocale()
Returns a pointer to the codec most suitable for this locale.
static uint hash(const uchar *p, int n)
QHash< int, QString > FallBackHash
#define QT_END_NAMESPACE
This macro expands to.
static int appScreen()
Returns the number of the screen where the application is being displayed.
int remove(const Key &key)
Removes all the items that have the key from the hash.
QString qt_fallback_font_family(int script)
double qt_pixelSize(double pointSize, int dpi)
static bool fontExists(const QString &fontName)
static QByteArray qt_fixXLFD(const QByteArray &xlfd)
The QByteArray class provides an array of bytes.
QString lastResortFamily() const
Returns the "last resort" font family name.
static int defaultEncodingID
static void cleanup()
Internal function that cleans up the font system.
void setRawMode(bool)
If enable is true, turns raw mode on; otherwise turns raw mode off.
The QString class provides a Unicode character string.
HFONT handle() const
Returns the window system handle to the font, for low-level access.
virtual Type type() const =0
int qt_encoding_id_for_mib(int mib)
const T value(const Key &key) const
Returns the value associated with the key.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
void setFamily(const QString &)
Sets the family name of the font.
QString rawName() const
Returns the name of the font within the underlying window system.
virtual const char * name() const =0
#define QT_BEGIN_NAMESPACE
This macro expands to.
struct FT_FaceRec_ * FT_Face
static float pixelSize(const QFontDef &request, int dpi)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static void initialize()
Internal function that initializes the font system.
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
bool qt_fillFontDef(const QByteArray &xlfd, QFontDef *fd, int dpi, QtFontDesc *desc)
Q_CORE_EXPORT void qWarning(const char *,...)
virtual int mibEnum() const =0
Subclasses of QTextCodec must reimplement this function.
static QTextCodec * codec(MYSQL *mysql)
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
Q_CORE_EXPORT int QT_FASTCALL script(uint ucs4)
QFontEngine * engineForScript(int script) const
QString lastResortFont() const
Returns a "last resort" font name for the font matching algorithm.
const char * constData() const
Returns a pointer to the data stored in the byte array.
bool isNull() const
Returns true if this string is null; otherwise returns false.
Q_CORE_EXPORT void qFatal(const char *,...)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
FT_Face non_locked_face() const
QExplicitlySharedDataPointer< QFontPrivate > d
void detach()
Detaches the font object from common font data.
QString defaultFamily() const
Returns the family name that corresponds to the current style hint.
void setRawName(const QString &)
Sets a font by its system specific name.
FT_Face non_locked_face() const
static const char *const tryFonts[]
Q_GUI_EXPORT void qt_x11_set_fallback_font_family(int script, const QString &family)
FT_Face freetypeFace() const
Returns the handle to the primary FreeType face of the font.
The QTextCodec class provides conversions between text encodings.
static float pointSize(const QFontDef &fd, int dpi)
static Display * display()
Returns the default display for the application.
double qt_pointSize(double pixelSize, int dpi)