summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/win/gdi/salfont.cxx3
-rw-r--r--vcl/win/gdi/winlayout.cxx15
2 files changed, 18 insertions, 0 deletions
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index 20bcce07d47e..9796ab928f3b 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -826,6 +826,9 @@ void ImplGetLogFontFromFontSelect( HDC hDC,
memcpy( &rLogFont.lfFaceName[0], aName.getStr(), nNameLen*sizeof(wchar_t) );
if( nNameLen < LF_FACESIZE )
rLogFont.lfFaceName[nNameLen] = '\0';
+ // keep it upright and create the font for sideway glyphs later.
+ rLogFont.lfEscapement = rLogFont.lfEscapement - 2700;
+ rLogFont.lfOrientation = rLogFont.lfEscapement;
}
}
}
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index d6b9cd4b57c4..409b0b447986 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -250,6 +250,7 @@ bool ExTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
HFONT hFont = static_cast<HFONT>(GetCurrentObject( hDC, OBJ_FONT ));
HFONT hAltFont = nullptr;
bool bUseAltFont = false;
+ bool bShift = false;
if (rLayout.getFontSelData().mbVertical)
{
LOGFONTW aLogFont;
@@ -260,8 +261,16 @@ bool ExTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
sizeof(aLogFont.lfFaceName)-sizeof(aLogFont.lfFaceName[0]));
hAltFont = CreateFontIndirectW(&aLogFont);
}
+ else
+ {
+ bShift = true;
+ aLogFont.lfEscapement += 2700;
+ aLogFont.lfOrientation = aLogFont.lfEscapement;
+ hAltFont = CreateFontIndirectW(&aLogFont);
+ }
}
+ UINT nTextAlign = GetTextAlign ( hDC );
int nStart = 0;
Point aPos(0, 0);
const GlyphItem* pGlyph;
@@ -273,7 +282,13 @@ bool ExTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
bUseAltFont = !bUseAltFont;
SelectFont(hDC, bUseAltFont ? hAltFont : hFont);
}
+ if (bShift && pGlyph->IsVertical())
+ SetTextAlign(hDC, TA_TOP|TA_LEFT);
+
ExtTextOutW(hDC, aPos.X(), aPos.Y(), ETO_GLYPH_INDEX, nullptr, LPCWSTR(&glyphWStr), 1, nullptr);
+
+ if (bShift && pGlyph->IsVertical())
+ SetTextAlign(hDC, nTextAlign);
}
if (hAltFont)
{