Font looks different on photoshop and at website - html

Simple question: Why this 2 fonts looks different at photoshop and at website.
At this picture - this first text is from html code, second is an image from photoshop. The same font, the same size - 30. But this first looks more "bold" than second. Why? I want to have a identically font as it is at photoshop (second picture).
Here css code:
#font-face {
font-family: "SegoeWP";
src: url("fonts/play/SegoeWP.eot");
src: url("fonts/play/SegoeWP.eot?#iefix")
format("embedded-opentype"),
url("fonts/play/SegoeWP.woff") format("woff"),
url("fonts/play/SegoeWP.ttf") format("truetype"),
url("fonts/play/SegoeWP.svg#PlayRegular") format("svg");
font-weight: lighter;
}
#strona {
width: 1120px;
margin-left: auto;
margin-right: auto;
}
#Section1
{
font-family: "SegoeWP", Tahoma, Arial, sans-serif;
font-size: 30px;
}
header, footer, article, section, hgroup, nav, figure {
display: block;
}
body {
font-family: "SegoeWP", Tahoma, Arial, sans-serif;
background-image:url('background.jpg');
background-repeat: no-repeat;
background-position: top center;
color: #ffffff;
}
And html code.
<section id="Section1"> { mywebsite.NET } </section>
<img src="mojeportfolio.png" />
any ideas? Greetings!
MORE
i found, that I have 3 types of SegoeWP font in folder. "SegoeWP", "SegoeWP-Light", "SegoeWP-Semibold". "SegoeWP" looks a litle bit too "bold", but this "SegoeWP-Light" is perfect and looks identical as in photoshop when i doubleclick it. How can I use it on my website? When I change this part -> url("fonts/play/SegoeWP-Light.*"), nothing change at website. What is wrong?

photoshop handles fonts a lot differently than a web browser ... because photoshop used functions like smoothing, kernel and others the font will almost always look different in a browser

To get the same result try using font-smoothing: antialiased, and reducing the font size so it matches your Photoshop image.
The biggest difference is because Adobe Photoshop will not do subpixel font-smoothing—unlike most browsers. In your example image this is easily visible if you zoom in(see the color shifts around the edges). Windows has a history of using an extra crisp form of subpixel font rendering, which exacerbates the problem as the perceived font weight can change severely.
Smashing Magazine has an excellent article on font rendering.

Make sure you are adding the css to the right location sometimes that could be the issue. For full notes on how to lessen the weight of a font you can find it here:
http://www.w3schools.com/css/tryit.asp?filename=trycss_font-weight

Related

Converting a static HTML design to blog-like style reminiscent of magazine and finding a working CSS style?

This is the codepen for my HTML layout for a magazine - link here.
I have been experimenting with the CSS and trying to achieve a more blog-like design with my CSS, to emulate the effect seen at https://www.autocar.co.uk/car-review/bmw/7-series/first-drives/bmw-7-series-750li-xdrive-2019-review
(well, the way the article and sidebar with other articles is; the article and Driven this week part)
Currently I have this CSS:
body {
background-color: gray;
font-family: Verdana, sans-serif;
font-size: 14px;
}
p {
font-family: Verdana, sans-serif;
font-size: 13px;
line-height: 21px;
}
header {
background-color: #FFFFFF;
}
div.article {
width: 800px;
height: auto;
background-color: #FFFFFF;
float: right;
overflow: auto;
padding: 5px;
}
div.article img {
height: 340px;
}
but what sort of padding etc. could I use while keeping the div.article as white (FFFFFF) and get the header to work more effectively with the title?
if the header is in anything but h1, h2, h3 etc. it doesn't quite work - example at forked codepen.io copy - https://codepen.io/anon/pen/pBgQjw
Although this uses Verdana here for ease of use, what's the best way of getting FontSquirrel fonts like OpenSans to work locally (i.e. not linking to online source, but the directory the fonts are in); I've often used .ttf when doing fonts other than Arial or Verdana.
I may be using Gotham font soon, but for now it's OpenSans and OpenSans Bold.
OpenSans Bold is for h1, h2 in the CSS soon.
This is only a testing page on localhost, but it maybe used as a template for a PHP site.
No Javascript is in use yet but if you have any good suggestions for ones that could work, I'd appreciate it. (I've kept the design simple for now).
The grey background will be kept, and div.article in white.
I would welcome any advice on how to turn this from looking rather staid into a more professional, blog-like design.
I think you should try to use a CSS framework, e.g. Bulma (which is lightweight and easy to use and based on CSS flexbox). See Bulma docs here: https://bulma.io/documentation/
As for the font implementation I think #font-face should do the trick - you just have to download the font to your server (or local device).

