# Oblique text using CSS directly in P5

**URL:** https://discourse.processing.org/t/oblique-text-using-css-directly-in-p5/27458
**Category:** Coding Questions
**Created:** [January 29, 2021, 2:39pm UTC](https://discourse.processing.org/t/oblique-text-using-css-directly-in-p5/27458 "2021-01-29T14:39:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![holytypo](https://avatars.discourse-cdn.com/v4/letter/h/2acd7d/32.png) [@holytypo](https://discourse.processing.org/u/holytypo)
#### Post date: [January 29, 2021, 2:39pm UTC](https://discourse.processing.org/t/oblique-text-using-css-directly-in-p5/27458/1 "2021-01-29T14:39:38Z")

</div>

Hey guys,

I want to change the font weight and oblique angle directly in p5.  
I’ve managed to change the weight this way:

`p.style('font-weight', map(mouseX, 0, width, 1, 999))`

but cannot find a way to change the slant / oblique / italic angle.

thanks in advance!

---

<div class="post-metadata">

### Author: ![ErraticGenerator](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/erraticgenerator/32/11304_2.png) [@ErraticGenerator](https://discourse.processing.org/u/ErraticGenerator)
#### Post date: [January 29, 2021, 5:42pm UTC](https://discourse.processing.org/t/oblique-text-using-css-directly-in-p5/27458/2 "2021-01-29T17:42:08Z")

</div>

Unlike `font-weight`, `font-style` does not take numeric values. If you want to have a variety of font styles, then, look for the variable fonts that have the axis. Then, you will be able to control with css.  
For instance, check this font: [Crack Grotesk VAR – Variable Fonts](https://v-fonts.com/fonts/crack-grotesk-var)

---

<div class="post-metadata">

### Author: ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)
#### Post date: [February 8, 2021, 12:08am UTC](https://discourse.processing.org/t/oblique-text-using-css-directly-in-p5/27458/3 "2021-02-08T00:08:31Z")

</div>

I’d say `skew` may do what you need depending on the content - specifically if you only have one line. As you can see in this sketch

[https://editor.p5js.org/micuat/sketches/heSSqMy-6](https://editor.p5js.org/micuat/sketches/heSSqMy-6)

it does skew the content but the effect shifts the lines far from the center and may not be what you want for multiline text. I hope this helps!
