diff --git a/designsystems/fluent2/QskFluent2Skin.cpp b/designsystems/fluent2/QskFluent2Skin.cpp index 64bd1cc6..e38340ce 100644 --- a/designsystems/fluent2/QskFluent2Skin.cpp +++ b/designsystems/fluent2/QskFluent2Skin.cpp @@ -1880,7 +1880,6 @@ void Editor::setupTextFieldColors( { using Q = QskTextField; using A = QskAspect; - using W = QskFluent2Skin; const auto& pal = theme.palette; diff --git a/src/controls/QskItem.cpp b/src/controls/QskItem.cpp index c0b83dde..5a5a0940 100644 --- a/src/controls/QskItem.cpp +++ b/src/controls/QskItem.cpp @@ -1007,6 +1007,10 @@ void QskItem::itemChange( QQuickItem::ItemChange change, case QQuickItem::ItemRotationHasChanged: case QQuickItem::ItemAntialiasingHasChanged: case QQuickItem::ItemDevicePixelRatioHasChanged: +#if QT_VERSION >= QT_VERSION_CHECK( 6, 9, 0 ) + case QQuickItem::ItemScaleHasChanged: + case QQuickItem::ItemTransformHasChanged: +#endif { break; } diff --git a/src/graphic/QskGlyphTable.cpp b/src/graphic/QskGlyphTable.cpp index ca6cccca..13cd7607 100644 --- a/src/graphic/QskGlyphTable.cpp +++ b/src/graphic/QskGlyphTable.cpp @@ -50,15 +50,18 @@ namespace PostTableParser const auto from = reinterpret_cast< const uint8_t* >( glyphData + nglyphs ); const auto to = reinterpret_cast< const uint8_t* >( blob.data() + blob.size() ); - for ( auto s = from; s < to; s += *s + 1 ) - strings += s; - - for ( int i = 0; i < nglyphs; i++ ) + if ( to > from ) { - const int idx = qFromBigEndian( glyphData[i] ) - 258; + for ( auto s = from; s < to; s += *s + 1 ) + strings += s; - if ( idx >= 0 ) - names.insert( toString( strings[idx] ), i ); + for ( int i = 0; i < nglyphs; i++ ) + { + const int idx = qFromBigEndian( glyphData[i] ) - 258; + + if ( idx >= 0 && idx < strings.size() ) + names.insert( toString( strings[idx] ), i ); + } } } @@ -323,6 +326,12 @@ static uint qskGlyphCount( const QRawFont& font ) return fontEngine ? fontEngine->glyphCount() : 0; } +static qreal qskPixelSize( const QRawFont& font ) +{ + const auto fontEngine = QRawFontPrivate::get( font )->fontEngine; + return fontEngine ? fontEngine->fontDef.pixelSize : 0.0; +} + static GlyphNameTable qskGlyphNameTable( const QRawFont& font ) { const auto count = qskGlyphCount( font ); @@ -453,6 +462,10 @@ QskGraphic QskGlyphTable::glyphGraphic( uint glyphIndex ) const if ( !path.isEmpty() ) { + // vertical glyph coordinates are in the range [-sz, 0.0] + const auto sz = qskPixelSize( m_data->font ); + graphic.setViewBox( QRectF( 0.0, -sz, sz, sz ) ); + QPainter painter( &graphic ); painter.setRenderHint( QPainter::Antialiasing, true ); painter.fillPath( path, Qt::black ); diff --git a/tools/glyph2qvg/main.cpp b/tools/glyph2qvg/main.cpp index d86a7bb6..ba3053c5 100644 --- a/tools/glyph2qvg/main.cpp +++ b/tools/glyph2qvg/main.cpp @@ -34,9 +34,11 @@ int main( int argc, char* argv[] ) return -1; } + const int sz = 24; // something + QGuiApplication app( argc, argv ); - QRawFont font( QString( argv[1] ), 16 ); + QRawFont font( QString( argv[1] ), sz ); if ( !font.isValid() ) { qWarning() << "invalid font name:" << argv[1]; @@ -61,6 +63,9 @@ int main( int argc, char* argv[] ) QskGraphic graphic; + // vertical glyph coordinates are in the range [-sz, 0.0] + graphic.setViewBox( QRectF( 0.0, -sz, sz, sz ) ); + QPainter painter( &graphic ); painter.setRenderHint( QPainter::Antialiasing, true ); painter.fillPath( path, Qt::black );