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

プロパティシートに対してシステムフォントを設定 #1425

Merged

Conversation

suconbu
Copy link
Member

@suconbu suconbu commented Oct 13, 2020

PR の目的

共通設定・タイプ別設定ダイアログのタブと下部にあるボタンについて、言語設定が英語の時のみ文字がギザギザしていて見栄えが悪いため、この部分に Windows のシステムフォントが使われるようにします。
#1421 (comment) で挙げていた問題点

共通設定ダイアログの例:

v2.4.2.0 変更後
image image

カテゴリ

  • 仕様変更

PR の背景

PR のメリット

PR のデメリット (トレードオフとかあれば)

特にないと思います。

仕様・動作説明

言語設定が英語の時のプロパティシート部のフォントが MS Shell Dlg (MS UI Gothic) から Windows のシステムフォント (Yu Gothic UI 等) に変わります。

テスト内容

  1. 共通設定->ウィンドウタブの「言語」で「English (United States)」を選択する。
  2. ダイアログを閉じ、タイプ別設定を開く。
  • 確認1: タブおよび下部のボタンの文字がシステムフォントに変わっていること。
  1. ダイアログを閉じ、共通設定を開く。
  • 確認2: タブおよび下部のボタンの文字がシステムフォントに変わっていること。

PR の影響範囲

  • タイプ別設定ダイアログ
  • 共通設定ダイアログ

MyPropertySheet関数を呼び出しているもの

関連 issue, PR

#1421

参考資料

@suconbu
Copy link
Member Author

suconbu commented Oct 13, 2020

今回のフォント変更が影響してか共通設定ダイアログの「Custom Menu」タブの位置が 1 段目から 2 段目へと移動してしていますが、これは日本語の時と同じ並びになるので問題ないかなと思っています。

Copy link
Contributor

@berryzplus berryzplus left a comment

Choose a reason for hiding this comment

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

コードは問題ないと思います。

表示確認を行う能力はないので、他の方にお任せします。

@@ -257,13 +257,19 @@ static LRESULT CALLBACK PropSheetWndProc( HWND hwnd, UINT uMsg, WPARAM wParam, L
*/
static int CALLBACK PropSheetProc( HWND hwndDlg, UINT uMsg, LPARAM lParam )
{
// プロパティシートの初期化時にボタン追加、プロパティシートのサブクラス化を行う
// プロパティシートの初期化時にシステムフォント設定、ボタン追加、プロパティシートのサブクラス化を行う
Copy link
Contributor

Choose a reason for hiding this comment

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

指摘じゃないですが、コメント変更は必要でしょうか?

ここでやってるのは「初期化時にカスタマイズする」ですが、
具体的な内容を追記していくと「内容が正確でない」だとか、
「ここでソレやるの?」とかの無駄な指摘の温床になるような気もします。

Copy link
Member Author

Choose a reason for hiding this comment

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

早速コメントありがとうございます。
個人的にはコード見てわかる内容はコメントにしてほしくない派ですが、すでにあるのものはメンテした方がいいかなとも思い、ちょっと迷いました。
では、ここのコメントは前のままとしておけばよいでしょうか。

Copy link
Contributor

Choose a reason for hiding this comment

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

指摘ではないのでどちらでもよいです。

Copy link
Member Author

Choose a reason for hiding this comment

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

了解しました。1b00f2d のままにしておきます。

@AppVeyorBot
Copy link

Build sakura 1.0.3158 completed (commit 1b00f2d177 by @suconbu)

@berryzplus
Copy link
Contributor

共通設定・タイプ別設定ダイアログのタブと下部にあるボタンについて、言語設定が英語の時のみ文字がギザギザしていて見栄えが悪いため、この部分に Windows のシステムフォントが使われるようにします。

フォントが変わったのは分かりますが、変更前がギザギザしているのが分からないです。
視力の問題だと思うので、ギザギザの判別ができる普通の人に解消確認してもらうべきと思います。

@beru
Copy link
Contributor

beru commented Oct 14, 2020

ギザギザっていうのは多分フォントのラスタライズでアンチエイリアスが掛かっていない事を指しているんだと思います。
元の表示は小さいサイズのドットフォントを引き延ばしたような表示ですね。

@beru
Copy link
Contributor

beru commented Oct 14, 2020

自分の環境でも変更前後でスクリーンショットを取りました。

変更前
image

変更後
image

変更後の方はフォントの見た目が統一されて良いですね。

@beru beru added the specification change ■仕様変更 label Oct 14, 2020
Copy link
Contributor

@beru beru left a comment

Choose a reason for hiding this comment

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

問題ないと思います。

@return ダイアログボックスに設定されたフォントハンドル(破棄禁止)
*/
HFONT UpdateDialogFont( HWND hwnd )
HFONT UpdateDialogFont( HWND hwnd, BOOL force )
Copy link
Contributor

Choose a reason for hiding this comment

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

BOOL force の代わりに bool unconditional とかいうのも書き方の候補として思い浮かびました。
前者の方がタイプ量が少ないですね。

Copy link
Member Author

Choose a reason for hiding this comment

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

ここの用途からするとunconditionalの方が合っていそうですね。
一方で否定形の論理型変数は分かりにくい時があるかもと思いました。

@suconbu suconbu merged commit 31653ea into sakura-editor:master Oct 15, 2020
@suconbu
Copy link
Member Author

suconbu commented Oct 15, 2020

レビューありがとうございました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
specification change ■仕様変更
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants