Merge branch 'master' into features/effectnode

This commit is contained in:
Uwe Rathmann 2025-02-18 16:23:18 +01:00
commit 3834597d51
4 changed files with 30 additions and 9 deletions

View File

@ -1880,7 +1880,6 @@ void Editor::setupTextFieldColors(
{
using Q = QskTextField;
using A = QskAspect;
using W = QskFluent2Skin;
const auto& pal = theme.palette;

View File

@ -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;
}

View File

@ -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 );

View File

@ -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 );