Skip to content
Closed
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
16e1cf3
refactor(WeaselUI): reuse codes for alignment, mark metrics, pager me…
fxliang Feb 5, 2026
2d03032
perf(WeaselUI): Optimized the performance of DirectWriteResources
fxliang Feb 6, 2026
2901162
perf(WeaselUI): GdiplusBlur with openmp
fxliang Feb 6, 2026
2093703
refactor(WeaselUI): use smart prt
fxliang Feb 7, 2026
5835b18
perf(WeaselUI): reuse Gdiplus::Graphics
fxliang Feb 7, 2026
2ec0498
perf(WeaselUI): cache DPI_SCALE style params
fxliang Feb 7, 2026
0206aac
fix(WeaselUI): fix clipboard issue
fxliang Feb 7, 2026
f79bfbb
perf(WeaselUI): _WeaselPanel::_DrawCandidates
fxliang Feb 8, 2026
4354753
refactor(WeaselUI): simplify WeaselPanel::DoPaint
fxliang Feb 8, 2026
8edd379
refactor(WeaselUI): add _UpdateWindowVisibility for Refresh
fxliang Feb 8, 2026
822a794
refactor(WeaselUI): return if not need to update, in WeaselPanel::_In…
fxliang Feb 8, 2026
1a7a91d
refactor(WeaselUI): DirectWriteResources::SetBrushColor with init, We…
fxliang Feb 8, 2026
805f1c4
fix(WeaselUI): memory leak risk in WeaselPanel::_HighlightText
fxliang Feb 8, 2026
f45dec9
refactor(WeaselUI): avoid direct2d and directwrite factory rebuild
fxliang Feb 9, 2026
75b205a
refactor(WeaselUI): DirectWriteResources owned by UI
fxliang Feb 9, 2026
1918449
refactor(WeaselUI): alias UICallback, and rename for styling
fxliang Feb 9, 2026
fabcdee
refactor(WeaselUI): refactor layouts implements, DirectWriteResources…
fxliang Feb 9, 2026
d443e0f
perf(WeaselUI): fast return when no need to relayout and redraw
fxliang Feb 9, 2026
cc151ee
perf(WeaselUI): reduce hMonitor getting in _RepositionWindow
fxliang Feb 9, 2026
0dd4172
fix(WeaselUI): hover is triggered when mouse not moved
fxliang Feb 9, 2026
45e9db0
fix(WeaselUI): mark metrics of fullscreenlayout
fxliang Feb 11, 2026
827a492
fix cacheStyle.spacing
fxliang Feb 12, 2026
daecc1b
chore: fix WeaselPanel.cpp bomb issue
fxliang Feb 12, 2026
aef28b7
refactor(WeaselUI): clear text format cache when style/dpi changed
fxliang Feb 12, 2026
d1fa2c9
fix: antialias_mode can't be update at runtime
fxliang Feb 12, 2026
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
167 changes: 90 additions & 77 deletions WeaselUI/DirectWriteResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,31 @@
#include <WeaselUI.h>

using namespace weasel;
#define STYLEORWEIGHT (L":[^:]*[^a-f0-9:]+[^:]*")

