How to embed kannada font? - html

I want to make Kannada website in that I have lot of content so that till now I'm using google kannada translator to add but now the content is more so is their any way to do embed kannada font I tried this link http://www.google.com/fonts/earlyaccess but I couldn't get it.
I tried like this:
#import url(http: //fonts.googleapis.com/earlyaccess/notosanskannada.css);
font-family: "Noto Sans Kannada Regular", serif; font-size: 19.0px; line-height: 1.11em;

There are three problems with the code you’ve used: a space in the URL of the Google CSS file (URLs must not contain spaces), the font name Noto Sans Kannada Regular (the Google CSS file defines Noto Sans Kannada), and the appearance of the font-family declaration as such (it must appear within a CSS rule, consisting of a selector, the { character, a declaration or declarations, and the } character). The following works:
<!doctype html>
<meta charset=utf-8>
<title>Kannada test</title>
<style>
#import url(http://fonts.googleapis.com/earlyaccess/notosanskannada.css);
body { font-family: "Noto Sans Kannada", sans-serif; font-size: 19.0px; line-height: 1.11em; }
</style>
Hello world!
<p>
ಮುಖ್ಯ_ಪುಟ
The last line of the sample code is Kannada text and may or may not be legible here, depending on fonts installed in your system. On a web page, it will be legible thanks to the use of a downloadable font (via the Google CSS code) – unless the user has denied the use of downloadable fonts, which is rare.
I changed serif to sans-serif, since it is illogical to use a serif font as fallback font when the primary font is a sans serif font like here.
Note: Normal text will appear in regular typeface of Noto Sans Kannada, and bold text (as in headings by default) in bold typeface of Noto Sans Kannada. You should not use italic (like em element) for elements that may contain text in Kannada to be displayed using this font. The reason is that Google does not provide an italic typeface (as you can see by looking at its CSS file), and this makes browsers generate “fake italic” by algorithmically slanting glyphs, which is bad typography.

Related

CSS Font Style Changes Not Working in Chrome

Could someone clarify why the below font style settings is not working in chrome, but working in IE and FireFox.
My website has the same problem, it does not pick up the CSS font settings (where normal is mentioned), hence I tested with the CSS test environment from W3Schools and the behavior is same.
CSS Snippet:
Working only in IE/FireFox: font-family: Arial, Helvetica, sans-serif normal;
Working in All Browsers: font-family: Arial, Helvetica, sans-serif;
Try in Chrome and IE to see difference.
body {
font-family: "Times New Roman", serif;
}
p.serif {
font-family: Arial, Helvetica, sans-serif;
}
p.sansserif {
font-family: Arial, Helvetica, sans-serif normal;
}
<h1>CSS font-family</h1>
<p class="serif">This is a paragraph, shown in Arial Without Normal.</p>
<p class="sansserif">This is a paragraph, shown in Arial With Normal</p>
Below are the questions:
Could you clarify why the behavior difference between these two browsers?
How to ensure my CSS font styles are picked by Chrome and IE/FireFox (Should I remove normal from all my CSS files or is there any better way to do it)?
Arguably invalid font-family declaration
If you open your browser's inspector (Ctrl+Shift+i in Chrome) you will see that the CSS rule
p.sansserif {
font-family: Arial, Helvetica, sans-serif normal;
}
is not applied.
Per the CSS specifications, an invalid rule is ignored, and whatever would have been applied (backwards up the cascade) is applied instead or more accurately, not overruled.
The result is "Times New Roman" in this case - as seen in the "Computed Styles".
To set the font-style (-variant, -weight, -stretch or line-height (whichever you were trying to set to normal)) of text, we can either use exactly that, or use the font shorthand.
The font CSS property is either a shorthand property for setting font-style, font-variant, font-weight, font-size, line-height, and font-family...
(with caveats).
As for the difference between IE(and FF) and Chrome
Chrome recognises in the comma delimited assertion that sans-serif normal is not a font-family, whereas IE doesn't.
If you simplify the rule to:
p.sansserif {
font-family: sans-serif normal;
}
and view the result in IE, you'll see the <p> is in "Times New Roman" since, although IE accepts the declaration, it can't do anything sensible with it.
More from the specs:
...it is recommended to quote font family names that contain white space, digits, or punctuation characters other than hyphens.
Font family names that happen to be the same as a keyword value (‘inherit’, ‘serif’, ‘sans-serif’, ‘monospace’, ‘fantasy’, and ‘cursive’) must be quoted to prevent confusion with the keywords with the same names.
So it is recommended that a font family called sans-serif normal be quoted as "sans-serif normal".
And if a font family is using the same name as a keyword it must be quoted.
Both Chrome and IE will accept Comic Sans MS or Times New Roman etc. with or without quotes, and apply them correctly.
Chrome rejects the unquoted use of the keyword sans-serif where it finds it combined with normal, but will accept both if quoted, although it won't be able to apply that font unless it can find one with that name.
IE accepts sans-serif normal as a possibly unquoted font family name, and this is arguably correct, since the keyword is only part of the presumed family name, rather than the whole thing.
Chrome, arguably incorrectly, rejects what it presumes is a malformed assertion.
or p.font{
font-family: font;
align-text: center;
}

