Skip to content

Fix font style selection ignoring user-selected weight/italic/underline#19

Merged
forloopcodes merged 4 commits intomainfrom
copilot/fix-technical-font-display
Feb 4, 2026
Merged

Fix font style selection ignoring user-selected weight/italic/underline#19
forloopcodes merged 4 commits intomainfrom
copilot/fix-technical-font-display

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 4, 2026

Font dialog selections were ignored during font creation. Selecting "TECHNICAL Regular" rendered as Bold because CreateFontW always used hardcoded FW_NORMAL instead of the user's chosen style.

Changes

  • AppState: Added fontWeight, fontItalic, fontUnderline fields to persist font attributes
  • FormatFont(): Extract and store lfWeight, lfItalic, lfUnderline from ChooseFontW result
  • ApplyFont(): Use stored attributes instead of hardcoded defaults when calling CreateFontW

Before/After

// Before: Ignored user selection
g_state.hFont = CreateFontW(height, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ...);

// After: Uses selected attributes
g_state.hFont = CreateFontW(height, 0, 0, 0, g_state.fontWeight, g_state.fontItalic, g_state.fontUnderline, FALSE, ...);

Affects all fonts with multiple weight/style variants, not just TECHNICAL.

Original prompt

This section details on the original issue you should resolve

<issue_title>legacy-notepad-x64 will not load up regular TECHNICAL font</issue_title>
<issue_description>Image

  • setting to regular TECHNICAL font sets BOLD instead
  • would like regular TECHNICAL font to display REGULAR
    </issue_description>

Comments on the Issue (you are @copilot in this section)

@forloopcodes lemme see

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits February 4, 2026 04:32
- Store font weight, italic, and underline attributes in AppState
- Update FormatFont() to preserve font style from ChooseFontW dialog
- Update ApplyFont() to use stored attributes instead of hardcoded FW_NORMAL
- This ensures selected font style (Regular, Bold, Italic) is properly applied

Co-authored-by: ForLoopCodes <89027512+ForLoopCodes@users.noreply.github.com>
Co-authored-by: ForLoopCodes <89027512+ForLoopCodes@users.noreply.github.com>
Co-authored-by: ForLoopCodes <89027512+ForLoopCodes@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix loading of regular TECHNICAL font in legacy notepad x64 Fix font style selection ignoring user-selected weight/italic/underline Feb 4, 2026
Copilot AI requested a review from forloopcodes February 4, 2026 04:35
@forloopcodes forloopcodes merged commit cf52809 into main Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

legacy-notepad-x64 will not load up regular TECHNICAL font

2 participants