CSS Font styles not working

I've been trying to add a css font style like the one on the landing page of http://www.lecrae.com. The text that says "LECRAE", I'm trying to use the same css style, but it doesn't seem to be working for me, only "W" in the word "Welcome" shows, and it doesn't look like the font too. Here's my code below:
CSS
.header { font-family: Futura, "Trebuchet MS", Arial,sans-serif;
font-weight:700;
letter-spacing:14em;
line-height:1em;
color:#333;
font-style:normal;
font-size:120px;
}
HTML
<h1 class="header">Welcome</h1>
There are three issues here:
Only the first letter "W", of your heading "Welcome" is showing.
The font(s) you specified are not showing.
You want to use Futura, but it isn't available for free.
The first issue is solved easily. You are using a huge letter-spacing of 14em, I assume you made a typo when copying the given source and it was supposed to be .14em. This explains why you can only see the first letter: all other letters are being pushed out of the screen.
The second issue is also solved easily. You are specifying fonts that might not be available on a users computer. For example, most Linux distributions do not ship with any of the fonts you specified and would hence fall back to sans-serif. If you really want to use a specific font, #import that font from a source like Google Fonts. This way, the font will be downloaded by the user's browser.
The third issue is easy as well: you either pay for the font or you need to use a different, freely available font instead.
Putting that together:
#import url('https://fonts.googleapis.com/css?family=Open+Sans:700');
.header {
font-family: 'Open Sans', sans-serif;
font-weight: 700;
letter-spacing: .14em;
line-height: 1em;
color: #333;
font-style: normal;
font-size: 120px;
text-transform: uppercase;
}
<h1 class="header">Welcome</h1>
Also note that you did not copy the text-transform: uppercase rule, which I added here.

How to make a font appear as is and not pixelated

I am using a custom font for a image slider in SharePoint 2010. For some reason when the size of the font is anything bigger than 12pt, the font is pixelated and is not sharp in IE 8.
CSS:
#font-face {
font-family: 'MyriadPro';
src: url('http://insidedev:1000/fonts/myriadpro.otf'); /* IE9 Compat Modes */
src: url('http://insidedev:1000/fonts/myriadpro.otf?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('http://insidedev:1000/fonts/myriadpro.otf') format('otf'), /* Modern Browsers */
}
#slider div.mc-caption {
font: 13pt bold 'Arial Rounded MT Bold', Verdana, MyriadPro;
color:#FFFFF;
z-index:4;
text-align:left;
background:none;
margin-left: 10px;
}
#slider div.mc-caption a {
color: #354B9A;
font: 13pt bold 'Arial Rounded MT Bold', Verdana, MyriadPro;
}
#slider div.mc-caption a:hover {
color: #E8620E;
font: 13pt bold 'Arial Rounded MT Bold', Verdana, MyriadPro;
}
I was trying to originally use a custom font, MyriadPro but that did not seem to be being used in my image slider. With the above CSS, the caption looks like this:
Any idea what is causing this? How do I fix it, please let me know.
I was able to solve my problem by using ClearType for older version of IE8 that displays the pixelated font.
First, what is ClearType?
Think of those jagged edges you often see in text on a computer
screen, especially any flat-panel. Well, there’s a bit of code in your
operating system that attempts to clean up those edges by using
anti-aliasing at the sub-pixel level to visually smooth out those
rough edges, making the text easier to read. Essentially, it aims to
make on-screen text appear more like printed text.
But, here’s where our problem lies. Animating text with JavaScript
(especially in jQuery) overrides the ClearType feature by telling the
browser to display each step of the pixel throughout animation. When
the animation completes, its left displaying the final step without
ClearType enabled, leaving the text looking a bit crappy. Functions
like fadeIn() and fadeOut() usually trigger the override and cause the
pixel problems. (dauid.com)
An example of JavaScript/JQuery that causes ClearType issue:
$("#div").fadeIn();
To get around the issue, especially for older browsers, you have to remove the filter attributes like this:
// This fixes the ClearType issue in jQuery
$("#div").fadeIn(function(){
this.style.removeAttribute("filter");
});
// This fixes the ClearType issue in animations outside of jQuery
document.getElementById("#div").style.removeAttribute("filter");
Hope it helps others who are experiencing the same issue.
Set the background colour of the link text to match what is behind it.
#slider div.mc-caption a {
color: #354B9A;
font: 13pt bold 'Arial Rounded MT Bold', Verdana, MyriadPro;
background-color:??????
}