Emoji and browsers with WordPress

I am curretly creating a simple website. In the contact information section, I am adding this html entry ☎ for phone (right before the phone number), and this html entry ✉ for email address (right before the email address). The idea is to display those two characters as solid black characters (or any color for that matter if I choose to change the font color in CSS).
Anyway, what I ended up with is the emoji character represented by those two codes. I do not want this. I do not want the emoji representation to be displayed. I would like to see html representation as shown in the following two links:
http://www.fileformat.info/info/unicode/char/260e/index.htm
http://www.fileformat.info/info/unicode/char/2709/index.htm
(in the two links above, notice the 'phone' and the 'envolope' at the top of the page, this is what I want).
The font I am using is 'Lucida Console', and it is part of developing a theme in WordPress.
How can I do this?
Update
This seems to be a problem with WordPress. My html is part of a WordPress theme. When I try the solution with standalone web-pages, it works. However, when I try it within a theme set of files, only emoji is displayed.
So the question now becomes, how do I ensure this works in WordPress properly?
Update 2
It is suggested that this is question is a duplicate of Inconsistent Unicode Emoji Glyphs/Symbols
This is not a duplicate question. Just because they both deal with emoji, does not make them both duplicates. My question deals with emoji showing up in a web page when using a WordPress theme, the other question deals with inconsisten emoji characters in mobile devices.
You should include a webfont with support for the characters you want to use.
To include an icon font in your CSS, use the following code :
#font-face {
font-family: 'myfont';
src:url('fonts/myfont.eot?-td2xif');
src:url('fonts/myfont.eot?#iefix-td2xif') format('embedded-opentype'),
url('fonts/myfont.woff?-td2xif') format('woff'),
url('fonts/myfont.ttf?-td2xif') format('truetype'),
url('fonts/myfont.svg?-td2xif#myfont') format('svg');
// Different URLs are required for optimal browser support
// Make sure to :
// 1) replace the URLs with your font's URLs
// 2) replace `#myfont` with the name of your font
font-weight: normal; // To avoid the font inherits boldness
font-style: normal; // To avoid font inherits obliqueness or italic
}
.emoji {
font-family: 'myfont', Verdana, Arial, sans-serif; // Use regular fonts as fallback
speak: none; // To avoid screen readers trying to read the content
font-style: normal; // To avoid font inherits obliqueness or italic
font-weight: normal; // To avoid the font inherits boldness
font-variant: normal; // To avoid the font inherits small-caps
text-transform: none; // To avoid the font inherits capitalization/uppercase/lowercase
line-height: 1; // To avoid the font inherits an undesired line-height
-webkit-font-smoothing: antialiased; // For improved readability on Webkit
-moz-osx-font-smoothing: grayscale; // For improved readability on OSX + Mozilla
}
You can then include your symbol like this:
<span class="icon">☎</span>
<span class="icon">✉</span>
If you don't know a webfont that supports your character, you can easily create one yourself using the Icomoon App. See also my open source Emoji icon font for an example of an Icon font with support for Emoji characters, which I created with the Icomoon App.
More info:
Create webfont with Unicode Supplementary Multilingual Plane
symbols
If I'm not wrong this is what you want
#phone{
font-family:Lucida Console;
font-size:32px;
color:red;
}
#email{
font-family:Lucida Console;
color:#e3e3e3;
font-size:30px;
}
<div id="phone">PHONE ☎</div>
<div id="email">EMAIL ✉</div>
To force the font renderer to use the non-emoji version, you can try using a Variation Selector.
<div>PHONE EMOJI ☎️</div>
<div>EMAIL EMOJI ✉️</div>
<div>PHONE TEXT ☎︎</div>
<div>EMAIL TEXT ✉︎</div>
See more: http://unicode.org/Public/8.0.0/ucd/StandardizedVariants.html

