本文整理汇总了C++中QRawFont::descent方法的典型用法代码示例。如果您正苦于以下问题:C++ QRawFont::descent方法的具体用法?C++ QRawFont::descent怎么用?C++ QRawFont::descent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QRawFont
的用法示例。
在下文中一共展示了QRawFont::descent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copyConstructor
void tst_QRawFont::copyConstructor()
{
QFETCH(QFont::HintingPreference, hintingPreference);
{
QString rawFontFamilyName;
qreal rawFontPixelSize;
qreal rawFontAscent;
qreal rawFontDescent;
int rawFontTableSize;
QRawFont outerRawFont;
{
QRawFont rawFont(QString::fromLatin1(SRCDIR "testfont.ttf"), 11, hintingPreference);
QVERIFY(rawFont.isValid());
rawFontFamilyName = rawFont.familyName();
rawFontPixelSize = rawFont.pixelSize();
rawFontAscent = rawFont.ascent();
rawFontDescent = rawFont.descent();
rawFontTableSize = rawFont.fontTable("glyf").size();
QVERIFY(rawFontTableSize > 0);
{
QRawFont otherRawFont(rawFont);
QVERIFY(otherRawFont.isValid());
QCOMPARE(otherRawFont.pixelSize(), rawFontPixelSize);
QCOMPARE(otherRawFont.familyName(), rawFontFamilyName);
QCOMPARE(otherRawFont.hintingPreference(), hintingPreference);
QCOMPARE(otherRawFont.ascent(), rawFontAscent);
QCOMPARE(otherRawFont.descent(), rawFontDescent);
QCOMPARE(otherRawFont.fontTable("glyf").size(), rawFontTableSize);
}
{
QRawFont otherRawFont = rawFont;
QVERIFY(otherRawFont.isValid());
QCOMPARE(otherRawFont.pixelSize(), rawFontPixelSize);
QCOMPARE(otherRawFont.familyName(), rawFontFamilyName);
QCOMPARE(otherRawFont.hintingPreference(), hintingPreference);
QCOMPARE(otherRawFont.ascent(), rawFontAscent);
QCOMPARE(otherRawFont.descent(), rawFontDescent);
QCOMPARE(otherRawFont.fontTable("glyf").size(), rawFontTableSize);
}
outerRawFont = rawFont;
}
QVERIFY(outerRawFont.isValid());
QCOMPARE(outerRawFont.pixelSize(), rawFontPixelSize);
QCOMPARE(outerRawFont.familyName(), rawFontFamilyName);
QCOMPARE(outerRawFont.hintingPreference(), hintingPreference);
QCOMPARE(outerRawFont.ascent(), rawFontAscent);
QCOMPARE(outerRawFont.descent(), rawFontDescent);
QCOMPARE(outerRawFont.fontTable("glyf").size(), rawFontTableSize);
}
}
示例2: invalidRawFont
void tst_QRawFont::invalidRawFont()
{
QRawFont font;
QVERIFY(!font.isValid());
QCOMPARE(font.pixelSize(), 0.0);
QVERIFY(font.familyName().isEmpty());
QCOMPARE(font.style(), QFont::StyleNormal);
QCOMPARE(font.weight(), -1);
QCOMPARE(font.ascent(), 0.0);
QCOMPARE(font.descent(), 0.0);
QVERIFY(font.glyphIndexesForString(QLatin1String("Test")).isEmpty());
}