/    Sign up×
Community /Pin to ProfileBookmark

Embedded font won’t italicize in Safari/Google Chrome

Hi guys,

I have embedded a font (CircleD) in my page using the following code:

[code]
@font-face{
font-family: ‘cv_circled’;
src: url(‘cv_circled.eot’);
src: url(‘cv_circled.eot?#iefix’) format(’embedded-opentype’),
url(‘cv_circled.woff’) format(‘woff’),
url(‘cv_circled.ttf’) format(‘truetype’),
url(‘cv_circled.svg#webfont’) format(‘svg’);
}

#navlinks a {
font-family: cv_circled, Arial;
font-style: italic;
}
[/code]

The embedded font displays fine in all browsers (IE9, FF6, Opera11, Safari and Google Chrome).

However the navlinks are not italic in Safari and Google Chrome. I’m using the latest versions.

I’ve tried using ‘oblique’ instead of ‘italic’ but there’s no change.

I did a bit of research and tried to find an italic version of the CircleD font but I couldn’t find it.

Is there any way to make Safari and Google Chrome italicize an embedded font? A CSS hack maybe?

thanks

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@Frank62Sep 04.2011 — A hack is not necessary. Just tell Safari en Chrome that the downloaded font is the normal font with regards to weight and style. Like so:

[code=html]
@font-face {
font-family: 'cv_circled';
font-style: normal;
font-weight: normal;
src: url('fonts/cv_circled.eot?#iefix') format('embedded-opentype'),
url('fonts/cv_circled.woff') format('woff'),
url('fonts/cv_circled.ttf') format('truetype'),
url('fonts/cv_circled.svg#cv_circled') format('svg');
}

#navlinks a {
font-family: cv_circled, Arial;
font-style: italic;
}
[/code]


To keep things manageable, I would suggest to put the font files in a separate folder called fonts. The above CSS points to that folder.
×

Success!

Help @W8_4me spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...