1. ホーム
  2. css

[解決済み】アルファベットの中で最も多くの画素数を占める文字は?[クローズド]

2022-04-12 03:19:27

質問

文中の文字数に応じて動的なプログラミングを行おうとしています。画面上で最も多くのピクセル数を占めるアルファベットの文字はどれか?

どのように解決するのですか?

うーん、どうだろう。

あーーーーん

bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

dddddddddddddddddddddddddddddddddddddd

ええええええええええええええええええええええええええええええええええええええええええええええええええええええ

fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff。

グググググググググググググググググググググググググググググググググググググググググググググググググググググ

フフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフ

いぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃい

jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj

kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkz

ルルルルルルルルルルルルルルルルルルルルルルルルルルルルルルルルルルルルルッ

むむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむ

ンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンン

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

プププププププププププププププププププププププププププププププププププププププププププププププププププッ

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk

rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr

ススススススススススススススススススススススススススススススススススススススススススススススススススススセ

tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt

ううううううううううううううううううううううううううううううううううううううううううううううううううううう

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvl

wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

イィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィン

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

ああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああああ

bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

dddddddddddddddddddddddddddddddddddddd

ええええええええええええええええええええええええええええええええええええええええええええええええええええええ

fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff。

グググググググググググググググググググググググググググググググググググググググググググググググググググググ

フフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフフ

いぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃぃい

jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjk

kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkz

ルルルルルルルルルルルルルルルルルルルルルルルルルルルルルルルルルルルルルッ

むむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむむ

ンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンンン

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

プププププププププププププププププププププププププププププププププププププププププププププププププププッ

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk

rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr

ススススススススススススススススススススススススススススススススススススススススススススススススススススセ

tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt

ううううううううううううううううううううううううううううううううううううううううううううううううううううう

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvl

wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

イィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィィン

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

Wの勝ち。

もちろん、これは愚かな実証実験です。 どの文字が一番幅が広いか、答えはひとつではありません。 フォントによって異なるのです。 ですから、あなたの環境での答えを知るためには、同じような実証実験をする必要があります。 しかし、実際には、ほとんどのフォントが同じ規則に従っており、大文字のWが最も幅が広くなります。

これらの文字幅を比率形式(W=100)で表したものが、この例のフォントで捉えた要点です。

https://gist.github.com/imaurer/d330e68e70180c985b380f25e195b90c