I have a webpage where I'm using the "font-family: Poppins-Medium;"
In my PC the font is displayed correctly.
However, in other PCs, only "Times New Roman" font is displayed.
May someone give me a help?
See CSS code:
.txt2 {
font-family: Poppins-Regular;
font-size: 14px;
color: #999999;
line-height: 1.5;
}
Thanks.
PS: This is the link to the page:
http://ez2main.somee.com/estock/cliadd.asp
In order to use custom font you should first declare #font-face.
It's all written on that link, but let me sum it a little:
step 1: upload font files to the server
step 2: declare font name and use the src property to link those files.
step 3: Now custom font will show on every browser since they available on the server.
Hope that helps!
When this happens to me it is because I have the font installed on my computer but no on the server. Make sure to set up your custom font with #font-face before using it.
#font-face {
font-family: 'Poppins-Regular';
src: url('../font/Poppins-Regular.eot'); /* IE9 Compat Modes */
src: url('../font/Poppins-Regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../font/Poppins-Regular.woff2') format('woff2'), /* Super Modern Browsers */
url('../font/Poppins-Regular.woff') format('woff'), /* Modern Browsers */
url('../font/Poppins-Regular.ttf') format('truetype'), /* Safari, Android, iOS */
}
Also make sure to add appropriate fall back fonts to make it fail more gracfully.
font-family: Poppins-Regular, 'second-closest-font', Arial, etc;
I recommend using websafe fonts instead.
https://www.w3schools.com/cssref/css_websafe_fonts.asp
The browser that does not have those fonts installed, tries to load them from the URL http://ez2main.somee.com/fonts/poppins/Poppins-Regular.ttf and that is not a valid URL.
If you provide want to provide those fonts, you should make them available from your server. Otherwise, use standard fonts that every browser would have.
Related
trying to add a custom font into my wordpress website but it's just not working. I tried using one of the plugins but I only see the change in font in 'edit mode' but when i actually go on the public webaddress the font does not load.
I've converted futura condensed light into the various types and added this in my style.css on the theme I'm using
#font-face {
font-family: 'Conv_futura-condensedlight-normal';
src: url('fonts/futura-condensedlight-normal.eot');
src: url('fonts/futura-condensedlight-normal.eot?#iefix') format('embedded-opentype'),
url('fonts/futura-condensedlight-normal.woff') format('woff'),
url('fonts/futura-condensedlight-normal.ttf') format('truetype'),
url('fonts/futura-condensedlight.svg#Conv_futura-condensedlight-normal') format('svg');
font-weight: normal;
font-style: normal;
}
and also added this
h7{font-family: 'Conv_futura-condensedlight-normal';}
On the page where I want the text to change I have:
<h7>LOGIN</h7>
but the text does not change..
I've also uploaded the files into the fonts folder in the theme directory (where other fonts are)
Can't seem to find the bug. Help would be appreciated!
Try #font-face for custom fonts. Use below code.
#font-face {
font-family: 'MyWebFont';
src: url('webfont.eot'); /* IE9 Compat Modes */
src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('webfont.woff2') format('woff2'), /* Super Modern Browsers */
url('webfont.woff') format('woff'), /* Pretty Modern Browsers */
url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
and specify it as below :
font-family: 'MyWebFont', Fallback, sans-serif;
Refer : https://css-tricks.com/snippets/css/using-font-face/
They may be several reasons but the first thing I'm seeing wrong is the <h7> tag because it doesn't exist. You should use from h1 to h6.
If that doesn't solve the issue please try with browser's console as #War10ck said, missing files is a signal of path issues.
When I created a custom font and used it on my website, this was the CSS I used:
#font-face {font-family:'CUSTOM_FONT_NAME';src:local('CUSTOM_FONT_NAME'), url(http://MY_URL/MY_FONT_PATH/MY_FONT.ttf) format('truetype');}
.my_custom_font_class {font-family:'CUSTOM_FONT_NAME',serif;}
I believe I had to use a global path to get my font to load, so you might try that.
The src:local('CUSTOM_FONT_NAME') part is just to verify that it's working at all from your machine with the font installed. (You'll need the font name to match the name it's registered under in your machine, in this case).
I have searched this on net found many articles and tutorials, I followed some of them but still not getting the desired results.
I have downloaded the font and place this in the my project folder. This is the code I am writing but it's not changing the font-style.
#font-face
{
font-family: Montereybold;
src: url(font/Montereybold.ttf);
}
h1
{
font-size:36px;
font-family:Montereybold;
}
Kindly guide me what I am doing wrong here.
Thanks
¿Have you tried quoting the font name? Also, for better compatibility, upload several font formats.
#font-face {
font-family: 'Montereybold';
src: url('font/Montereybold.eot'); /* IE9 Compat Modes */
src: url('font/Montereybold.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('font/Montereybold.woff') format('woff'), /* Modern Browsers */
url('font/Montereybold.ttf') format('truetype'), /* Safari, Android, iOS */
url('font/Montereybold.svg#Montereybold') format('svg'); /* Legacy iOS */
font-weight:normal;
font-style:normal;
}
Using it:
font-family:'Montereybold';
Maybe the url is wrong. Is there "font" folder in parent folder of your css file ? Otherwise, try "../font/Montereybold.ttf".
Also, ttf is not supported by all browser. Use font-face generator for a best result : http://www.fontsquirrel.com/tools/webfont-generator .
I am trying to add font for displaying currency sign (Russian rouble). Code that I am using taken from here. Also i added magic zoom: 1;. But it don't work.
Font-face defenition
#font-face {
font-family: "Rouble";
src: url('/catalog/view/font/rouble.eot'); /* IE9 Compat Modes */
src: url('/catalog/view/font/rouble.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/catalog/view/font/rouble.woff') format('woff'), /* Modern Browsers */
url('/catalog/view/font/rouble.ttf') format('truetype'), /* Safari, Android, iOS */
url('/catalog/view/font/rouble.svg#Rouble') format('svg'); /* Legacy iOS */
}
Then usage
.rubl {
font-family: "Rouble";
font-style: normal;
font-weight: normal;
zoom: 1;
}
I test it with ie7 from Win Vista under WM VirtualBox taken from here (if it is matter).
What am I doing wrong?
Live example you can see here (Login/Password: demo/demo)
Testing on IE 11 in IE 7 mode, the console shows an error with code CSS3111, referring to rouble.eot, with additional data “terminating; too few slides: 0”. Looks a bit odd, but apparently the EOT file is corrupt. The same problem appears in EOT mode, whereas IE 9 and newer use the WOFF file.
Quite apart from this, the page uses font trickery rather than a proper approach: the HTML markup has <span class="rubl"> a</span>, and CSS settings are used in an attempt at making the browser misreprsent the letter “a” as the ruble sign. This trickery works since the font claims that the ruble sign is a glyph for the letter “a”.
Chrome 26.0.1410.64m on Windows 8 has problems rendering WebFonts. It is a known problem and a solution is to first serve the svg version of the font instead of the woff version. It fixes the anti-aliasing and makes font look pretty again.
The downside of this method is the weird rendering inside the element inside select inputs.
I added a jsfiddle to see it in action : http://jsfiddle.net/4mSpv/6/.
The CSS is as simple as it can be.
#font-face {
font-family: 'Montserrat';
src: url('https://raw.github.com/louh/website/master/fonts/montserrat-regular-webfont.svg#montserratregular') format('svg');
font-weight: 400;
font-style: normal;
}
select {
font-family: 'Montserrat', sans-serif;
}
I remove the local installation of a font and noticed an other windows 7 computer doing the same. Anyone knows what is going on with chrome? (IE, Firefox, Safari all render fine)
PS: Other browser fonts not included in JSFiddle to filter out the problem and each browser have their own quirks (not allowing font-size etc) but render the text fine
There is no way to solve this problem.
This is NOT a Regression issue and is existing from M24.
I submitted a bug report and it Weird character rendering in option menu
As automaticoo stated, it is a known issue with Chrome. However, you can workaround the issue with a technique mentioned in the selected answer for this post: Google Webfonts Render Choppy in Chrome on Windows.
#media screen and (-webkit-min-device-pixel-ratio:0) {
select {
font-family: Arial; /* standard font */
}
}
That way you can use whatever font you want for browsers that still work, and replace it with a generic HTML font for Chrome.
So, I was actually looking for an answer for this, and I stumbled upon this question. I noticed this bug still exists today ( I just met it, such a happy meeting... ). Now I only found 1 solution, which is placing the svg font last in the #font-face declaration (this also means including all other formats). The only problem is that, when you for exampling try fixing the font rendering (to make it all smooth and stuff) you'd actually put the svg first.
Here are some examples to demonstrate it
1: SVG font last, no crisp font, options are displayed right
#font-face {
font-family: 'OpenSansLight';
src: url('../font/OpenSans-Light-webfont.eot');
src: url('../font/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'),
url('../font/OpenSans-Light-webfont.woff') format('woff'),
url('../font/OpenSans-Light-webfont.ttf') format('truetype'),
url('../font/OpenSans-Light-webfont.svg#open_sanslight') format('svg');
font-weight: normal;
font-style: normal; }
So as you can see, the options in the select box show just fine, but the font really isn't that crips, just look at "Register" (you might notice this better in comparison with my second example)
2: SVG font last, crisp font, stupid options in select
#font-face {
font-family: 'OpenSansLight';
src: url('../font/OpenSans-Light-webfont.eot');
src: url('../font/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'),
url('../font/OpenSans-Light-webfont.svg#open_sanslight') format('svg'),
url('../font/OpenSans-Light-webfont.woff') format('woff'),
url('../font/OpenSans-Light-webfont.ttf') format('truetype');
font-weight: normal;
font-style: normal; }
Now you will see that the font is a lot more crisp but the select is really stupid.
I suggest adding another font-face with the svg last just for select's. This will keep your fonts crisp throughout the website but display the options just fine.
If I add a font into my FTP for my website, when I am adding in my font, where do I put it in the FTP and how do I use the font with HTML or CSS ?
You can upload the font where ever you want it, you just need to link to the right location. Please see exmaple below for font faces in CSS.
#font-face{
font-family:'Your Font Name';
src:url(http://www.example.com/fonts/YourFont.otf);
}
I personally recommend use the Font Squirrel Fontface generator for that. You will get something like:
/* #Fontface */
#font-face {
font-family: 'Yourfont';
src: url('fonts/yourfont.eot');
src: url('fonts/yourfont.eot?#iefix') format('embedded-opentype'),
url('fonts/yourfont.woff') format('woff'),
url('fonts/yourfont.ttf') format('truetype'),
url('fonts/yourfont.svg#Yourfont') format('svg');
font-weight: normal;
font-style: normal;
}
Using this way you will get a valid option to IE, Chrome, Opera, Firefox and Safari. Later you can use this font like a normal font, using
div.heading { font-family: 'Yourfont', (othersifyouwant); }