[LyX/master] Use proper (inset) font for normalizing purposes
Juergen Spitzmueller
spitz at lyx.org
Fri May 19 09:27:50 UTC 2023
commit 25ecd919fe66fd1eaee2a5113a309f8768001dd8
Author: Juergen Spitzmueller <spitz at lyx.org>
Date: Fri May 19 12:35:03 2023 +0200
Use proper (inset) font for normalizing purposes
Not all insets have a proper layout, but we have Inset::getFont()
Fixes #12729
---
src/Text.cpp | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/src/Text.cpp b/src/Text.cpp
index f7d8c1f..4fb7754 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -2479,7 +2479,11 @@ FontInfo Text::layoutFont(pit_type const pit) const
// In case the default family has been customized
if (layout.font.family() == INHERIT_FAMILY)
lf.setFamily(owner_->buffer().params().getFont().fontInfo().family());
- FontInfo icf = owner_->getLayout().font();
+ FontInfo icf = (!isMainText())
+ // inside insets, we call the getFont() method
+ ? owner_->getFont()
+ // outside, we access the layout font directly
+ : owner_->getLayout().font();
icf.realize(lf);
return icf;
}
More information about the lyx-cvs
mailing list