vector<wstring> ws_split(const wstring& in, const wstring& delim) {
static vector<wstring> ws_split(const wstring& in, const wstring& delim) {
// Optimization for simple character delimiters to avoid regex overhead
if (delim.find_first_of(L"\\^$.|?*+()[]{}") == wstring::npos &&
delim.length() > 0) {
Comment thread
fxliang marked this conversation as resolved.
vector<wstring> result;
size_t start = 0;
size_t end = in.find(delim);
while (end != wstring::npos) {
result.push_back(in.substr(start, end - start));
start = end + delim.length();
end = in.find(delim, start);
}
result.push_back(in.substr(start));
return result;
}
std::wregex re{delim};
return vector<wstring>{
std::wsregex_token_iterator(in.begin(), in.end(), re, -1),
std::wsregex_token_iterator()};
}

DirectWriteResources::DirectWriteResources(weasel::UIStyle& style,
UINT dpi = 96)
: _style(style),
dpiScaleFontPoint(0),
dpiScaleLayout(0),
DirectWriteResources::DirectWriteResources()
: dpiScaleFontPoint(1.0f),
dpiScaleLayout(1.0f),
pD2d1Factory(NULL),
pDWFactory(NULL),
pRenderTarget(NULL),
Expand All @@ -28,84 +39,96 @@ DirectWriteResources::DirectWriteResources(weasel::UIStyle& style,
pTextFormat(NULL),
pLabelTextFormat(NULL),
pCommentTextFormat(NULL) {
D2D1_TEXT_ANTIALIAS_MODE mode =
_style.antialias_mode <= 3
? (D2D1_TEXT_ANTIALIAS_MODE)(_style.antialias_mode)
: D2D1_TEXT_ANTIALIAS_MODE_FORCE_DWORD; // prepare d2d1 resources
// create factory
// prepare d2d1 resources create factory
HR(::D2D1CreateFactory(D2D1_FACTORY_TYPE_MULTI_THREADED,
pD2d1Factory.ReleaseAndGetAddressOf()));
// create IDWriteFactory
HR(DWriteCreateFactory(
DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory),
reinterpret_cast<IUnknown**>(pDWFactory.ReleaseAndGetAddressOf())));
/* ID2D1HwndRenderTarget */
const D2D1_PIXEL_FORMAT format = D2D1::PixelFormat(
}

DirectWriteResources::~DirectWriteResources() {
_textFormatCache.clear();
}

HRESULT DirectWriteResources::EnsureRenderTarget(int antialiasMode) {
if (pRenderTarget)
return S_OK;

static const D2D1_PIXEL_FORMAT format = D2D1::PixelFormat(
DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED);
const D2D1_RENDER_TARGET_PROPERTIES properties =
static const D2D1_RENDER_TARGET_PROPERTIES properties =
D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_DEFAULT, format);
HR(pD2d1Factory->CreateDCRenderTarget(&properties, &pRenderTarget));
pRenderTarget->SetTextAntialiasMode(mode);
pRenderTarget->SetTextAntialiasMode((D2D1_TEXT_ANTIALIAS_MODE)antialiasMode);
pRenderTarget->SetAntialiasMode(D2D1_ANTIALIAS_MODE_PER_PRIMITIVE);
HR(pRenderTarget->CreateSolidColorBrush(D2D1::ColorF(1.0f, 1.0f, 1.0f, 1.0f),
pBrush.ReleaseAndGetAddressOf()));
Comment thread
fxliang marked this conversation as resolved.
// get the dpi information
dpiScaleFontPoint = dpiScaleLayout = (float)dpi;
dpiScaleFontPoint /= 72.0f;
dpiScaleLayout /= 96.0f;

InitResources(style, dpi);
return S_OK;
}

DirectWriteResources::~DirectWriteResources() {}
void DirectWriteResources::ResetRenderTarget() {
pRenderTarget.Reset();
pBrush.Reset();
}

HRESULT DirectWriteResources::InitResources(const wstring& label_font_face,
HRESULT DirectWriteResources::InitResources(const UIStyle& style,
const int& label_font_point,
const wstring& font_face,
const int& font_point,
const wstring& comment_font_face,
const int& comment_font_point,
const bool& vertical_text) {
const int& comment_font_point) {
// prepare d2d1 resources
DWRITE_WORD_WRAPPING wrapping =
((_style.max_width == 0 &&
_style.layout_type != UIStyle::LAYOUT_VERTICAL_TEXT) ||
(_style.max_height == 0 &&
_style.layout_type == UIStyle::LAYOUT_VERTICAL_TEXT))
const bool vertical_text = style.layout_type == UIStyle::LAYOUT_VERTICAL_TEXT;
const DWRITE_WORD_WRAPPING wrapping =
((style.max_width == 0 &&
style.layout_type != UIStyle::LAYOUT_VERTICAL_TEXT) ||
(style.max_height == 0 &&
style.layout_type == UIStyle::LAYOUT_VERTICAL_TEXT))
? DWRITE_WORD_WRAPPING_NO_WRAP
: DWRITE_WORD_WRAPPING_WHOLE_WORD;
DWRITE_WORD_WRAPPING wrapping_preedit =
((_style.max_width == 0 &&
_style.layout_type != UIStyle::LAYOUT_VERTICAL_TEXT) ||
(_style.max_height == 0 &&
_style.layout_type == UIStyle::LAYOUT_VERTICAL_TEXT))
const DWRITE_WORD_WRAPPING wrapping_preedit =
((style.max_width == 0 &&
style.layout_type != UIStyle::LAYOUT_VERTICAL_TEXT) ||
(style.max_height == 0 &&
style.layout_type == UIStyle::LAYOUT_VERTICAL_TEXT))
? DWRITE_WORD_WRAPPING_NO_WRAP
: DWRITE_WORD_WRAPPING_CHARACTER;
DWRITE_FLOW_DIRECTION flow = _style.vertical_text_left_to_right
? DWRITE_FLOW_DIRECTION_LEFT_TO_RIGHT
: DWRITE_FLOW_DIRECTION_RIGHT_TO_LEFT;
const DWRITE_FLOW_DIRECTION flow = style.vertical_text_left_to_right
? DWRITE_FLOW_DIRECTION_LEFT_TO_RIGHT
: DWRITE_FLOW_DIRECTION_RIGHT_TO_LEFT;

// set main font a invalid font name, to make every font range customizable
const wstring _mainFontFace = L"_InvalidFontName_";
static const wstring _mainFontFace = L"_InvalidFontName_";
DWRITE_FONT_WEIGHT fontWeight = DWRITE_FONT_WEIGHT_NORMAL;
DWRITE_FONT_STYLE fontStyle = DWRITE_FONT_STYLE_NORMAL;
// convert percentage to float
float linespacing = dpiScaleFontPoint * ((float)_style.linespacing / 100.0f);
float baseline = dpiScaleFontPoint * ((float)_style.baseline / 100.0f);
if (_style.layout_type == UIStyle::LAYOUT_VERTICAL_TEXT)
float linespacing = dpiScaleFontPoint * ((float)style.linespacing / 100.0f);
float baseline = dpiScaleFontPoint * ((float)style.baseline / 100.0f);
if (style.layout_type == UIStyle::LAYOUT_VERTICAL_TEXT)
baseline = linespacing / 2;

auto init_font = [&](const wstring& fontface, int fontpoint,
ComPtr<IDWriteTextFormat1>& _pTextFormat,
DWRITE_WORD_WRAPPING wrap) {
const wstring key = fontface + L"|" + std::to_wstring(fontpoint) + L"|" +
(vertical_text ? L"1" : L"0") + L"|" +
std::to_wstring((int)wrap) + L"|" +
std::to_wstring(style.linespacing) + L"|" +
std::to_wstring(style.baseline) + L"|" +
std::to_wstring(dpiScaleFontPoint);
Comment on lines +118 to +123
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cache key construction concatenates floating-point values (dpiScaleFontPoint) into a string. This can lead to precision issues where slightly different floating-point values produce different string representations but represent the same logical DPI scale. Consider rounding the dpiScaleFontPoint to a fixed precision or using integer representation (e.g., multiplying by 1000 and converting to int) before converting to string to avoid cache misses due to floating-point precision differences.

Suggested change
const wstring key = fontface + L"|" + std::to_wstring(fontpoint) + L"|" +
(vertical_text ? L"1" : L"0") + L"|" +
std::to_wstring((int)wrap) + L"|" +
std::to_wstring(style.linespacing) + L"|" +
std::to_wstring(style.baseline) + L"|" +
std::to_wstring(dpiScaleFontPoint);
// Use a quantized integer representation of dpiScaleFontPoint in the cache key
const int dpiScaleKey = static_cast<int>(dpiScaleFontPoint * 1000.0f + 0.5f);
const wstring key = fontface + L"|" + std::to_wstring(fontpoint) + L"|" +
(vertical_text ? L"1" : L"0") + L"|" +
std::to_wstring((int)wrap) + L"|" +
std::to_wstring(style.linespacing) + L"|" +
std::to_wstring(style.baseline) + L"|" +
std::to_wstring(dpiScaleKey);

Copilot uses AI. Check for mistakes.
if (_textFormatCache.find(key) != _textFormatCache.end()) {
_pTextFormat = _textFormatCache[key];
return;
}
vector<wstring> fontFaceStrVector;
// text font text format set up
fontFaceStrVector = ws_split(fontface, L",");
// setup weight and style by the first unit of fontface setting string
_ParseFontFace(fontface, fontWeight, fontStyle);
static const std::wregex styleOrWeightRegex(L":[^:]*[^a-f0-9:]+[^:]*",
std::wregex::icase);
fontFaceStrVector[0] =
std::regex_replace(fontFaceStrVector[0],
std::wregex(STYLEORWEIGHT, std::wregex::icase), L"");
std::regex_replace(fontFaceStrVector[0], styleOrWeightRegex, L"");
// create text format with invalid font point will 'FAILED', no HR
pDWFactory->CreateTextFormat(_mainFontFace.c_str(), NULL, fontWeight,
fontStyle, DWRITE_FONT_STRETCH_NORMAL,
Expand All @@ -123,48 +146,38 @@ HRESULT DirectWriteResources::InitResources(const wstring& label_font_face,

HR(_pTextFormat->SetParagraphAlignment(
DWRITE_PARAGRAPH_ALIGNMENT_CENTER));
HR(_pTextFormat->SetWordWrapping(wrapping));
HR(_pTextFormat->SetWordWrapping(wrap));
_SetFontFallback(_pTextFormat, fontFaceStrVector);
if (_style.linespacing && _style.baseline)
if (style.linespacing && style.baseline)
_pTextFormat->SetLineSpacing(DWRITE_LINE_SPACING_METHOD_UNIFORM,
fontpoint * linespacing,
fontpoint * baseline);
_textFormatCache[key] = _pTextFormat;
}
Comment thread
fxliang marked this conversation as resolved.
Comment on lines 138 to 161
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the lambda init_font, if CreateTextFormat or subsequent operations fail, _pTextFormat may remain NULL but the function continues execution. The cache insertion at line 160 would then cache a NULL ComPtr, which could cause issues on subsequent accesses. Consider checking if _pTextFormat is valid before caching it, or return an error status from the lambda to handle failures properly.

Copilot uses AI. Check for mistakes.
decltype(fontFaceStrVector)().swap(fontFaceStrVector);
};
init_font(font_face, font_point, pTextFormat, wrapping);
init_font(font_face, font_point, pPreeditTextFormat, wrapping_preedit);
init_font(label_font_face, label_font_point, pLabelTextFormat, wrapping);
init_font(comment_font_face, comment_font_point, pCommentTextFormat,
init_font(style.font_face, font_point, pTextFormat, wrapping);
init_font(style.font_face, font_point, pPreeditTextFormat, wrapping_preedit);
init_font(style.label_font_face, label_font_point, pLabelTextFormat,
wrapping);
init_font(style.comment_font_face, comment_font_point, pCommentTextFormat,
wrapping);
return S_OK;
}

HRESULT DirectWriteResources::InitResources(const UIStyle& style,
const UINT& dpi = 96) {
_style = style;
if (dpi) {
dpiScaleFontPoint = dpi / 72.0f;
dpiScaleLayout = dpi / 96.0f;
}
return InitResources(style.label_font_face, style.label_font_point,
style.font_face, style.font_point,
style.comment_font_face, style.comment_font_point,
style.layout_type == UIStyle::LAYOUT_VERTICAL_TEXT);
}

void weasel::DirectWriteResources::SetDpi(const UINT& dpi) {
dpiScaleFontPoint = dpi / 72.0f;
dpiScaleLayout = dpi / 96.0f;

InitResources(_style);
return InitResources(style, style.label_font_point, style.font_point,
style.comment_font_point);
}

static wstring _MatchWordsOutLowerCaseTrim1st(const wstring& wstr,
const wstring& pat) {
const std::wregex& pattern) {
wstring mat = L"";
std::wsmatch mc;
std::wregex pattern(pat, std::wregex::icase);
wstring::const_iterator iter = wstr.cbegin();
wstring::const_iterator end = wstr.cend();
while (regex_search(iter, end, mc, pattern)) {
Expand All @@ -183,11 +196,12 @@ static wstring _MatchWordsOutLowerCaseTrim1st(const wstring& wstr,
void DirectWriteResources::_ParseFontFace(const wstring& fontFaceStr,
DWRITE_FONT_WEIGHT& fontWeight,
DWRITE_FONT_STYLE& fontStyle) {
const wstring patWeight(
static const std::wregex patWeight(
L"(:thin|:extra_light|:ultra_light|:light|:semi_light|:medium|:demi_bold|"
L":semi_bold|:bold|:extra_bold|:ultra_bold|:black|:heavy|:extra_black|:"
L"ultra_black)");
const std::map<wstring, DWRITE_FONT_WEIGHT> _mapWeight = {
L"ultra_black)",
std::wregex::icase);
static const std::map<wstring, DWRITE_FONT_WEIGHT> _mapWeight = {
{L"thin", DWRITE_FONT_WEIGHT_THIN},
{L"extra_light", DWRITE_FONT_WEIGHT_EXTRA_LIGHT},
{L"ultra_light", DWRITE_FONT_WEIGHT_ULTRA_LIGHT},
Expand All @@ -204,18 +218,19 @@ void DirectWriteResources::_ParseFontFace(const wstring& fontFaceStr,
{L"extra_black", DWRITE_FONT_WEIGHT_EXTRA_BLACK},
{L"normal", DWRITE_FONT_WEIGHT_NORMAL},
{L"ultra_black", DWRITE_FONT_WEIGHT_ULTRA_BLACK}};
wstring weight = _MatchWordsOutLowerCaseTrim1st(fontFaceStr, patWeight);
const wstring weight = _MatchWordsOutLowerCaseTrim1st(fontFaceStr, patWeight);
auto it = _mapWeight.find(weight);
fontWeight =
(it != _mapWeight.end()) ? it->second : DWRITE_FONT_WEIGHT_NORMAL;

const wstring patStyle(L"(:italic|:oblique|:normal)");
const std::map<wstring, DWRITE_FONT_STYLE> _mapStyle = {
static const std::wregex patStyle(L"(:italic|:oblique|:normal)",
std::wregex::icase);
static const std::map<wstring, DWRITE_FONT_STYLE> _mapStyle = {
{L"italic", DWRITE_FONT_STYLE_ITALIC},
{L"oblique", DWRITE_FONT_STYLE_OBLIQUE},
{L"normal", DWRITE_FONT_STYLE_NORMAL},
};
wstring style = _MatchWordsOutLowerCaseTrim1st(fontFaceStr, patStyle);
const wstring style = _MatchWordsOutLowerCaseTrim1st(fontFaceStr, patStyle);
Comment on lines 133 to +238
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The static regex patterns (styleOrWeightRegex, patWeight, patStyle) are compiled once and reused, which is good for performance. However, in multi-threaded scenarios, regex operations might have thread-safety concerns depending on the standard library implementation. Since DirectWriteResources can be accessed from UI code which might be called from different contexts, verify that the regex usage here is thread-safe or add appropriate synchronization if needed.

Copilot uses AI. Check for mistakes.
auto it2 = _mapStyle.find(style);
fontStyle = (it2 != _mapStyle.end()) ? it2->second : DWRITE_FONT_STYLE_NORMAL;
}
Expand Down Expand Up @@ -267,12 +282,10 @@ void DirectWriteResources::_SetFontFallback(
DWRITE_UNICODE_RANGE range = {first, last};
const WCHAR* familys = {_fontFaceWstr.c_str()};
HR(pFontFallbackBuilder->AddMapping(&range, 1, &familys, 1));
decltype(fallbackFontsVector)().swap(fallbackFontsVector);
}
// add system defalt font fallback
HR(pFontFallbackBuilder->AddMappings(pSysFallback.Get()));
HR(pFontFallbackBuilder->CreateFontFallback(
pFontFallback.ReleaseAndGetAddressOf()));
HR(textFormat->SetFontFallback(pFontFallback.Get()));
decltype(fallbackFontsVector)().swap(fallbackFontsVector);
}
58 changes: 17 additions & 41 deletions WeaselUI/FullScreenLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using namespace weasel;

void weasel::FullScreenLayout::DoLayout(CDCHandle dc, PDWR pDWR) {
void weasel::FullScreenLayout::DoLayout(CDCHandle dc) {
if (_context.empty()) {
int width = 0, height = 0;
UpdateStatusIconLayout(&width, &height);
Expand All @@ -23,31 +23,12 @@ void weasel::FullScreenLayout::DoLayout(CDCHandle dc, PDWR pDWR) {

int step = 32;
do {
m_layout->DoLayout(dc, pDWR);
if ((_style.hilited_mark_color & 0xff000000)) {
CSize sg;
if (candidates_count) {
if (_style.mark_text.empty())
GetTextSizeDW(L"|", 1, pDWR->pTextFormat, pDWR, &sg);
else
GetTextSizeDW(_style.mark_text, _style.mark_text.length(),
pDWR->pTextFormat, pDWR, &sg);
}
mark_width = sg.cx;
mark_height = sg.cy;
if (_style.mark_text.empty()) {
mark_width = mark_height / 7;
if (_style.linespacing && _style.baseline)
mark_width =
(int)((float)mark_width / ((float)_style.linespacing / 100.0f));
mark_width = max(mark_width, 6);
}
mark_gap = (_style.mark_text.empty())
? mark_width
: mark_width + _style.hilite_spacing;
}
} while (AdjustFontPoint(dc, workArea, step, pDWR));
m_layout->DoLayout(dc);
} while (AdjustFontPoint(dc, workArea, step));

mark_height = m_layout->mark_height;
mark_width = m_layout->mark_width;
mark_gap = m_layout->mark_gap;
int offsetx = (workArea.Width() - m_layout->GetContentSize().cx) / 2;
int offsety = (workArea.Height() - m_layout->GetContentSize().cy) / 2;
_preeditRect = m_layout->GetPreeditRect();
Expand Down Expand Up @@ -86,28 +67,27 @@ void weasel::FullScreenLayout::DoLayout(CDCHandle dc, PDWR pDWR) {

bool FullScreenLayout::AdjustFontPoint(CDCHandle dc,
const CRect& workArea,
int& step,
PDWR pDWR) {
int& step) {
if (_context.empty() || step == 0)
return false;
{
int fontPointLabel;
int fontPoint;
int fontPointComment;

if (pDWR->pLabelTextFormat != NULL)
fontPointLabel = (int)(pDWR->pLabelTextFormat->GetFontSize() /
pDWR->dpiScaleFontPoint);
if (pDWR_->pLabelTextFormat != NULL)
fontPointLabel = (int)(pDWR_->pLabelTextFormat->GetFontSize() /
pDWR_->dpiScaleFontPoint);
else
fontPointLabel = 0;
if (pDWR->pTextFormat != NULL)
if (pDWR_->pTextFormat != NULL)
fontPoint =
(int)(pDWR->pTextFormat->GetFontSize() / pDWR->dpiScaleFontPoint);
(int)(pDWR_->pTextFormat->GetFontSize() / pDWR_->dpiScaleFontPoint);
else
fontPoint = 0;
if (pDWR->pCommentTextFormat != NULL)
fontPointComment = (int)(pDWR->pCommentTextFormat->GetFontSize() /
pDWR->dpiScaleFontPoint);
if (pDWR_->pCommentTextFormat != NULL)
fontPointComment = (int)(pDWR_->pCommentTextFormat->GetFontSize() /
pDWR_->dpiScaleFontPoint);
else
fontPointComment = 0;
CSize sz = m_layout->GetContentSize();
Expand All @@ -119,9 +99,7 @@ bool FullScreenLayout::AdjustFontPoint(CDCHandle dc,
fontPoint += step;
fontPointLabel += step;
fontPointComment += step;
pDWR->InitResources(_style.label_font_face, fontPointLabel,
_style.font_face, fontPoint, _style.comment_font_face,
fontPointComment);
pDWR_->InitResources(_style, fontPointLabel, fontPoint, fontPointComment);
return true;
} else if (sz.cx <= (workArea.Width() - offsetX * 2) * 31 / 32 &&
sz.cy <= (workArea.Height() - offsetY * 2) * 31 / 32) {
Expand All @@ -131,9 +109,7 @@ bool FullScreenLayout::AdjustFontPoint(CDCHandle dc,
fontPoint += step;
fontPointLabel += step;
fontPointComment += step;
pDWR->InitResources(_style.label_font_face, fontPointLabel,
_style.font_face, fontPoint, _style.comment_font_face,
fontPointComment);
pDWR_->InitResources(_style, fontPointLabel, fontPoint, fontPointComment);
return true;
}

Expand Down
Loading