certain font isn't showing up on all browsers/computers

Ran into a strange problem. I'm using Factor Font for the first part of the title and another font for the second part of the title. I uploaded the .ttf files and linked to them in the css. It's showing up on my mac (chrome, safari, mobile), but not on someone else's computer (chrome, mozilla, even mobile). I have no idea what the problem could be. This is how it should look:
This is how it looks when it's wrong.
Like I said, it's uploaded to the server just fine because I use a certain font for "Life Blog" so that font is loaded and used correctly. What could be the problem??? Is it this font? Here's my css code:
#font-face{
font-family: "Factor";
src: url("..//fonts/factor.ttf");
}
#font-face{
font-family: "Mamma Gamma";
src: url("..//fonts/MammaGamma.ttf");
}
#title h1{
font-family: "Factor";
font-size: 46px;
margin-bottom: -30px;
}
#title h2{
font-family: "Mamma Gamma";
font-size: 80px;
margin-bottom: -25px;
}
And here's the html...it's all really simple:
<div id="title">
<h1>Elena Ikovleva</h1>
<h2>Life Blog</h2>
</div>

Slow rendering using "Sans-Serif"

I have a odd issue on my "in-development" website here: http://www.cphrecmedia.dk/musikdk/stage/
The H1-h6 fonts are just "sans-serif", but often in Chrome it shows another font (screenshot: http://cl.ly/image/260B0H0l1w0C). When the mouse hover the navigation it changes to the right font. FYI this is how it should look like: http://cl.ly/image/442l071M3N1B
The code used for font is:
.nm li a {
float: left;
font-family: sans-serif;
height:22px;
padding: 12px 14px 7px 14px;
color:#white;
font-size: 12px;
line-height: 20px;
}
I mainly develop using Chrome, so I'm not sure if the issue is present in other browsers. Have anyone of you seen this issue before?
'sans-serif' is not a font name it's a font family specification.
Use a sans-serif font name like "Arial" or "Verdana" or else you will have unexpected results (the browser may replace your font with generic ones).
Try using custom font method by downloading the font and keeping it in your fonts folder.
Example:
#font-face {
font-family: myFirstFont;
src: url('Sansation_Light.ttf')
,url('Sansation_Light.eot'); /* IE9 */
}
div
{ font-family:myFirstFont; }
Try using custom web font from google:
http://www.google.com/fonts
Select a font and uses one of the three metods, i prefer CSS method.
Example:
#import url(http://fonts.googleapis.com/css?family=Roboto);
Import this in CSS and use this for you text: font-family: 'Roboto', sans-serif;