Browse Source

Fix for win32 memory font loading.

tags/2021-05-28
jules 12 years ago
parent
commit
d3b92ab447
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      modules/juce_graphics/native/juce_win32_Fonts.cpp

+ 5
- 4
modules/juce_graphics/native/juce_win32_Fonts.cpp View File

@@ -319,7 +319,7 @@ public:
ascent (1.0f), heightToPointsFactor (1.0f),
defaultGlyph (-1)
{
loadFont (name);
loadFont();
}
WindowsTypeface (const void* data, size_t dataSize)
@@ -335,7 +335,8 @@ public:
nullptr, &numInstalled);
MemoryInputStream m (data, dataSize, false);
loadFont (TTFNameExtractor::getTypefaceNameFromFile (m));
name = TTFNameExtractor::getTypefaceNameFromFile (m);
loadFont();
}
~WindowsTypeface()
@@ -494,7 +495,7 @@ private:
SortedSet<KerningPair> kerningPairs;
void loadFont (const String& faceName)
void loadFont()
{
SetMapperFlags (dc, 0);
SetMapMode (dc, MM_TEXT);
@@ -508,7 +509,7 @@ private:
lf.lfItalic = (BYTE) (style == "Italic" ? TRUE : FALSE);
lf.lfWeight = style == "Bold" ? FW_BOLD : FW_NORMAL;
lf.lfHeight = -256;
faceName.copyToUTF16 (lf.lfFaceName, sizeof (lf.lfFaceName));
name.copyToUTF16 (lf.lfFaceName, sizeof (lf.lfFaceName));
HFONT standardSizedFont = CreateFontIndirect (&lf);


Loading…
Cancel
Save