summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontdatabase_mac.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-03-22 10:57:59 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-04-15 12:56:26 +0200
commit1348f4f0853155182d2ea5836902794d1e43980c (patch)
treef51a9882326ff3d89876902a65af0493436d3146 /src/gui/text/qfontdatabase_mac.cpp
parent3bff1637cd49617d334c1be63c20e008fac93be1 (diff)
Long live QRawFont!
The QGlyphs API was initially attempted with a bastardization of QFont which was meant to encapsulate a single, physical font instance (a QFontEngine) where a set of glyph indexes would make sense. This is not how QFont was intended to be used, and it caused several issues. At the same time, the requirement for loading a font from ttf/otf data and be able to access it and use it without polluting the rest of the process with the font arose. To support these two APIs we introduce QRawFont, which is an abstraction on top of a single physical font. Done-with: Jiang Jiang
Diffstat (limited to 'src/gui/text/qfontdatabase_mac.cpp')
-rw-r--r--src/gui/text/qfontdatabase_mac.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/text/qfontdatabase_mac.cpp b/src/gui/text/qfontdatabase_mac.cpp
index ad2c1b2ea6..5ba236b5f7 100644
--- a/src/gui/text/qfontdatabase_mac.cpp
+++ b/src/gui/text/qfontdatabase_mac.cpp
@@ -72,7 +72,7 @@ static void initWritingSystems(QtFontFamily *family, ATSFontRef atsFont)
qFromBigEndian<quint32>(os2Table.data() + 54)
};
quint32 codePageRange[2] = { qFromBigEndian<quint32>(os2Table.data() + 78), qFromBigEndian<quint32>(os2Table.data() + 82) };
- QList<QFontDatabase::WritingSystem> systems = determineWritingSystemsFromTrueTypeBits(unicodeRange, codePageRange);
+ QList<QFontDatabase::WritingSystem> systems = qt_determine_writing_systems_from_truetype_bits(unicodeRange, codePageRange);
#if 0
QCFString name;
ATSFontGetName(atsFont, kATSOptionFlagsDefault, &name);
@@ -244,6 +244,11 @@ static const char *styleHint(const QFontDef &request)
return stylehint;
}
+static inline float weightToFloat(unsigned int weight)
+{
+ return (weight - 50) / 100.0;
+}
+
void QFontDatabase::load(const QFontPrivate *d, int script)
{
// sanity checks