Skip to content

Add xg_lfCellLogFont (LOGFONTW-based) cell font management with CellLogFont LOOKS support - #92

Merged
katahiromz merged 3 commits into
masterfrom
copilot/extend-font-management-logfont
Jul 1, 2026
Merged

Add xg_lfCellLogFont (LOGFONTW-based) cell font management with CellLogFont LOOKS support#92
katahiromz merged 3 commits into
masterfrom
copilot/extend-font-management-logfont

Conversation

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Extends cell font settings from a face-name-only string (xg_szCellFont) to a full LOGFONTW struct (xg_lfCellLogFont), enabling richer font properties (weight, charset, italic, etc.) to be persisted in LOOKS files. Backward compatibility with existing LOOKS files (CellFont-only) is fully preserved.

New global

  • LOGFONTW xg_lfCellLogFont declared in XG_Settings.hpp, defined/zeroed in GUI.cpp
  • Font size fields (lfHeight, lfWidth) are intentionally never updated from file or UI — they remain fixed (computed dynamically from cell size and xg_nCellCharPercents)

LOOKS file I/O

  • Export (XgExportLooks, DoExportLooks): writes both CellFont (face name string, as before) and CellLogFont (hex-encoded LOGFONTW via XgBinToHex)
  • Import (XgImportLooks, DoImportLooks): reads CellFont first for backward compat; if CellLogFont is also present, deserializes via XgHexToBin, restores all fields except size, and syncs xg_szCellFont from lfFaceName

Sync points

  • XgLoadSettings (registry): syncs xg_lfCellLogFont.lfFaceNamexg_szCellFont after load
  • OnOK (settings dialog apply): syncs xg_lfCellLogFont.lfFaceName ← dialog edt1
  • OnChange case 0 (ChooseFont dialog): captures full lf from ChooseFontW into xg_lfCellLogFont, preserving size fields

Copilot AI changed the title [WIP] Extend internal management of font settings to LOGFONTW Add xg_lfCellLogFont (LOGFONTW-based) cell font management with CellLogFont LOOKS support Jul 1, 2026
Copilot AI requested a review from katahiromz July 1, 2026 10:29

@katahiromz katahiromz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@copilot 盤の描画も xg_lfCellLogFont を反映するようにして。
レジストリにも xg_lfCellLogFontを保存・読み込みするようにして。
ただし、互換性・操作性を変えないで。

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@copilot 盤の描画も xg_lfCellLogFont を反映するようにして。
レジストリにも xg_lfCellLogFontを保存・読み込みするようにして。
ただし、互換性・操作�...

対応しました(コミット: Reflect xg_lfCellLogFont in board drawing and registry save/load)。

  • 盤の描画: XgCreateNormalFontxg_lfCellLogFont のプロパティ(ウェイト、イタリック、文字セット等)を反映するよう変更。サイズフィールドはセルサイズから動的計算したまま。xg_lfCellLogFont がゼロの場合は従来通りの既定値(FW_NORMAL、ANTIALIASED_QUALITY、SHIFTJIS_CHARSET)を使用。
  • レジストリ保存: XgSaveSettingsSetStruct を使い CellLogFont をバイナリ保存(サイズフィールドは除く)。
  • レジストリ読み込み: XgLoadSettingsQueryStruct を使い CellLogFont を読み込み。CellFont(文字列)は引き続き先に読み込まれ、フォント名として優先されるため後方互換性を維持。

Copilot AI requested a review from katahiromz July 1, 2026 10:39
@katahiromz
katahiromz marked this pull request as ready for review July 1, 2026 10:43
@katahiromz
katahiromz merged commit 6dc61a5 into master Jul 1, 2026
1 check passed
@katahiromz
katahiromz deleted the copilot/extend-font-management-logfont branch July 1, 2026 10:44
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.

2 participants