2013-06-03 87 views
8

我在我的網站中使用了Segoe UI Light字體。Segoe UI Light字體在Google Chrome中無法正常顯示

使用的CSS如下。

.divMainHeader 
{ 
font-family:Segoe UI; 
font-size:28pt; 
font-weight:lighter; 
width:100% 
} 

但谷歌瀏覽器不能正確呈現此字體。我在Chrome中獲得了Segoe UI Light的粗體字體。

The Image。 The Screen Shots joined of different browsers.

我使用的瀏覽器版本。

Internet Explorer中:9

是Mozilla Firefox:21

谷歌瀏覽器:27

+0

這有幫助嗎? http://stackoverflow.com/questions/2705791/how-do-i-get-font-weight-lighter-to-work-in-google-chrome –

+0

@ralph,沒有工作:( –

回答

1

可能是由於多種原因:

  1. 也許你正在使用錯誤的字體格式。 Chrome支持SVG,WOFF,TTF/OFT。
  2. 邁出定義字體重量一種錯誤的做法,從而導致瀏覽器解釋font-weight屬性錯誤地

樣品:http://pastebin.com/FiGvAfTk

你正確地定義您的字體?

+0

我使用TTF類型,我嘗試了不同的方法來分配字體重量,沒有什麼效果。 –

+0

你能發佈你的代碼嗎? –

+0

我使用的是我在問題中使用過的相同代碼因爲這個問題,我切換到roboto濃縮,它是在所有的瀏覽器中都能正常工作 –

1

有趣......我在幾乎相反的問題...我能得到的Segoe UI光在Chrome和IE 10正確地呈現,而不是在FF 21

another post some time back,有人建議使用類似於微軟利用在其網站上的東西...

h1, h2, h3, h4, h5, h6, h7 { 
    font-family: "wf_SegoeUILight","wf_SegoeUI","Segoe UI Light","Segoe WP Light","Segoe UI","Segoe","Segoe WP","Tahoma","Verdana","Arial","sans-serif"; 
    font-weight: 300; 
} 

對於不履行字體重量+中的Segoe UI字體瀏覽器,指定的Segoe UI光第一似乎保證它呈現重量更輕的字體。

但是,在FF 21中,無論我嘗試什麼,我仍然看到正常的Segoe UI字體。 Firebug表示它正在從列表中選擇Segoe UI字體。

1

我自己也有類似的問題,瀏覽器只渲染標準的Segoe UI而不是較輕的版本。如果您將字體族更改爲Segoe UI Light,則應該按照您的要求進行操作。

請參閱下面的修改後的代碼:

.divMainHeader { 
    font-family:"Segoe UI Light"; 
    font-size:28pt; 
    font-weight:100; 
    width:100% 
} 
0
@font-face { 
    font-family: 'Myfont'; 
    font-style: normal; 
    font-weight: 200; 
    src: local('Segoe UI Light'), local('SegoeUI-Light'); 

} 

body{ 
    font-family: 'Myfont'; 
} 

此代碼固定我的問題像你

3

它很難獲得在Firefox這個工作。字體重量300在所有版本中都不會工作很少。以下代碼適用於我,並與所有瀏覽器兼容。

font-family: "Segoe UI Light","Segoe UI"; 
font-weight: 300; 

Here 這是從HTML5解決方案,但它可能會幫助你也一樣,它也是在Visual Studio ... 懸停在CSS字體重量選項會告訴你的話重量(光,半等) 100:薄 200:額外光(超輕) 300:光 400:正常 500:中等 600:半粗體(黛咪粗體) 700:粗體 800:額外粗體 希望它有幫助。

請按照以下選項添加字體重量,而不是使用半角或半角。只需將字體重量組合使用'segoe ui'。

@font-face { 
    font-family: "Segoe UI"; 
    font-weight: 200; 
    src: local("Segoe UI Light"); 
} 
@font-face { 
    font-family: "Segoe UI"; 
    font-weight: 300; 
    src: local("Segoe UI Semilight"); 
} 
@font-face { 
    font-family: "Segoe UI"; 
    font-weight: 400; 
    src: local("Segoe UI"); 
} 
@font-face { 
    font-family: "Segoe UI"; 
    font-weight: 600; 
    src: local("Segoe UI Semibold"); 
} 
@font-face { 
    font-family: "Segoe UI"; 
    font-weight: 700; 
    src: local("Segoe UI Bold"); 
} 
@font-face { 
    font-family: "Segoe UI"; 
    font-style: italic; 
    font-weight: 400; 
    src: local("Segoe UI Italic"); 
} 
@font-face { 
    font-family: "Segoe UI"; 
    font-style: italic; 
    font-weight: 700; 
    src: local("Segoe UI Bold Italic"); 
}