Make it possible to create distance fields with any height

Assuming a certain max height for glyphs would make it impossible
to render certain fonts. The follow up to this change is in
Qt Quick, where the code must also be adapted to make it work.

Task-number: QTBUG-52389
Change-Id: Iabebb2de21a92d1537b2965aa6603529c1d5d587
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
bb10
Eskil Abrahamsen Blomfeldt 2016-06-09 14:03:22 +02:00
parent 23173c725c
commit fe97ecf408
1 changed files with 2 additions and 1 deletions

View File

@ -799,8 +799,9 @@ QDistanceFieldData *QDistanceFieldData::create(const QPainterPath &path, bool do
{
int dfMargin = QT_DISTANCEFIELD_RADIUS(doubleResolution) / QT_DISTANCEFIELD_SCALE(doubleResolution);
int glyphWidth = qCeil(path.boundingRect().width() / QT_DISTANCEFIELD_SCALE(doubleResolution)) + dfMargin * 2;
int glyphHeight = qCeil(path.boundingRect().height() / QT_DISTANCEFIELD_SCALE(doubleResolution)) + dfMargin * 2;
QDistanceFieldData *data = create(QSize(glyphWidth, QT_DISTANCEFIELD_TILESIZE(doubleResolution)));
QDistanceFieldData *data = create(QSize(glyphWidth, glyphHeight));
makeDistanceField(data,
path,