I saw example of a site which is using a separate font file (woff) and using the source code as
<span id="txt44_1109014" data-width="147.274994" style="left:
58.538px; top: 23.413px; letter-spacing: -0.596739391304348px;">®euee Deelee DeeHeCe ³ee</span>
Below are the CSS for this element
#txt44_1109014, #txt45_1109014, #txt46_1109014 {
font-family: fnt0;
font-size: 25px;
line-height: 29px;
font-weight: bold;
color: #000000;
}
In the source code I saw there is a .woff font file which is coming from network(server).
I want to know what is this method(any specific name)?
We can do same thing via usign unicodes still what is the benific of this?
Any standard document for this present on net?
Related
I am using material2 and Material icons in my project. I want to know how these named icons are rendered in the browser. I have used
<button md-raised-button><md-icon>mode_edit</md-icon></button>
and in the browser, If I inspect the element
<md-icon class="mat-icon material-icons" role="img" aria-hidden="true">mode_edit</md-icon>
Here are the classes that are used
.mat-icon {
background-repeat: no-repeat;
display: inline-block;
fill: currentColor;
height: 24px;
width: 24px;
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
}
but I am not able to understand how these icons get rendered on UI?
I just know that md-icons are font icons that are vector images. Can someone explain the way it is rendered?
This feature is called ligatures which allows to render icons using name.
you can find more details in below link
https://alistapart.com/article/the-era-of-symbol-fonts
http://google.github.io/material-design-icons/#icon-font-for-the-web
As per the material icon's documentation
It’s easy to incorporate icons into your web page.
<i class="material-icons">face</i> // rendered as face
This example uses a typographic feature called ligatures, which allows
rendering of an icon glyph simply by using its textual name. The
replacement is done automatically by the web browser and provides more
readable code than the equivalent numeric character reference
And here is the detailed answer on stackoverflow
How do ligature icons work in Material Icons?
I have some problem in my p element.
here is my html and css
#font-face {
font-family: 'Raleway Medium';
src: url('Raleway-Medium.ttf') format('truetype');
}
.item_txt{
padding-top : 10px;
box-sizing: border-box;
padding-right: 15px;
padding-left: 95px;
font-size: 21px;
color : #F9F9F9;
text-align: left;
cursor: pointer;
font-family: 'Raleway Medium' !important;
}
I tried to import custom font but it failed.
<div class="col-sm-7 col-sm-offset-2">
<div class="item_box">
<img src="images/boardicon1.png" class='item_img'>
<p class="item_txt">Mother Board</p>
</div>
</div>
ႈhere is project directory.
The problem is that it works fine if the computer you are rendering it has the font installed as TrueType font, but if this is on web and the user that renders that page does not have that font installed locally it will fallback to browser default or your default if defined. You need to use a web version of that font, woff or woff2. Using google font will get you back the web version even if you don't ask for it. Search for the woff/woff2 version of the font and us that.
Put this at the top of your style sheet:
#import url('https://fonts.googleapis.com/css?family=Raleway');
Than use this to use the font on certain elements:
p {
font-family: 'Raleway', sans-serif;
}
I'd like to make a custom config for CSScomb that can sort part of the css in one line and part of it as the default, multiple line sort.
The css that I'd like to be sorted in one line should refer to font styling.
Right now if I use CSScomb it will format the CSS something like this:
p
{
font-family: 'Proxima Nova',Arial,sans-serif;
font-size: 12px;
font-weight: 100;
line-height: 18px;
color: #484848;
}
I'd like this to look like:
p { font-family: 'Proxima Nova',Arial,sans-serif; font-size: 12px; font-weight: 100; line-height: 18px; color: #484848; }
But other properties that are not font specific to be formated as the default CSScomb values.
Would also appreciate if someone could explain where to put the custom config file (.csscomb.json) in windows 8.1 so that it will work.
You can either define it in Home directory or root directory of your project. As another option, since you use Sublime Text 3, you can define it in
Preferences > Package Settings > CSScomb
Following the advice I found via Google, I have the following SCSS, the fonts exist in the directory specified, and FontAwesome is used elsewhere successfully with the i tag.
What am I doing wrong here as a literal keeps appearing in my html?
#font-face {
font-family: "FontAwesome";
src: url('/fonts/fontawesome-webfont.eot'),
url('/fonts/fontawesome-webfont.svg'),
url('/fonts/fontawesome-webfont.ttf'),
url('/fonts/fontawesome-webfont.woff');
}
$fa-exclamation-triangle: "";
.form-error
{
color:red !important;
font-weight: bold;
padding-top: 3px;
font-family: "FontAwesome";
&:before
{
content: $fa-exclamation-triangle;
}
}
input.error
{
font-weight: normal;
background: $validation-red;
color: black;
}
What am I doing wrong here as a literal keeps appearing in my html?
I assume you mean the generated content shows as literally ?
Well, CSS does not know named entities, so unless your CSS was embedded into the HTML document directly (which from the preprocessor syntax I assume it’s not), this named entity does not get resolved as such, and is meant literally at this point.
The CSS notation for including unicode characters is \0xxxx, with xxxx being the hexadecimal character code.
My problem is that font-weight in css doesn't apply on serbian latin characters (šđčćž ŠĐČĆŽ) which the font supports. for example:
#header h1{
font-family: 'Open Sans', sans-serif;
font-weight: 800;
color: #FFF;
font-size: 50px;
padding-left: 20px;
padding-top: 20px;
letter-spacing: 1px;
text-shadow:1px 2px 3px black;}
shows all letters bolded except serbian latin characters ON SOME COMPUTERS. It works on mine (win8), but not on two of theirs (win8.1 and winXP). Same HTML, same CSS, all three of us using Chrome and connected to the Internet. Do you have any idea what could it be?
Have you done this? How to add multiple font files for the same font? none of the SVG fonts that I have seen have different font-weights and I've not yet run into directions for creating additional font weights in that font file type. Some font files appear to have font weights, so my guess is that the systems are choosing or ending up with a different font file type.