mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 14:53:52 +00:00
Handle preinstalled fonts case
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
#include "GpIOStream.h"
|
#include "GpIOStream.h"
|
||||||
#include "IGpFileSystem.h"
|
#include "IGpFileSystem.h"
|
||||||
#include "IGpFont.h"
|
#include "IGpFont.h"
|
||||||
|
#include "IGpSystemServices.h"
|
||||||
|
|
||||||
#include "MemReaderStream.h"
|
#include "MemReaderStream.h"
|
||||||
#include "PLBigEndian.h"
|
#include "PLBigEndian.h"
|
||||||
@@ -130,6 +131,8 @@ namespace PortabilityLayer
|
|||||||
|
|
||||||
void FontManagerImpl::GetFontPreset(FontPreset_t preset, FontFamilyID_t *outFamilyID, int *outSize, int *outVariationFlags, bool *outAA) const
|
void FontManagerImpl::GetFontPreset(FontPreset_t preset, FontFamilyID_t *outFamilyID, int *outSize, int *outVariationFlags, bool *outAA) const
|
||||||
{
|
{
|
||||||
|
const bool preinstalledFonts = PLDrivers::GetSystemServices()->IsUsingPreinstalledFonts();
|
||||||
|
|
||||||
if (outSize)
|
if (outSize)
|
||||||
*outSize = ms_fontPresets[preset].m_textSize;
|
*outSize = ms_fontPresets[preset].m_textSize;
|
||||||
|
|
||||||
@@ -137,14 +140,22 @@ namespace PortabilityLayer
|
|||||||
*outVariationFlags = ms_fontPresets[preset].m_variationFlags;
|
*outVariationFlags = ms_fontPresets[preset].m_variationFlags;
|
||||||
|
|
||||||
if (outAA)
|
if (outAA)
|
||||||
*outAA = ms_fontPresets[preset].m_aa;
|
{
|
||||||
|
bool aa = ms_fontPresets[preset].m_aa;
|
||||||
|
FontFamilyID_t fontFamily = ms_fontPresets[preset].m_familyID;
|
||||||
|
|
||||||
|
if (preinstalledFonts && (fontFamily == FontFamilyIDs::kApplication || fontFamily == FontFamilyIDs::kSystem))
|
||||||
|
*outAA = false;
|
||||||
|
else
|
||||||
|
*outAA = aa;
|
||||||
|
}
|
||||||
|
|
||||||
if (outFamilyID)
|
if (outFamilyID)
|
||||||
{
|
{
|
||||||
switch (ms_fontPresets[preset].m_familyID)
|
switch (ms_fontPresets[preset].m_familyID)
|
||||||
{
|
{
|
||||||
case FontFamilyIDs::kApplication:
|
case FontFamilyIDs::kApplication:
|
||||||
if (ms_fontPresets[preset].m_textSize < 11 && (ms_fontPresets[preset].m_variationFlags & FontFamilyFlag_Bold) != 0)
|
if (!preinstalledFonts && ms_fontPresets[preset].m_textSize < 11 && (ms_fontPresets[preset].m_variationFlags & FontFamilyFlag_Bold) != 0)
|
||||||
*outFamilyID = FontFamilyIDs::kSystem; // Use heavier font below 11pt
|
*outFamilyID = FontFamilyIDs::kSystem; // Use heavier font below 11pt
|
||||||
else
|
else
|
||||||
*outFamilyID = FontFamilyIDs::kApplication;
|
*outFamilyID = FontFamilyIDs::kApplication;
|
||||||
|
Reference in New Issue
Block a user