不同大小的不同字体 [英] Different size for different font

查看:182
本文介绍了不同大小的不同字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在他的书CSS:The Definitive Guide中第2版​​(第116-117页),Eric

Meyer有一个关于font-size-adjust的有趣讨论。由于浏览器不支持,这显然是在CSS 2.1中掉落的。我想知道

如果有某种方式我仍然可以获得这个

功能的原始版本,因为不同的字体显示在非常不同的光学上>相同标称尺寸的
尺寸。


例如,假设我希望类型显示在13px / 1.5em Georgia中。但是如果用户没有安装Georgia,那么

,我只是按照通常的方式列出Times

New Roman作为备用字体(或者如果 ; serif获得

在他们的系统上被解释为Times),然后类型将显示在

13px Times中,这在光学上远小于13px Georgia(并且具有< />
光学上不同的xheight / linespacing特性)。即使我用
使用em而不是px,我猜你会有相当大的尺寸

的差异。


所以,在没有font-size-adjust的情况下,我真正想要的是

这样的东西:


p .someClass {font:13px / 1.5em Georgia,15px / 1.4em" Times New Roman",

14px / 1.5em serif;}


。 ......但我有一种感觉,实际上并不是我想要的。呃...

会吗?


任何解决方案?

解决方案

Jonas Smithson写道:


>

不同的字体显示非常不同的光学

尺寸相同名义尺寸。


例如,假设我希望类型以13px / 1.5em Georgia显示。



简单解决方案 - 不要指定绝对字体大小。如果你保留默认大小(100%)的
,那么用户会看到任何大小的字体(无论是否b $ b b格鲁吉亚)*他们认为是最优的。


-

Berg


Scripsit Jonas Smithson:
< blockquote class =post_quotes>
在他的书CSS:The Definitive Guide中第2版​​(第116-117页),

Eric Meyer有一个关于font-size-adjust

的有趣讨论,由于浏览器不支持。



现在已经在Firefox 2上实现了(在Windows上)。


p.someClass {font :13px / 1.5em Georgia,15px / 1.4emTimes New Roman,

14px / 1.5em serif;}


...但是我有一种感觉,实际上并不是我想要的。呃...

会吗?



我对此表示怀疑。它违反了CSS语法。


您可能可以通过客户端脚本执行某些操作,但这将在这里偏离主题。


-

Jukka K. Korpela(Yucca)
http://www.cs.tut.fi/~jkorpela/


Scripsit Bergamot:


Jonas Smithson写道:


>>
对于相同的标称尺寸,不同的字体以非常不同的光学尺寸显示。

例如,假设我希望类型以13px / 1.5em格式显示。



简单解决方案 - 不要指定绝对字体大小。如果你保留默认大小(100%)的
,那么用户会看到任何大小的字体(无论是否b $ b b格鲁吉亚)*他们认为是最佳的。



你错过了这一点。当然应该避免使用绝对字体大小,但是

并没有解决问题。


例如,假设你想使用Arial。只设置font-family:Arial

适用于绝大多数用户。那就是问题所在。如果他们有

设置他们的浏览器使用适合他们的浏览器的字体大小

默认字体,可能是Times New Roman,他们会看到Arial在那个

大小,大概是12pt(16px)。


虽然12pt Times New Roman在屏幕上看起来合理,12pt Arial看起来太棒了

对大多数人来说很重要。那么你能做什么?


如果你问我,你应该接受。太大的字体很少被_users_(并且经常被设计师)抱怨,并且如果重要的话,用户可以减少字体大小。


但许多作者设定了例如font-size:80%甚至更小。这通常不是灾难性的,但也不是很好,特别是对于那些已经设置了浏览器使用例如
的用户来说,例如Arial的大小为10pt。减少尺寸

到8pt,这可能太小而不能舒服地阅读。


-

Jukka K .Korpela(Yucca)
http:// www。 cs.tut.fi/~jkorpela/


In his book "CSS: The Definitive Guide" 2nd edition (pgs. 116-117), Eric
Meyer has an interesting discussion about "font-size-adjust" that was
evidently dropped in CSS 2.1 due to browser non-support. I''m wondering
if there''s some way I could still get a primitive version of this
functionality, because different fonts display at very different optical
sizes for the same nominal sizes.

For example, suppose I want type to display in 13px/1.5em Georgia. But
if the user doesn''t have Georgia installed, and I''ve simply listed Times
New Roman as the alternate font in the usual way (or if "serif" gets
interpreted as Times on their system), then the type will display in
13px Times, which is optically much smaller than 13px Georgia (and has
optically different xheight/linespacing characteristics too). Even if I
used em instead of px, I''m guessing there''d be a substantial size
difference.

So what I''d really like, in the absence of "font-size-adjust", is
something like this:

p.someClass {font: 13px/1.5em Georgia, 15px/1.4em "Times New Roman",
14px/1.5em serif;}

....but I have a feeling that wouldn''t actually do what I want. Er...
would it?

Any solution?

解决方案

Jonas Smithson wrote:

>
different fonts display at very different optical
sizes for the same nominal sizes.

For example, suppose I want type to display in 13px/1.5em Georgia.

Simple solution - don''t specify an absolute font-size. If you leave it
at the default size (100%), then the user will see the font (be it
Georgia or not) in whatever size *they* think is optimal.

--
Berg


Scripsit Jonas Smithson:

In his book "CSS: The Definitive Guide" 2nd edition (pgs. 116-117),
Eric Meyer has an interesting discussion about "font-size-adjust"
that was evidently dropped in CSS 2.1 due to browser non-support.

It has now been implemented on Firefox 2 (on Windows).

p.someClass {font: 13px/1.5em Georgia, 15px/1.4em "Times New Roman",
14px/1.5em serif;}

...but I have a feeling that wouldn''t actually do what I want. Er...
would it?

I doubt that. It violates CSS syntax.

You might be able to do something via client-side scripting, but that would
be off-topic here.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


Scripsit Bergamot:

Jonas Smithson wrote:

>>
different fonts display at very different optical
sizes for the same nominal sizes.

For example, suppose I want type to display in 13px/1.5em Georgia.


Simple solution - don''t specify an absolute font-size. If you leave it
at the default size (100%), then the user will see the font (be it
Georgia or not) in whatever size *they* think is optimal.

You missed the point. Of course absolute font sizes should be avoided, but
that doesn''t solve the problem.

For example, suppose you want to use Arial. Setting just font-family: Arial
works for a great majority of users. And there the problem is. If they have
set their browser to use a font size that is suitable for their browser''s
default font, which is probably Times New Roman, they will see Arial in that
size, which is probably 12pt (16px).

While 12pt Times New Roman looks reasonable on screen, 12pt Arial looks too
big to most people. So what can you do?

If you ask me, you should just accept that. Too big font size is seldom
complained by _users_ (and quite often by designers), and users can reduce
the font size if it matters.

But many authors set e.g. font-size: 80% or even smaller. This is usually
not catastrophic, but it''s not nice either, especially to users who have set
their browser to use e.g. Arial in 10pt size. The reduction takes the size
to 8pt, which is probably too small to be read comfortably.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


这篇关于不同大小的不同字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