-
Notifications
You must be signed in to change notification settings - Fork 161
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
ヘルプの「Windows 10 でのファイル拡張子関連付け」「Grep」「Grep置換」の画像がやたら大きくて見づらい問題に対処 #1328
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
'
ではなく"
を使用すべきです。em
は要素に指定されたフォントの幅を基準にした単位なので、フォントを変えるとズレたりするのでめんどくさいです。文字サイズの変更に追随させたい特殊な状況を除いては、画像サイズにフォント幅を基準とする単位を利用すべきじゃないと思います。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.
HTMLの規格としては属性をシングルクォートで囲うのでも問題無いと思うんですけど、他の記述に合わせるとなるとダブルクォートで囲った方が良いかもしれないですね。
Chrome等のウェブブラウザで表示する場合はOSのディスプレイ設定の表示スケールのパーセントに応じて拡大して表示されます。ピクセルという絶対単位で指定しているのに本来はおかしな話ですが、そうでもしないと高DPI環境でウェブブラウザを使った時に色々なサイトで画像が小さく表示されてしまうのでそういう挙動にしているんだと思います。
ヘルプファイル(*.chm) のビューワーはウェブブラウザとは挙動が違っていて、OSのディスプレイ設定の表示スケールに関係なく画像が等倍サイズで表示されます。つまりピクセル単位で指定すると、表示環境のDPIによって画像のサイズが異なって表示される問題がそのまま残ります。つまり画像のサイズを指定していない現状と同じ問題が残ります。
じゃあどの単位を使うべきなのか?という疑問が浮かびますが、試しにパーセントで指定すると親要素に対する相対サイズで表示されます。ヘルプのウィンドウのサイズを変えるとそれに応じて画像のサイズが変わります。これはちょっと使っていて不思議な感じですね。自分はこの挙動は良くないと思うのでパーセントを単位に使うのは反対です。
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.
CSSで対応しないで画像を #1325 で @arigayas さんや @k-takata さんが作ってくれたものに差し替える対応でも良い気もしてきました。
高DPI環境で chm ファイルを表示すると(DPIが100%の環境でキャプチャした)画像が小さく表示されてしまう問題がありますが、それってhh.exe (HTMLヘルプ実行プログラム) の問題であって最近のウェブブラウザで表示すると拡大して表示されるのでそこまで気にはなりません。
Microsoftはもうレガシーな hh.exe を更新してくれない事を考えると、それにまともに向き合うのもなんか徒労に感じてきました。あと高DPI環境でHTMLヘルプを表示すると、ページ上の画像が小さく表示される問題以外にGUI部分のアイコンが小さく表示されてしまったりして微妙に使いづらいです。
その後調べてみたところ、img タグの srcset 属性を使う事でデバイスのDPIに合わせて別々の画像を読み込むように指定出来る事が分かりました。きっと最近のウェブサイトのコンテンツを作っている人達はこれを活用してるんだと思います。
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.
@k-takata さんが #1325 (comment) に添付してくれた画像を使うように変更しました。これでHTMLヘルプの「Windows 10 でのファイル拡張子関連付け」ページを表示した際に画像がやたら大きくて見づらい問題は解消されます。
あと img タグの srcset 属性も使用してみました。高DPI環境でChromeブラウザなどでそのページを表示したときには、元々使っていた画像が表示されます。解像度が大きい画像ですがブラウザ側で引き延ばされて表示はされないので見づらく無いです。高DPIではない環境、つまりディスプレイ設定の表示スケールが 100% の動作環境で表示すると、今回追加した100%でキャプチャした小さい画像が使われる為に見やすく表示されます。
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.
HLP000067.html
とHLP000362.html
にも同様の対処をした方が良いですね。最近のペースだと #1323 の問題への対処がすぐに完了するとは思えないので、こちらで表示スケール 100% のスクリーンショットを取って使う事にします。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.
css
で指定するpx
はcssピクセル
だから、表示環境のdpiに応じてサイズが変わるのはcssの仕様
と言ってます。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.
私が無知なのかもしれませんが、シングルクォートで囲むよりダブルクォートで囲む方が推奨されるというのは初めて聞きました。
https://dev.w3.org/html5/html-author/Overview.src.html
なお規格には下記のように書かれてました。
検索してもシングルクォートで囲む書き方が推奨されないという情報はまだ見つけることは出来てません。
なお自分はマークアップの専門家ではないです。またwebの技術には詳しくないです。
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.
cssピクセルっていう用語について知らなかったです。勉強になりました。
デバイスピクセル比で引き伸ばされて表示されるのも規格で規定されてそうですね。
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.
https://weblog.west-wind.com/posts/2012/feb/15/make-your-chm-help-files-show-html5-and-css3-content#Web-Browser-Control----perpetually-stuck-in-IE-7-Mode
によるとIE7モード固定の動作みたいです。レジストリ設定でIEのバージョン指定が出来るらしいですが、まぁ微妙ですね。
IE後継のEdgeもChromeに合わせてBlink使うようになったし、もう時代遅れのHTMLヘルプはやめてブラウザで見るように出来たら良いなぁ…。
実際にソレが原因なのか確認を取った上でのコメントではなくて推測の発言だと思うので残念です。
実際に高DPI環境で確認しないで想像上での意見であれば的を外しちゃいます。
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.
調べてみたところ、それっぽい事が書かれていました。
https://drafts.csswg.org/css-values-3/#reference-pixel
既存コンテンツとの兼ね合いを考えて、CSSピクセル単位を実デバイスのピクセルにはしない事に決めたようです。
https://hacks.mozilla.org/2013/09/css-length-explained/
上のURLはFirefox開発元のMozillaの人が書いた解説ですがそこでも同様の説明が有りました。
日本語のページだと下記のページで分かりやすく解説されてました。
https://d-fount.com/about-resolution/#outline_4_2
http://site.oukasei.com/?p=2332
https://www.atmarkit.co.jp/ait/articles/1308/29/news004.html
なおHTML5規格が出てからは img タグの srcset 属性等で対処が可能な事が分かったので、このPRではそれを使いました。高DPI環境でHTMLヘルプを表示すると画像の見え方がブラウザと違う件についての対処は諦めます。