What font used when I don't have that font

What font used when I don't have that font?
Example:
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=PT+Sans+Narrow: 400' rel='stylesheet' type='text/css'>
<style>
body {
font: 400 30px/1.4 Arial;
}
p {
font: 700 30px/1.4 "Pt Sans Narrow", Arial;
}
</style>
</head>
<body>
<p>Example.</p>
</body>
</html>
In this example, I don't have "Pt Sans Narrow 700". What font used?
The regular typeface of the PT Sans Narrow family used, with algorithmic (synthetic, fake) bolding applied to its glyphs. In this case, the result is clearly bolder than plain PT Sans Narrow but less bold that PT Sans Narrow Bold.
CSS Fonts Module Level 3 says, in its description of font-weight: “Although the practice is not well-loved by typographers, bold faces are often synthesized by user agents for faces that lack actual bold faces. For the purposes of style matching, these faces must be treated as if they exist within the family. Authors can explicitly avoid this behavior by using the ‘font-synthesis’ property.” (The font-synthesis property is not supported yet.)
Unless there is some very special reason to ask for “fake bolding”, despite the existence of an actual bold typeface, you should specify bold (700) weight in the element where you refer to the the Google font, as instructed by the Google documentation:
<link href='https://fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700'
rel='stylesheet' type='text/css'>
You are using google font that means it obviously take this font. But if you haven't used google font then if the client has no such font then it would take another font that is Arial.
Consider this example:
font-family: font1,font2,font3;
Here if the client browser has no such font font1 then it will try to use font2 and if font2 is still not available then it will use font3 but if font3 is not still there the client's default font would be used there.
Arial is used if Pt Sans Narrow is not present.
When you open a HTML-File and the browser can't find the font, the normally it will use the default font of the browser.
What will happen is it will look at the declared font stack you have made:
"Pt Sans Narrow", Arial;
and see the next font in the list after the one it cant find "Pt Sans Narrow".
In this case it will be Arial.
This is highly depending on the rendering engine you are using.
Most engines make the font that is available "Pt Sans Narrow" just bold, which in turn would not look like the correct "Pt Sans Narrow" 700, but might come close.
And then there are those engines that skip an not available font and would choose the next in line, that might be Arial if it is available or the devices default font if the device also doesn't have Arial.

Is there any difference in using a font Arial Black or Arial with the <Strong> tag?

