-
Notifications
You must be signed in to change notification settings - Fork 167
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
印刷ページ設定ダイアログのフォントが巨大化する問題を修正 #1682
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -160,14 +160,7 @@ BOOL CDlgPrintSetting::OnInitDialog( HWND hwndDlg, WPARAM wParam, LPARAM lParam | |||||||||
// ::SetTimer( GetHwnd(), IDT_PRINTSETTING, 500, NULL ); | ||||||||||
//UpdatePrintableLineAndColumn(); | ||||||||||
|
||||||||||
BOOL bRet = CDialog::OnInitDialog( GetHwnd(), wParam, lParam ); | ||||||||||
|
||||||||||
// ダイアログフォントの寸法を得ておく | ||||||||||
LOGFONT lf; | ||||||||||
::GetObject(GetDialogFont(), sizeof(LOGFONT), &lf); | ||||||||||
m_nFontHeight = lf.lfHeight; // フォントサイズ | ||||||||||
|
||||||||||
return bRet; | ||||||||||
return CDialog::OnInitDialog( GetHwnd(), wParam, lParam ); | ||||||||||
} | ||||||||||
|
||||||||||
BOOL CDlgPrintSetting::OnDestroy( void ) | ||||||||||
|
@@ -905,14 +898,17 @@ void CDlgPrintSetting::SetFontName( int idTxt, int idUse, LOGFONT& lf, int nPoin | |||||||||
CheckDlgButtonBool( GetHwnd(), idUse, bUseFont); | ||||||||||
::EnableWindow( GetItemHwnd( idUse ), bUseFont ); | ||||||||||
if (bUseFont) { | ||||||||||
LOGFONT lft; | ||||||||||
lft = lf; | ||||||||||
lft.lfHeight = m_nFontHeight; // フォントサイズをダイアログに合せる | ||||||||||
// サイズだけはダイアログフォントに合わせ | ||||||||||
// それ以外は引数lfで指定された設定を採用 | ||||||||||
LOGFONT lfCreate = lf; | ||||||||||
LOGFONT lfDialogFont = {}; | ||||||||||
::GetObject( GetDialogFont(), sizeof(LOGFONT), &lfDialogFont ); | ||||||||||
lfCreate.lfHeight = lfDialogFont.lfHeight; | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ここは lfHeightに負数を指定すると対象フォントに指定サイズがなくても近似するサイズを選択してくれる、という仕様があった気がします(正数だと該当サイズがなければ失敗だったような。 自信ないのでコメントのみです。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ここは #1421 反映前のこの箇所と同じやり方としました。 sakura/sakura_core/dlg/CDlgPrintSetting.cpp Lines 159 to 162 in cb41fc4
なお、
ということでした。 |
||||||||||
|
||||||||||
HFONT hFontOld = (HFONT)::SendMessage(GetItemHwnd( idTxt ), WM_GETFONT, 0, 0 ); | ||||||||||
|
||||||||||
// 論理フォントを作成 | ||||||||||
HFONT hFont = ::CreateFontIndirect( &lft ); | ||||||||||
HFONT hFont = ::CreateFontIndirect( &lfCreate ); | ||||||||||
if (hFont) { | ||||||||||
// フォントの設定 | ||||||||||
::SendMessage( GetItemHwnd( idTxt ), WM_SETFONT, (WPARAM)hFont, MAKELPARAM(FALSE, 0) ); | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この行もSetData()の前に移動した方が良さそうです。
👆ダイアログの表示位置を調整する処理なので、描画を行う前のほうが良いはずです。
PR趣旨とは関係なさそうなのでスルーでいいです。