diff options
-rw-r--r-- | vcl/source/outdev/text.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 9568b3b50eb2..5112814a35ec 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -1332,14 +1332,16 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(const OUString& rOrigStr, if( !pSalLayout ) return nullptr; - if (flags & SalLayoutFlags::GlyphItemsOnly) - return pSalLayout; - // do glyph fallback if needed // #105768# avoid fallback for very small font sizes if (aLayoutArgs.NeedFallback() && mpFontInstance->GetFontSelectPattern().mnHeight >= 3) pSalLayout = ImplGlyphFallbackLayout(std::move(pSalLayout), aLayoutArgs); + if (flags & SalLayoutFlags::GlyphItemsOnly) + // Return glyph items only after fallback handling. Otherwise they may + // contain invalid glyph IDs. + return pSalLayout; + // position, justify, etc. the layout pSalLayout->AdjustLayout( aLayoutArgs ); pSalLayout->DrawBase() = ImplLogicToDevicePixel( rLogicalPos ); |