ServerFont: keep style if possible when setting face flags
The current style probably has the correct style flags portion. Getting a new style in that case is unnecessary, and problematic with some font families that have several fonts mapping to the same style flag (SemiBold, Bold and ExtraBold are all B_BOLD_FACE, for example): the chosen one might be different than the one already set. Fixes #17229 Change-Id: Ie8e73627cc0547df9d624a8fac07f521fc983d06 Reviewed-on: https://review.haiku-os.org/c/haiku/+/4416 Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
parent
69fdc6be3b
commit
910ebfc4f5
@ -311,6 +311,11 @@ ServerFont::SetFace(uint16 face)
|
||||
// FontStyle class takes care of mapping the font style name to the Be
|
||||
// API face flags in FontStyle::_TranslateStyleToFace().
|
||||
|
||||
if (fStyle->PreservedFace(face) == face) {
|
||||
fFace = face;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
BReference <FontStyle> style;
|
||||
uint16 familyID = FamilyID();
|
||||
if (gFontManager->Lock()) {
|
||||
|
Loading…
Reference in New Issue
Block a user