FontSize

Top / Coding / Windows / HighDPI / FontSize
 

ページ構成
−Top
  • −Coding
    • +.NET
    • +CUDA
    • +JavaScript
    • +MSOffice
    • +PHP
    • +PowerShell
    • +Python
    • +Ruby
    • −VBA
      • −HighDPI
        • ・FontSize
      • ・シャットダウン・スリープ
      • ・モニタの電源を切る
    • +misc
    • +画像処理
  • +Server
  • +memo
  • +misc
  • +カメラ
  • +科学技術
  • +記事
  • +数値解析
最新の10件
2018-01-16 更新
  • misc/Hardware/各種プロセッサの倍精度演算性能
2017-11-27 更新
  • Coding/misc/raspberrypi
2017-11-02 更新
  • Coding/.NET/NuGetパッケージの作成
2017-10-19 更新
  • Coding/MSOffice/VSTO/ThisAddin_Startupに処理を書く問題が起きる
2017-06-16 更新
  • Coding/.NET/VisualStudioビルドイベント
2017-05-28 更新
  • misc/Hardware/タブレット向けCPU/複製
2017-05-25 更新
  • Coding/Python/CloudVision
2017-05-24 更新
  • misc/ロードバイク/サイクルロード/奈良
2017-05-11 更新
  • misc/ソフトウェア/文章/文章校正、作成支援ツール
2017-03-15 更新
  • misc/ソフトウェア/プロジェクト管理ツール

Powered By

b_pukiwiki.official.png

edit

関連ページ

  • Coding/Windows/HighDPI
  • Coding/Windows/HighDPI/FontSize
  • Coding/.NET/WPF
  • Coding/.NET/WPF/Component/AvalonEdit
  • Coding/.NET/WPF/HighDPI
  • Coding/.NET/WPF/MVVM
  • Coding/.NET/WPF/多言語対応
  • Coding/.NET/WPF/勉強メモ
  • Coding/.NET/WPF/勉強会/RoomMetro_22

目次

  • 概要
  • 推定される原因
  • 解決策
    • 次善策(対処療法)
    • 参考
  • 原因についての詳細
    • 最初に;スケーリングについて
      • 参考
    • 問題になる倍率がある
    • ちなみに、キリのいい倍率だと問題が顕在化しない
  • 参考
    • フォントサイズについて
      • 覚えておくこと
      • HighDPI環境下での実フォントサイズ[dot]
    • 参考資料

概要 †

HighDPI(スケーリング100%以上の)環境下で、フォントの表示がぼやける問題について

↑

推定される原因 †

プログラム内で、フォントサイズの指定が DPIの変化を考慮してない?

↑

解決策 †

pt -> dotの変換計算に手を加える
(端数を切る、存在しないフォントサイズになる場合切り上げ/切り下げるなど)

↑

次善策(対処療法) †

ユーザが、プロパティから
「高dpi設定では画面のスケーリングを無効にする」を有効にする。

↑

参考 †

  • Writing DPI-Aware Desktop and Win32 Applications (Windows)
  • http://msdn.microsoft.com/en-us/library/windows/desktop/dn469266(v=vs.85).aspx#scaling_text
    • Appendix : ScalingTextのところ参照
↑

原因についての詳細 †

↑

最初に;スケーリングについて †

  • Windows8.1 デフォルト(Per-Monitor DPI有効;「すべてのディスプレイで同じ拡大率を使用する」がOFF)
    • 環境に応じて 100,125,150,200%のうちいくつかを選べる。
    • (DPIでいうと96,120,144,192)
  • Windows8.1 (Per-Monitor DPI無効;「すべてのディスプレイで同じ拡大率を使用する」がON)
    • 100,125,150% あたり
    • カスタム設定で 〜500%まで段階的に変更可能
  • Windows8以前 ?
    • アプリケーションの画面のみスケーリング
    • カスタム設定で、1% 刻みでの指定も可能
↑

