Merge branch 'master' into features/effectnode
This commit is contained in:
commit
3834597d51
|
@ -1880,7 +1880,6 @@ void Editor::setupTextFieldColors(
|
||||||
{
|
{
|
||||||
using Q = QskTextField;
|
using Q = QskTextField;
|
||||||
using A = QskAspect;
|
using A = QskAspect;
|
||||||
using W = QskFluent2Skin;
|
|
||||||
|
|
||||||
const auto& pal = theme.palette;
|
const auto& pal = theme.palette;
|
||||||
|
|
||||||
|
|
|
@ -1007,6 +1007,10 @@ void QskItem::itemChange( QQuickItem::ItemChange change,
|
||||||
case QQuickItem::ItemRotationHasChanged:
|
case QQuickItem::ItemRotationHasChanged:
|
||||||
case QQuickItem::ItemAntialiasingHasChanged:
|
case QQuickItem::ItemAntialiasingHasChanged:
|
||||||
case QQuickItem::ItemDevicePixelRatioHasChanged:
|
case QQuickItem::ItemDevicePixelRatioHasChanged:
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK( 6, 9, 0 )
|
||||||
|
case QQuickItem::ItemScaleHasChanged:
|
||||||
|
case QQuickItem::ItemTransformHasChanged:
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,8 @@ namespace PostTableParser
|
||||||
const auto from = reinterpret_cast< const uint8_t* >( glyphData + nglyphs );
|
const auto from = reinterpret_cast< const uint8_t* >( glyphData + nglyphs );
|
||||||
const auto to = reinterpret_cast< const uint8_t* >( blob.data() + blob.size() );
|
const auto to = reinterpret_cast< const uint8_t* >( blob.data() + blob.size() );
|
||||||
|
|
||||||
|
if ( to > from )
|
||||||
|
{
|
||||||
for ( auto s = from; s < to; s += *s + 1 )
|
for ( auto s = from; s < to; s += *s + 1 )
|
||||||
strings += s;
|
strings += s;
|
||||||
|
|
||||||
|
@ -57,10 +59,11 @@ namespace PostTableParser
|
||||||
{
|
{
|
||||||
const int idx = qFromBigEndian( glyphData[i] ) - 258;
|
const int idx = qFromBigEndian( glyphData[i] ) - 258;
|
||||||
|
|
||||||
if ( idx >= 0 )
|
if ( idx >= 0 && idx < strings.size() )
|
||||||
names.insert( toString( strings[idx] ), i );
|
names.insert( toString( strings[idx] ), i );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
@ -323,6 +326,12 @@ static uint qskGlyphCount( const QRawFont& font )
|
||||||
return fontEngine ? fontEngine->glyphCount() : 0;
|
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 )
|
static GlyphNameTable qskGlyphNameTable( const QRawFont& font )
|
||||||
{
|
{
|
||||||
const auto count = qskGlyphCount( font );
|
const auto count = qskGlyphCount( font );
|
||||||
|
@ -453,6 +462,10 @@ QskGraphic QskGlyphTable::glyphGraphic( uint glyphIndex ) const
|
||||||
|
|
||||||
if ( !path.isEmpty() )
|
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 );
|
QPainter painter( &graphic );
|
||||||
painter.setRenderHint( QPainter::Antialiasing, true );
|
painter.setRenderHint( QPainter::Antialiasing, true );
|
||||||
painter.fillPath( path, Qt::black );
|
painter.fillPath( path, Qt::black );
|
||||||
|
|
|
@ -34,9 +34,11 @@ int main( int argc, char* argv[] )
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const int sz = 24; // something
|
||||||
|
|
||||||
QGuiApplication app( argc, argv );
|
QGuiApplication app( argc, argv );
|
||||||
|
|
||||||
QRawFont font( QString( argv[1] ), 16 );
|
QRawFont font( QString( argv[1] ), sz );
|
||||||
if ( !font.isValid() )
|
if ( !font.isValid() )
|
||||||
{
|
{
|
||||||
qWarning() << "invalid font name:" << argv[1];
|
qWarning() << "invalid font name:" << argv[1];
|
||||||
|
@ -61,6 +63,9 @@ int main( int argc, char* argv[] )
|
||||||
|
|
||||||
QskGraphic graphic;
|
QskGraphic graphic;
|
||||||
|
|
||||||
|
// vertical glyph coordinates are in the range [-sz, 0.0]
|
||||||
|
graphic.setViewBox( QRectF( 0.0, -sz, sz, sz ) );
|
||||||
|
|
||||||
QPainter painter( &graphic );
|
QPainter painter( &graphic );
|
||||||
painter.setRenderHint( QPainter::Antialiasing, true );
|
painter.setRenderHint( QPainter::Antialiasing, true );
|
||||||
painter.fillPath( path, Qt::black );
|
painter.fillPath( path, Qt::black );
|
||||||
|
|
Loading…
Reference in New Issue