summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/win/gdi/winlayout.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index 134be9fcedeb..0881521874e7 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -497,7 +497,7 @@ bool WinFontInstance::AddChunkOfGlyphs(bool bRealGlyphIndices, int nGlyphIndex,
nBitmapHeight = bounds.GetHeight() + aChunk.getExtraSpace();
aChunk.maLocation.resize(nCount);
- UINT nPos = 0;
+ UINT nPos = aChunk.getExtraOffset();
for (int i = 0; i < nCount; i++)
{
// FIXME: really I don't get why 'vertical' makes any difference [!] what does it mean !?
@@ -528,14 +528,9 @@ bool WinFontInstance::AddChunkOfGlyphs(bool bRealGlyphIndices, int nGlyphIndex,
aDC.fill(MAKE_SALCOLOR(0xff, 0xff, 0xff));
int nY = aChunk.getExtraOffset();
- int nX = nY;
- if (aChunk.mbVertical)
- nX += aGlyphAdv[0];
- else
- nX -= bounds.Left();
+ int nX = aChunk.getExtraOffset();
- bounds.Move(-bounds.Left(), -bounds.Top());
- pTxt->BindDC(aDC.getCompatibleHDC(), bounds);
+ pTxt->BindDC(aDC.getCompatibleHDC(), Rectangle(0, 0, nBitmapWidth, nBitmapHeight));
auto pRT = pTxt->GetRenderTarget();
ID2D1SolidColorBrush* pBrush = nullptr;
@@ -545,7 +540,7 @@ bool WinFontInstance::AddChunkOfGlyphs(bool bRealGlyphIndices, int nGlyphIndex,
return false;
}
- D2D1_POINT_2F baseline = { 0.0f, bounds.Bottom() - nY };
+ D2D1_POINT_2F baseline = { nX, nY + aChunk.mnAscent - bounds.Top() };
DWRITE_GLYPH_RUN glyphs = {
pTxt->GetFontFace(),
pTxt->GetEmHeight(),
@@ -557,7 +552,6 @@ bool WinFontInstance::AddChunkOfGlyphs(bool bRealGlyphIndices, int nGlyphIndex,
0
};
-
pRT->BeginDraw();
pRT->DrawGlyphRun(baseline, &glyphs, pBrush);
HRESULT hr = pRT->EndDraw();