How to enable bold fonts in sublime text2 in linux? - sublimetext2

I need to enable bold fonts in sublime text 2. I tried font_options but it didn't worked for me.

Add the following to your Preferences.sublime-settings file:
{
// Valid options are "no_bold", "no_italic", "no_antialias", "gray_antialias",
// "subpixel_antialias" and "no_round" (OS X only)
"font_options": ["bold"]
}

Some fonts don't have true bold variations. (Here's a post on the Sublime Text forum explaining it.) Try using "DejaVu Sans Mono" or "Courier New", these will work in any case.

Related

emoji variation selector doesn't work for user specified font?

Environment: Chrome v97 on Windows 10
It seems the variation selector for emoji is only respected if no font is specified, in which case OS would fallback to the correct glyph.
This is DevTools inspect on the first example (OS fallback). On "Computed" tab it shows the actual glyphs come from both "Segoe UI Emoji" (for emoji presentation) & "Segoe UI Symbol" (for text presentation) correctly.
However if I specify a font explicitly, either both text or both emoji
display, depending on the font order. No fallback to the next font in the list even if the glyphs of the other presentation are missing.
This means if I want to change the emoji font on a site, variation selector doesn't seem to work at all.
Why is that? Is there a workaround?
Sample code is attached
<style>
.emoji {
font-family: 'Segoe UI Emoji';
}
.symbol {
font-family: 'Segoe UI Symbol';
}
.symbol-emoji {
font-family: 'Segoe UI Symbol', 'Segoe UI Emoji';
}
.emoji-symbol {
font-family: 'Segoe UI Emoji', 'Segoe UI Symbol';
}
</style>
OS Fallback: <div>☹︎ ☹️</div>
Emoji: <div class="emoji">☹︎ ☹️</div>
Symbol: <div class="symbol">☹︎ ☹️</div>
Symbol emoji: <div class="symbol-emoji">☹︎ ☹️</div>
Emoji symbol: <div class="emoji-symbol">☹︎ ☹️</div>
The Segoe UI Symbol font doesn't support the variation sequences using U+FE0E, which is why you don't get the text variant in the "Emoji" case. (Segoe UI Symbol does support sequences with U+FE0F, though.)
As for the "Symbol Emoji" and "Emoji Symbol" cases, this is expecting the browser to decide on a font based on the variation sequences. Evidently Chromium doesn't handle that.

Google fonts web site works with special char, but web site is not

When I check a font in Google Fonts preview page all special chars are working as expected, but when the font is used in a web site some chars are printed with the default font.
Is there any trick to get the font working to the fullest in the browsers too?
Example here: http://codepen.io/anon/pen/yaardm
#import url('https://fonts.googleapis.com/css?family=IM+Fell+DW+Pica+SC');
p{font-family: 'IM Fell DW Pica SC', sans-serif;}
h1{font-family: 'IM Fell DW Pica SC', sans-serif;}
...
<p>These are working: a ö ä ø</p>
<p>These are not: ā ā</p>
If I enter the same special characters in the preview, they are all working. The chars "a ö ä ø ā" can be tested in the preview box here: https://fonts.google.com/specimen/IM+Fell+DW+Pica
A colleague found that my characters are not part of latin and the font didn't support them. The Google Fonts preview will try another font in the background and that's why it looks like it is working. By manually defining the font I got the "Kahako A" as I wanted.
http://codepen.io/anon/pen/yaapKw
#font-face {
font-family: 'IM Fell DW Pica script=all rev=6';
font-style: normal;
font-weight: 400;
src: url(https://fonts.gstatic.com/l/font?kit=xBKKJV4z2KsrtQnmjGO17HM30v831NPLrMTMWjZhJsgljegwSeDbtiHKgT6kSuH8OhAwGXnQZ2fim__WzpJMvT-ot7WhoQNhxW9XSHPUr95hxaMfyGAgGEujUXva07BSgdd4-sq5HMlny4sZVjdTlXcwcWdsnk25xubTXmsZQe5_f2oRvW8cxG4bMB_YmvaR96xlbbE5D7Gw2o7jubnkMA&skey=2798f34675f18639&v=v6) format('woff2');
}
...
font-family: 'IM Fell DW Pica script=all rev=6', sans-serif;

Amatic SC normal 700 - rendering issue with question mark character?

