bhrgunatha · 2022-08-06 04:19
I decided to give [FiraCode Mono a try](https://github.com/tonsky/FiraCode). Since I'd like some extra glyphs I'm actually using the [patched Nerd Font version](https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/FiraCode).
I also like to have comment faces italic
(custom-theme-set-faces
...
...
`(font-lock-comment-delimiter-face ((t (:foreground ,my/comment-colour :slant italic))))
`(font-lock-comment-face ((t (:foreground ,my/comment-colour :slant italic))))
...
)
There is no italic variant of the font though.
Is there any way to simulate or fake italics?
flexibeast · 2022-08-06 05:00
Try setting the `slant` attribute for the faces to 'oblique'?
bhrgunatha · 2022-08-06 06:00
Thanks, but t still renders the same i.e. with no slant.
With a font that **does** have an italic variant, both 'italic and 'oblique work - although I don't notice a difference.
What is the difference between 'italic and 'oblique?
nv-elisp · 2022-08-06 06:56
Tilt your head 9 degrees to the right.
flexibeast · 2022-08-06 07:08
Italics are actually designed as such, as part of the overall design of a typeface family. Obliques are basically a graphical transform of the upright glyphs.
(It's like how one can't necessarily just create a 12-point typeface and then scale it up or down from there; there are optical considerations which mean that smaller sizes need to be independently designed, at least if one is creating a quality typeface.)
BettaGeorge · 2022-08-06 07:17
You could brute force it by taking the font file, applying the GIMP/Inkscape shear tool to each letter, and exporting it back as a font file. Then just set the italic font to your newly created one.
bhrgunatha · 2022-08-06 07:56
That's interesting thanks for clearing that up. Since oblique doesn't seem to work on this font (for whatever reason) I'm going to try and generate an italic font using fontforge or something.
If you are a graphic designer or font designer please don't be offended ha ha!
bhrgunatha · 2022-08-06 07:56
Thanks - actually fontforge looks like a better option for me - it supports italic transformation out of the box.
**Edit:** after a little experimenting the italic option (Element | Style > | Italic...) caused some corruption.
Instead I opted for the skew transform (Element | Transform > | Skew...) and the results are acceptable to me.
xrabbit · 2022-08-06 08:22
This is exactly what I initially thought
If you need italics then it’s better to create new italics font
bhrgunatha · 2022-08-06 08:39
you mean left... right?
nv-elisp · 2022-08-06 14:10
Depends on the text's bidirectionality