Fixup 23c5125148
It was asserting for me at startup on Windows. Change-Id: I81d7b0dd58fd912c5fc255c3a7fa0878e841737e Reviewed-on: https://gerrit.libreoffice.org/54160 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
This commit is contained in:
@@ -997,6 +997,7 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricDataRef& rxFontMetric, int nFa
|
|||||||
const RawFontData aHheaRawData(getHDC(), nHheaTag);
|
const RawFontData aHheaRawData(getHDC(), nHheaTag);
|
||||||
const RawFontData aOS2RawData(getHDC(), nOS2Tag);
|
const RawFontData aOS2RawData(getHDC(), nOS2Tag);
|
||||||
|
|
||||||
|
mpWinFontEntry[nFallbackLevel]->SetHDC(getHDC());
|
||||||
rxFontMetric->SetMinKashida(mpWinFontEntry[nFallbackLevel]->GetKashidaWidth());
|
rxFontMetric->SetMinKashida(mpWinFontEntry[nFallbackLevel]->GetKashidaWidth());
|
||||||
|
|
||||||
// get the font metric
|
// get the font metric
|
||||||
|
@@ -342,7 +342,7 @@ static hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pU
|
|||||||
hb_font_t* WinFontInstance::ImplInitHbFont()
|
hb_font_t* WinFontInstance::ImplInitHbFont()
|
||||||
{
|
{
|
||||||
assert(m_hDC);
|
assert(m_hDC);
|
||||||
m_hFont = static_cast<HFONT>(GetCurrentObject(m_hDC, OBJ_FONT));
|
assert(m_hFont);
|
||||||
hb_font_t* pHbFont = InitHbFont(hb_face_create_for_tables(getFontTable, m_hFont, nullptr));
|
hb_font_t* pHbFont = InitHbFont(hb_face_create_for_tables(getFontTable, m_hFont, nullptr));
|
||||||
|
|
||||||
// Calculate the AverageWidthFactor, see LogicalFontInstance::GetScale().
|
// Calculate the AverageWidthFactor, see LogicalFontInstance::GetScale().
|
||||||
@@ -378,6 +378,7 @@ void WinFontInstance::SetHDC(const HDC hDC)
|
|||||||
return;
|
return;
|
||||||
ReleaseHbFont();
|
ReleaseHbFont();
|
||||||
m_hDC = hDC;
|
m_hDC = hDC;
|
||||||
|
m_hFont = static_cast<HFONT>(GetCurrentObject(m_hDC, OBJ_FONT));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WinSalGraphics::CacheGlyphs(const GenericSalLayout& rLayout)
|
bool WinSalGraphics::CacheGlyphs(const GenericSalLayout& rLayout)
|
||||||
|
Reference in New Issue
Block a user