I'm using the Amatic SC 700 normal from google fonts.
This is the link on google fonts : https://www.google.com/fonts/specimen/Amatic+SC .
The issue is that right now the char ? is converted in ® .
The css code I used is:
#import url(http://fonts.googleapis.com/css?family=Amatic+SC:400,700);
body {
font-family: 'Amatic SC', cursive;
font-style: normal;
font-weight: 700;
}
The html looks like this :
<html> ???? </html>
This is a screenshot of the issue :
This is the jsfiddle link: http://jsfiddle.net/m4vev43a/
I tested this issue on:
Chrome Version 42.0.2311.90
Firefox 37.0.1
Opera 12.16
Any idea how I can fix this?
Are my browsers getting crazy?
Or it's a bug in the font?
Update:
When using :
#import url(http://fonts.googleapis.com/css?family=Amatic+SC);
So without the suffix :400,700 the question mark character is displayed properly.
Unfortunately using the above code + bold text is totaly messing up with the letter spacing in Chrome, Firefox, Opera.
This is a known issue with the bold version of the Amatic font, as can be seen in this bug report from November, 2011. Your font was implemented correctly, it's just that the font file itself has a bug.
A workaround is to use the regular variant for question marks. I know that's hardly a great solution but it seems there's not much else you can do.
One possible workaround I've used to recover this situation.
Note: is not perfect if you need to trust the letter spacing for each browser.
Actually the idea is :
define again the Amatic font in addition the std one, but without the :700
generate a special class to handle just the sentences with the question mark
#font-face {
font-family: 'Amatic';
src: url(http://fonts.gstatic.com/s/amaticsc/v6/DPPfSFKxRTXvae2bKDzp5FtXRa8TVwTICgirnJhmVJw.woff2) format('woff2'), url(http://fonts.gstatic.com/s/amaticsc/v6/DPPfSFKxRTXvae2bKDzp5D8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
}
.has-question-mark {
font-family: Amatic;
}

How to add a fallback font for a non supported character in font-face?

I am using a custom font face for the Hebrew language on a site and I am missing the whole set of English characters a-b, A-Z.
Right now I use the font (reformaregular) on the body tag:
body { font-family: 'reformaregular', Arial, Halvetica, sans-serif; }
English characters come up in the system default of a serif font Times New Roman on windows:
Notice the English serif at the bottom and custom hebrew font at the top.
Aside from tagging everything with a custom .en class;
My question is how do I add a fallback for the English font?
Actually if I understand your question right you can by using css unicode-range
see #font-face/unicode-range at: https://developer.mozilla.org/en-US/docs/Web/CSS/#font-face/unicode-range
and a quick example:
#font-face {
font-family: Almoni;
src: url(Almoni.ttf);
unicode-range: U+0590-05FF;
}
#font-face {
font-family: CoolOtherLanguageFont;
src: url(CoolOtherLanguageFont.ttf);
unicode-range: U+0370-03FF, U+1F00-1FFF;
}
body {
font-family: Almoni, CoolOtherLanguageFont, Helvetica;
}
You can't have different font for different languages. If your Hebrew font does not have English character set (or digits for example) than you are out of luck. The only way we found was to run a javascript that detects non-Hebrew charset and adds an .english or lang attribute to the text with the correct English font.

Inline codes are not highlighted after using "knit html" function in Rstudio

I wrote an .Rmd file with some inline codes quoted by "`", and I used the knit html function in Rstudio to convert the .Rmd file to .html. However, the inline codes were not highlighted as on stackoverflow, and I took a look at the source codes of the .html file and found that the setting was like
tt, code, pre {
font-family: 'DejaVu Sans Mono', 'Droid Sans Mono', 'Lucida Console', Consolas, Monaco, monospace;
}
And I tried altering this block:
tt, code, pre {
font-family: 'DejaVu Sans Mono', 'Droid Sans Mono', 'Lucida Console', Consolas, Monaco, monospace;
background-color: #F8F8F8;
}
And it worked.
However, I do not want to do such work every time after I knit the .Rmd file to .html. I have read the help files of knit2html and markdownHTMLOptions in R but found no solution. Is there any solution to this issue?
With the latest version of the markdown package on CRAN, you can use the header argument to add additional CSS code to the HTML output, e.g.
library(knitr)
knit2html(...,
header = c('<style type="text/css">', 'code{background-color: #F8F8F8;}', '</style>'))
Or just set this as a global option in your ~/.Rprofile:
options(markdown.HTML.header = c('<style type="text/css">', 'code{background-color: #F8F8F8;}', '</style>'))
And the markdown package will use it every time when you simply run knit2html() without explicitly specifying the header argument.
With RStudio, it is a little trickier. See the documentation Customizing Markdown Rendering.