From 8655885818137bc46fca80e4f662bbfb6975f83f Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 13 May 2015 13:35:38 +1000 Subject: Bug [#1703]. Fix bug when drawing text margins in buffered mode which would use default encoding instead of chosen encoding. --- win32/PlatWin.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'win32') diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 37724ced8..6ea35d388 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -634,11 +634,14 @@ void SurfaceGDI::Init(SurfaceID sid, WindowID) { void SurfaceGDI::InitPixMap(int width, int height, Surface *surface_, WindowID) { Release(); - hdc = ::CreateCompatibleDC(static_cast(surface_)->hdc); + SurfaceGDI *psurfOther = static_cast(surface_); + hdc = ::CreateCompatibleDC(psurfOther->hdc); hdcOwned = true; - bitmap = ::CreateCompatibleBitmap(static_cast(surface_)->hdc, width, height); + bitmap = ::CreateCompatibleBitmap(psurfOther->hdc, width, height); bitmapOld = static_cast(::SelectObject(hdc, bitmap)); ::SetTextAlign(reinterpret_cast(hdc), TA_BASELINE); + SetUnicodeMode(psurfOther->unicodeMode); + SetDBCSMode(psurfOther->codePage); } void SurfaceGDI::PenColour(ColourDesired fore) { @@ -1287,6 +1290,8 @@ void SurfaceD2D::InitPixMap(int width, int height, Surface *surface_, WindowID) pRenderTarget->BeginDraw(); ownRenderTarget = true; } + SetUnicodeMode(psurfOther->unicodeMode); + SetDBCSMode(psurfOther->codePage); } void SurfaceD2D::PenColour(ColourDesired fore) { -- cgit v1.2.3