Skip to content

Commit

Permalink
Using plWinDPI for DPI checks
Browse files Browse the repository at this point in the history
  • Loading branch information
colincornaby committed Jun 11, 2023
1 parent 7ae5e3f commit 330a7c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Plasma/PubUtilLib/plPipeline/plTextFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ uint16_t *plTextFont::IInitFontTexture()
SetMapMode( hDC, MM_TEXT );
// Get the font data

int nHeight = -MulDiv( fSize, GetDeviceCaps(hDC, LOGPIXELSY), 72 );
int nHeight = -MulDiv( fSize, plWinDpi::Instance().GetDpi(), 72);

hFont = CreateFont( nHeight, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, VARIABLE_PITCH, fFace );
Expand All @@ -120,7 +120,7 @@ uint16_t *plTextFont::IInitFontTexture()
void* fontData = std::malloc( fontDataSize );
GetFontData(hDC, 0, 0, fontData, fontDataSize);
ftError = FT_New_Memory_Face(library, (FT_Byte *) fontData, fontDataSize, 0, &face);
FT_UInt freeTypeResolution = GetDeviceCaps(hDC, LOGPIXELSY);
FT_UInt freeTypeResolution = plWinDpi::Instance().GetDpi();

DeleteDC( hDC );
DeleteObject( hFont );
Expand Down

0 comments on commit 330a7c5

Please sign in to comment.