From 7cb1ec9e1ac0dbb120c93ac1f69b8d549d65bb07 Mon Sep 17 00:00:00 2001 From: Dominik Wernberger Date: Wed, 19 Jun 2024 22:08:53 +0200 Subject: [PATCH 1/2] Allow non-Microsoft-API conform lfWeight values --- repos.yaml | 6 +++--- src/Win32/LOGFONTA.hpp | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/repos.yaml b/repos.yaml index 736374f3..58d9e71d 100644 --- a/repos.yaml +++ b/repos.yaml @@ -5079,7 +5079,7 @@ repositories: - errors: 0 options: null path: ./TB8.DSN - - errors: 1 + - errors: 0 options: null path: ./TB1.DSN - errors: 0 @@ -5088,13 +5088,13 @@ repositories: - errors: 0 options: null path: ./TB5.DSN - - errors: 1 + - errors: 0 options: null path: ./TB2.DSN - errors: 1 options: null path: ./TB7.dsn - - errors: 3 + - errors: 2 options: null path: ./TB3.DSN - errors: 0 diff --git a/src/Win32/LOGFONTA.hpp b/src/Win32/LOGFONTA.hpp index 9210d168..b0d6296e 100644 --- a/src/Win32/LOGFONTA.hpp +++ b/src/Win32/LOGFONTA.hpp @@ -33,9 +33,11 @@ class tagLOGFONTA std::memcpy(this, buffer.data(), sizeof(*this)); + // Don't know how but lfWeight might have values + // out of it's 'valid' range if(lfWeight != std::clamp(lfWeight, 0, 1000)) { - throw std::runtime_error(fmt::format("0 <= lfWeight <= 1000 must hold but lfWeight = {}", lfWeight)); + // throw std::runtime_error(fmt::format("0 <= lfWeight <= 1000 must hold but lfWeight = {}", lfWeight)); } if(lfOutPrecision > 10U) From 2576ce8a8a844c5be9ddb700dad6b52ed84b3d0a Mon Sep 17 00:00:00 2001 From: Dominik Wernberger Date: Wed, 19 Jun 2024 22:53:49 +0200 Subject: [PATCH 2/2] Allow non MS-API conform lfOutPrecision --- src/Win32/LOGFONTA.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Win32/LOGFONTA.hpp b/src/Win32/LOGFONTA.hpp index b0d6296e..3a24bb06 100644 --- a/src/Win32/LOGFONTA.hpp +++ b/src/Win32/LOGFONTA.hpp @@ -40,9 +40,11 @@ class tagLOGFONTA // throw std::runtime_error(fmt::format("0 <= lfWeight <= 1000 must hold but lfWeight = {}", lfWeight)); } + // Don't know how but lfOutPrecision might have values + // out of it's 'valid' range if(lfOutPrecision > 10U) { - throw std::runtime_error(fmt::format("lfOutPrecision <= 10 must hold but lfOutPrecision = {}", lfOutPrecision)); + // throw std::runtime_error(fmt::format("lfOutPrecision <= 10 must hold but lfOutPrecision = {}", lfOutPrecision)); } if(lfQuality > 6U)