My text that is supposed to be Arial Black is not working on Firefox. It's just displayed as a regular text. So I used Arial font with the Strong tag. I can't make a difference between the way they look. Is there anything I should worry about?
Thank you
EDIT
In this particular case I can't use CSS to do it so that's how i did it:
<font face="Arial Black, Arial, sans-serif"> <strong>Want an undergraduate course with more opportunity for hands-on practice? </strong></font>
Thanks for all the answers and explanations, I believe the strong tag is not wrong here as this is the most important part in the whole message. The visual difference wasn't noticed by anybody, that's confirmation enough for me.
I posted in jsfiddle and it surprised me the strong tag didn't add the bold effect i was expecting! The b did. You can clearly see the difference there! Thanks for that suggestion!
With regard to the question title (as the question text seems to ask differently):
The <strong> tag carries a semantic meaning. Citing MDN on this
The HTML Strong Element () gives text strong importance, and is typically displayed in bold.
So in the first place you should use this tag so mark up content, that you want to emphasize and not to get text marked bold.
Most browsers, however, will implement that emphasizing as just bold printed text.
If you just want to have bold text, use the respective CSS for it!
font-weight: bold;
<strong> holds a certain semantic meaning (along the lines of "more important"), and as such should be avoided purely to style something. If you want to "bold" the text, just add font-weight: 700.
Or you know, fix the reason Arial Black isn't working :P It may be that you didn't add speech marks around Arial Black.
font-family: Arial;
is completely acceptable, but
font-family: Arial Black;
is not. Make sure you have
font-family: "Arial Black";
Yes, there is a considerable difference in using Arial Black vs. Arial with the strong element. I will answer in CSS terms, substituting the CSS setting font-weight: bolder for HTML strong markup. (It's really irrelevant here whether you call for bold face directly in CSS or indirectly with HTML markup that implies a certain default setting.)
It is not clear what you mean by “Arial Black is not working on Firefox”.
The most logical CSS code for the purpose would be:
font-family: Arial; font-weight: 900;
This asks for the boldest available font in the Arial font family; that’s Arial Black when available, or else Arial Bold. Firefox does not seem to support this quite consistently, but many browsers have even more serious problems with font heights. (E.g., Chrome shows weight 600 as bolder than 700.)
In practice it is safer to use the old kludgy way, which refers to a specific font (typeface) as if it were a font family:
font-family: Arial Black;
For example, on IE 8, this is the only way to get Arial Black, whereas IE 9 supports the logical way, too (in “Standards Mode”).
If you use set the font to Arial and font weight to bolder, you get Arial Bold. If you set font-family: Arial Black and font-weight: bolder, you get Arial Black, because there is no bolder font. And Arial Bold and Arial Black are very different.
It’s impossible to say what went wrong in your first attempts, as you did not post the actual code used.
I think you would receive the same effect, however I would recommend using CSS styling instead of using the strong tag.
.arial-black{
font-family: Arial;
font-weight: bold;
}
There is no visual difference between the <strong>, <b> and font-weight:700|bold;.
However <strong> is used by screen readers (for the blind and partially sighted) to put emphasis on the text... therefore using a "bold" font will not result in the same thing for screen readers.
If you don't want to "emphasis" the text for screen readers, then I would recommend you use the <b> tag instead.
<strong> tag does not support all browsers, as Arial and Arial black is concerned both are different in size or weight you can say.
So answer to your question is yes.
Using the font Arial Black in a web page only works for the users that actually have that font installed. (Of course, using Arial also only works on systems that have that font).
Arial Black is not just a bold version of Arial. Although similar, Arial Black has a different look than the bold version of Arial:
Arial, bold
Arial Black
You should use a fallback font for all fonts that you use, so that the browser knows what to use if that specific font isn't available, however it's tricky to use a font that is bold by default, as you can't specify Arial bold as fallback for Arial Black. You would have to make do with using Arial as fallback:
font-family: 'Arial Black', Arial, Helvetica, sans-serif;
You could use a #font-face rule to force Arial Black whenever the bold font-weight of Arial is used:
#font-face {
font-family: Arial;
/* You can add other common names using comma-separated local definitions here */
src: local('Arial Black');
font-weight: bold;
}
#font-face {
font-family: Arial;
src: local('Arial');
font-weight: normal;
}
Now, whenever Arial is set as the font for an element and the calculated font weight is bold (which is what user agents set for the string tag in their html.css definitions), Arial Black is used instead.
strong tag basically creates your text in bold. For your case it makes no difference. But it will create a difference if your font is different and you are using "strong"

Displaying alternative font for #font-face in CSS

Introducing new font in CSS with #font-face as
#font-face{
font-family:'myCustom';
font-style:normal;
font-weight:400;
src:local('myCustom'),
local('myCustom-Regular'),
url('myCustom.woff') format('woff')
}
and defining the font as
font-family: myCustom, Tahoma, Verdana, cursive;
However, I have two problems:
Until download my custom font, it will not show the second (alternative font), and the text will be blank.
If for any reason the visitor browser does not download my custom font, it will not display any text.
How can I display the alternative font until availability of my custom font?
What I expect to happen is that the first available installed font, among those listed in the font-family list, will be used. If this does not happen, please post a URL for inspection.
But you may wish to consider the list of font families you use. The odds are that if Tahoma and Verdana would be acceptable, cursive would not be; a normal generic fallback font in this case would be sans-serif.