diff --git a/designsystems/fluent2/QskFluent2Skin.cpp b/designsystems/fluent2/QskFluent2Skin.cpp index 6ccce35b..d52c10c0 100644 --- a/designsystems/fluent2/QskFluent2Skin.cpp +++ b/designsystems/fluent2/QskFluent2Skin.cpp @@ -2045,21 +2045,9 @@ void QskFluent2Skin::initHints() static inline QFont createFont( int size, int lineHeight, QFont::Weight weight ) { - Q_UNUSED( lineHeight ); // ??? + Q_UNUSED( lineHeight ); // TODO ... const int pixelSize = qRound( qskPxToPixels( size ) ); - /* - Font size determines how big or small the letters are, while line height - controls the vertical space between the lines of text. - - https://doc.qt.io/qt-6/qfont.html#details: - "It is possible to set the height of characters shown on the screen - to a specified number of pixels with setPixelSize()" - - https://doc.qt.io/qt-5/qfontmetrics.html#lineSpacing: - "This value is always equal to leading()+height()" - */ - QFont font( QStringLiteral( "Segoe UI" ), -1, weight ); static bool checkFont = true; diff --git a/designsystems/material3/QskMaterial3Skin.cpp b/designsystems/material3/QskMaterial3Skin.cpp index 11e727ea..b18e1bf9 100644 --- a/designsystems/material3/QskMaterial3Skin.cpp +++ b/designsystems/material3/QskMaterial3Skin.cpp @@ -3,6 +3,11 @@ * SPDX-License-Identifier: BSD-3-Clause *****************************************************************************/ +/* + Definitions ( where possible ) taken from + https://www.figma.com/file/O4H724CKmUVPocw6JoSUrd/Material-3-Design-Kit-(Community) + */ + #include "QskMaterial3Skin.h" #include @@ -65,11 +70,8 @@ namespace { using F = QskFontRole; - /* - Material 3 font roles according to: - https://m3.material.io/styles/typography/overview - https://www.figma.com/file/O4H724CKmUVPocw6JoSUrd/Material-3-Design-Kit-(Community)?type=design&node-id=49848-6285&mode=design - */ + // M3 font roles: https://m3.material.io/styles/typography/type-scale-tokens + constexpr F LabelSmall = { F::Caption, F::Low }; constexpr F LabelMedium = { F::Caption, F::Normal }; constexpr F LabelLarge = { F::Caption, F::High }; @@ -1434,13 +1436,6 @@ static inline QFont createFont( int size, int lineHeight, { Q_UNUSED( lineHeight ); - /* - sp (Scaleable Pixels OR scale-independent pixels) — this is - like the dp unit, but it is also scaled by the user’s font size preference. - It is recommended you use this unit when specifying font sizes, so they will - be adjusted for both the screen density and user’s preference. - */ - const int pixelSize = qRound( qskDpToPixels( size ) ); QFont font( QStringLiteral( "Roboto" ), -1, weight );