Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow non-Microsoft-API conform lfWeight values #115

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions repos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5079,7 +5079,7 @@ repositories:
- errors: 0
options: null
path: ./TB8.DSN
- errors: 1
- errors: 0
options: null
path: ./TB1.DSN
- errors: 0
Expand All @@ -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
Expand Down
8 changes: 6 additions & 2 deletions src/Win32/LOGFONTA.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,18 @@ 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));
}

// 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)
Expand Down
Loading