# What is the standard font used by Vegalite.jl?

**URL:** <https://discourse.julialang.org/t/what-is-the-standard-font-used-by-vegalite-jl/31595>\
**Category:** Visualization\
**Created:** [November 27, 2019, 7:16pm UTC](https://discourse.julialang.org/t/what-is-the-standard-font-used-by-vegalite-jl/31595 "2019-11-27T19:16:31Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Usor](https://avatars.discourse-cdn.com/v4/letter/u/8dc957/32.png) [@Usor](https://discourse.julialang.org/u/Usor)\
**Post date:** [November 27, 2019, 7:16pm UTC](https://discourse.julialang.org/t/what-is-the-standard-font-used-by-vegalite-jl/31595/1 "2019-11-27T19:16:31Z")

</div>

What is the standard font used for text in Vegalite.jl?

* * *

This seemed like the right forum to ask. If wrong, can a moderator move it to the right one? Thanks.

---

<div class="post-metadata">

**Author:** ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)\
**Post date:** [November 27, 2019, 7:39pm UTC](https://discourse.julialang.org/t/what-is-the-standard-font-used-by-vegalite-jl/31595/2 "2019-11-27T19:39:26Z")

</div>

@davidanthoff

---

<div class="post-metadata">

**Author:** ![Usor](https://avatars.discourse-cdn.com/v4/letter/u/8dc957/32.png) [@Usor](https://discourse.julialang.org/u/Usor)\
**Post date:** [November 27, 2019, 8:25pm UTC](https://discourse.julialang.org/t/what-is-the-standard-font-used-by-vegalite-jl/31595/3 "2019-11-27T20:25:26Z")

</div>

Yes, thanks. I suppose that is wise.

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [November 27, 2019, 8:36pm UTC](https://discourse.julialang.org/t/what-is-the-standard-font-used-by-vegalite-jl/31595/4 "2019-11-27T20:36:16Z")

</div>

I think it’s helvetica neue according to this random commit [https://github.com/vega/vega-lite/commit/c5cc50cb281114f5db845b174ca0a6983b13ae6f](https://github.com/vega/vega-lite/commit/c5cc50cb281114f5db845b174ca0a6983b13ae6f)

---

<div class="post-metadata">

**Author:** ![Usor](https://avatars.discourse-cdn.com/v4/letter/u/8dc957/32.png) [@Usor](https://discourse.julialang.org/u/Usor)\
**Post date:** [November 27, 2019, 8:50pm UTC](https://discourse.julialang.org/t/what-is-the-standard-font-used-by-vegalite-jl/31595/5 "2019-11-27T20:50:16Z")

</div>

Looks like a good guess, but can we be sure of it based on this?

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [November 28, 2019, 1:20am UTC](https://discourse.julialang.org/t/what-is-the-standard-font-used-by-vegalite-jl/31595/6 "2019-11-28T01:20:03Z")

</div>

I have no idea 🙂 But I asked on the vega-lite slack, if I get a response I’ll post it here.

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [November 28, 2019, 5:20pm UTC](https://discourse.julialang.org/t/what-is-the-standard-font-used-by-vegalite-jl/31595/7 "2019-11-28T17:20:18Z")

</div>

Alright, I heard back. In the browser, it will be the browser’s sans serif font. If you save as an SVG, then it will use the sans serif font that the SVG viewer has as a default. If you export to PDF, PNG or one of those formats, Cairo is presumably using the OS default sans serif font.

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [November 28, 2019, 5:39pm UTC](https://discourse.julialang.org/t/what-is-the-standard-font-used-by-vegalite-jl/31595/8 "2019-11-28T17:39:44Z")

</div>

Ok, got more info: the default font is defined [here](https://github.com/vega/vega/blob/44fe9556830ba8e53ed0570aee06d5fda9830fe6/packages/vega-parser/src/config.js#L1).

---

<div class="post-metadata">

**Author:** ![Usor](https://avatars.discourse-cdn.com/v4/letter/u/8dc957/32.png) [@Usor](https://discourse.julialang.org/u/Usor)\
**Post date:** [November 28, 2019, 6:33pm UTC](https://discourse.julialang.org/t/what-is-the-standard-font-used-by-vegalite-jl/31595/9 "2019-11-28T18:33:14Z")

</div>

Thanks.

---

<div class="post-metadata">

**Author:** ![Usor](https://avatars.discourse-cdn.com/v4/letter/u/8dc957/32.png) [@Usor](https://discourse.julialang.org/u/Usor)\
**Post date:** [November 28, 2019, 6:43pm UTC](https://discourse.julialang.org/t/what-is-the-standard-font-used-by-vegalite-jl/31595/10 "2019-11-28T18:43:14Z")

</div>

So, basically, it will use the viewer’s font and fonts are not embedded; or, if PDF or rasterized, it will embed or rasterize the OS’s sans-serif.

Is there a way to embed a chosen font in an SVG?

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [November 28, 2019, 6:58pm UTC](https://discourse.julialang.org/t/what-is-the-standard-font-used-by-vegalite-jl/31595/11 "2019-11-28T18:58:27Z")

</div>

The function that produces the SVG is [this](https://vega.github.io/vega/docs/api/view/#view_toSVG). I don’t see an option to embed a font there, but it strikes me as a quite reasonable idea in general… Maybe open an issue on the vega repository [https://github.com/vega/vega](https://github.com/vega/vega)?

---

<div class="post-metadata">

**Author:** ![Usor](https://avatars.discourse-cdn.com/v4/letter/u/8dc957/32.png) [@Usor](https://discourse.julialang.org/u/Usor)\
**Post date:** [November 28, 2019, 7:17pm UTC](https://discourse.julialang.org/t/what-is-the-standard-font-used-by-vegalite-jl/31595/12 "2019-11-28T19:17:23Z")

</div>

Yes, perhaps I will.

---

<div class="post-metadata">

**Author:** ![Mastomaki](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@Mastomaki](https://discourse.julialang.org/u/Mastomaki)\
**Post date:** [November 11, 2022, 11:31am UTC](https://discourse.julialang.org/t/what-is-the-standard-font-used-by-vegalite-jl/31595/13 "2022-11-11T11:31:57Z")

</div>

Is it possible to set fontSize and fontWeight properties for axis labels?

---

<div class="post-metadata">

**Author:** ![Mastomaki](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@Mastomaki](https://discourse.julialang.org/u/Mastomaki)\
**Post date:** [November 11, 2022, 2:23pm UTC](https://discourse.julialang.org/t/what-is-the-standard-font-used-by-vegalite-jl/31595/14 "2022-11-11T14:23:14Z")

</div>

I managed to figure it out. Here is an example. First prepare a dataframe df with the data in columns x and y and z.

> using VegaLite  
> df |\>  
> @vlplot(:rect,  
> y={“x:o”, title = “Y axis”, axis = {titleFont = “Arial”, titleFontSize = 16}},  
> x={“y:o”, title = “X axis”, axis = {titleFont = “Arial”, titleFontSize = 16, titleFontWeight = “normal”}},  
> color=:z)
