<table><tr><td style="">ahmadsamir created this revision.<br />ahmadsamir added reviewers: Frameworks, dfaure, cfeck, bport.<br />Herald added a project: Frameworks.<br />ahmadsamir requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D28974">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>styleIdentifier() tries to get the correct font style based on weight,<br />
style, and stretch; this "styleID" could be the same for different font<br />
styles in the same family, and it worked in most cases because "Regular"-like<br />
styles usually are ordered first in the family styles list from QFontDatabase.<br />
However this breaks for font families that provide many font styles, e.g.<br />
Noto Sans, where "SemiCondensed" comes first in the list.</p>

<p>Make it more precise by adding the font "styleName" property to the<br />
"styleID" we concatenate, this makes it more precise. Also handle empty<br />
styleName font prop. (we strip it on purpose, see KConfigGroupGui::writeEntryGui()<br />
for more details), try to pick the correct one so that we highlight<br />
it in the font style list view.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>kfontchooserdialogtest app, with the initial font set to "Noto Sans",<br />
before this change it'd select "SemiCondensed"; now it selects "Regular"<br />
as expected.</p>

<p>BUG: 420287<br />
FIXED-IN: 5.70</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R236 KWidgetsAddons</div></div></div><br /><div><strong>BRANCH</strong><div><div>l-tightenStyleId (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D28974">https://phabricator.kde.org/D28974</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/kfontchooser.cpp<br />
tests/kfontchooserdialogtest.cpp</div></div></div><br /><div><strong>To: </strong>ahmadsamir, Frameworks, dfaure, cfeck, bport<br /><strong>Cc: </strong>ndavis, kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns<br /></div>