参考 †

  • Writing DPI-Aware Desktop and Win32 Applications (Windows)
    • http://msdn.microsoft.com/en-us/library/windows/desktop/dn469266(v=vs.85).aspx
    • Windows 8.1 Control Panel Overviewの項
Windows 8 behavior:
Not DPI– aware desktop applications are scaled according to the DPI of the primary monitor.
Users can change this system-wide scaling factor
by selecting a different radio button or entering a custom value.
Windows 8.1 behavior:
Not DPI– aware desktop applications are scaled according to the DPI of each monitor individually.
Users can further adjust by using the desktop scaling override.
If the user checks the Set one scaling level for all my displays checkbox,
the Windows 8 functionality is active and 
Control Panel displays the Windows 8 radio buttons for applying a system-wide scale factor.
In other words, per-monitor scaling is disabled.
If the user does not check the Set one scaling level for all my displays checkbox, 
the Windows 8.1 per-monitor scaling functionality is active, and 
Control Panel replaces the radio buttons with a Smaller/Larger slider control. 
This control sets a desktop scaling override. 
The slider can have several settings depending on the range of DPI plateaus in the current machine configuration.
If the user applies a new desktop scaling override value,
the scaling of each monitor is adjusted up or down accordingly,
if possible. If a monitor is already at the minimum (96 DPI = 100% scaling)
or maximum (192 DPI = 200% scaling) the override has no effect for that monitor.
If scaling up for a monitor would result in its virtual size being less than the minimum resolution of 1024x720,
the override has no effect. 
When the user applies a change to the Smaller/Larger slider control (via the Apply button) 
the rescaling takes effect immediately. 
This bitmap rescaling affects all applications. 
DPI–aware applications may have some content blurriness 
until the next sign-in when they re-read the DPI and render themselves accordingly.
↑

問題になる倍率がある †

例:フォントサイズを12dot , スケーリングが120%の場合

12 * 1.2 = 14.4 dot のサイズでフォントを描画してしまう。
(単純に12dot のフォントが1.2倍のスケーリング処理される。)

↑

ちなみに、キリのいい倍率だと問題が顕在化しない †

例:フォントサイズを12dot , スケーリングが150%の場合

12 * 1.5 = 18 dot のサイズでフォントを描画。

↑

参考 †

↑

フォントサイズについて †

↑

覚えておくこと †

  • 1 [pt] = 1 / 72 [論理inch]
  • 基準は 96DPI
↑

HighDPI環境下での実フォントサイズ[dot] †

  • フォントサイズ[pt] / 論理インチ変換定数 * 基準DPI * スケーリング倍率= 実フォントサイズ[dot]
    • 単位計算: [pt] / [l.inch/pt] * [dot / l.inch] * ([dot/l.inch] / [dot/l.inch]) = [dot]
    • 具体例:(12 / 72 ) * ( 96 / 96 ) * 96 = 16 dot
↑

参考資料 †

DPI と DIP (デバイス非依存ピクセル) (Windows)
http://msdn.microsoft.com/ja-jp/library/windows/desktop/ff684173(v=vs.85).aspx

フォントサイズをドットで指定する - It_lives_vainlyの日記
http://d.hatena.ne.jp/It_lives_vainly/20100331/1270002338

Windows 8.1 DPI Scaling Enhancements
https://blogs.windows.com/windows/b/extremewindows/archive/2013/07/15/windows-8-1-dpi-scaling-enhancements.aspx?Redirected=true

Writing DPI-Aware Desktop and Win32 Applications (Windows)
http://msdn.microsoft.com/en-us/library/windows/desktop/dn469266(v=vs.85).aspx


トップ   編集 凍結 差分 添付 複製 名前変更 リロード   新規 一覧 単語検索   ヘルプ   最終更新のRSS
Last-modified: 2014-02-04 (火) (2133d)
Site admin: D*isuke YAMAKAWA

PukiWiki 1.4.7 Copyright © 2001-2006 PukiWiki Developers Team. License is GPL.
Based on "PukiWiki" 1.3 by yu-ji. Powered by PHP 5.3.29. HTML convert time: 0.074 sec.