# Saving to PDF Using Palatino Roman Doesn't Show Negative Signs with Plots.jl

**URL:** <https://discourse.julialang.org/t/saving-to-pdf-using-palatino-roman-doesnt-show-negative-signs-with-plots-jl/64003>\
**Category:** General Usage\
**Tags:** plotting, plots, gr\
**Created:** [July 3, 2021, 7:56pm UTC](https://discourse.julialang.org/t/saving-to-pdf-using-palatino-roman-doesnt-show-negative-signs-with-plots-jl/64003 "2021-07-03T19:56:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ggarza](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ggarza/32/2654_2.png) [@ggarza](https://discourse.julialang.org/u/ggarza)\
**Post date:** [July 3, 2021, 7:56pm UTC](https://discourse.julialang.org/t/saving-to-pdf-using-palatino-roman-doesnt-show-negative-signs-with-plots-jl/64003/1 "2021-07-03T19:56:55Z")

</div>

As stated in the topic title, saving a plot to a pdf when using the fontfamily “Palatino Roman” doesn’t show negative signs.

Here’s a MWE:

```julia
using Plots
f(x) = x^2-3
pl = plot(f, -3, 3, fontfamily="Palatino Roman")
savefig(pl, "plot.png")
savefig(pl, "plot.pdf")

```

and these are the resulting plots:  
First the plot as a png:  
 ![plot](https://global.discourse-cdn.com/julialang/original/3X/d/4/d457fe789968318d309d5f7cd2fecb1d98b65a44.png)

And now a screenshot of the plot as a pdf (a screenshot because I can’t upload pdfs):

 ![Screen Shot 2021-07-03 at 2.54.36 PM](https://global.discourse-cdn.com/julialang/original/3X/a/0/a0af4c864192d2a525349ec09f817613e7f7e0fe.png)

I am using Plots v1.16.8

---

<div class="post-metadata">

**Author:** ![ggarza](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ggarza/32/2654_2.png) [@ggarza](https://discourse.julialang.org/u/ggarza)\
**Post date:** [July 3, 2021, 8:14pm UTC](https://discourse.julialang.org/t/saving-to-pdf-using-palatino-roman-doesnt-show-negative-signs-with-plots-jl/64003/2 "2021-07-03T20:14:08Z")

</div>

I’m posting here instead of submitting an issue because I don’t want to spam Github by submitting an issue that’s known. I searched but couldn’t find any issue similar. I also don’t know if I should submit an issue for Plots.jl or one of the backends.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [July 3, 2021, 8:54pm UTC](https://discourse.julialang.org/t/saving-to-pdf-using-palatino-roman-doesnt-show-negative-signs-with-plots-jl/64003/3 "2021-07-03T20:54:07Z")

</div>

What backend are you using?

It looks like the backend has text rendering that doesn’t support fallback fonts, and Palatino Roman is missing a glyph for the minus sign ([U+2212](https://www.fileformat.info/info/unicode/char/2212/index.htm)).

---

<div class="post-metadata">

**Author:** ![ggarza](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ggarza/32/2654_2.png) [@ggarza](https://discourse.julialang.org/u/ggarza)\
**Post date:** [July 3, 2021, 9:11pm UTC](https://discourse.julialang.org/t/saving-to-pdf-using-palatino-roman-doesnt-show-negative-signs-with-plots-jl/64003/4 "2021-07-03T21:11:03Z")

</div>

I believe it’s GR (or the default). I created a new environment with Plots.jl as the only package added.

I’ve uploaded the Project.toml and Manifest.toml files here: [Manifest.toml · GitHub](https://gist.github.com/ggarza/48f863f6306ee51c3733e72cbadc2b5a)

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [July 3, 2021, 9:42pm UTC](https://discourse.julialang.org/t/saving-to-pdf-using-palatino-roman-doesnt-show-negative-signs-with-plots-jl/64003/5 "2021-07-03T21:42:25Z")

</div>

> [@ggarza](#):
>
> I believe it’s GR (or the default).

GR doesn’t support fallback fonts last I heard, which means that it won’t render any Unicode characters that aren’t present in your font, and hence you need to use a font with sufficient Unicode coverage. See also the discussion in [Error with unicode labels in GR backend · Issue #791 · JuliaPlots/Plots.jl · GitHub](https://github.com/JuliaPlots/Plots.jl/issues/791)

---

<div class="post-metadata">

**Author:** ![ggarza](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ggarza/32/2654_2.png) [@ggarza](https://discourse.julialang.org/u/ggarza)\
**Post date:** [July 3, 2021, 10:57pm UTC](https://discourse.julialang.org/t/saving-to-pdf-using-palatino-roman-doesnt-show-negative-signs-with-plots-jl/64003/6 "2021-07-03T22:57:21Z")

</div>

Thank you, @stevengj

In case anyone runs into this thread, there is a another issue submitted here: [Error about savefig · Issue #2938 · JuliaPlots/Plots.jl · GitHub](https://github.com/JuliaPlots/Plots.jl/issues/2938)

---

<div class="post-metadata">

**Author:** ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)\
**Post date:** [July 4, 2021, 4:08am UTC](https://discourse.julialang.org/t/saving-to-pdf-using-palatino-roman-doesnt-show-negative-signs-with-plots-jl/64003/7 "2021-07-04T04:08:58Z")

</div>

GR can not embed fonts into the PDF output. You will have to provide a “Palatino” font with the corresponding UTF-8 glyphs (using the `GKS_FONT_DIRS` environment) and use GR’s internal text renderer (using `GR.settextfontprec(..., GR.TEXT_PRECISION_OUTLINE)`). I can try to provide an example next week …

---

<div class="post-metadata">

**Author:** ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)\
**Post date:** [July 4, 2021, 4:55am UTC](https://discourse.julialang.org/t/saving-to-pdf-using-palatino-roman-doesnt-show-negative-signs-with-plots-jl/64003/8 "2021-07-04T04:55:28Z")

</div>

```julia
ENV["GKS_FONT_DIRS"] = pwd()

using GR

beginprint("font-ex.pdf")

settextalign(GR.TEXT_HALIGN_CENTER, GR.TEXT_VALIGN_HALF)

font = loadfont("Rockness.ttf")
settextfontprec(font, GR.TEXT_PRECISION_OUTLINE)
setcharheight(0.06)

text(0.5, 0.5, "The quick brown fox jumps over the lazy dog")

font = loadfont("Palatino-Roman.ttf")
settextfontprec(font, GR.TEXT_PRECISION_OUTLINE)
setcharheight(0.03)

text(0.5, 0.4, "– The quick brown fox jumps over the lazy dog –")

updatews()

endprint()

```

 ![Screen Shot 2021-07-04 at 07.12.02](https://global.discourse-cdn.com/julialang/original/3X/c/c/cc02246022b68904285bb72cbfbf67f02c6b20b4.png)

---

<div class="post-metadata">

**Author:** ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)\
**Post date:** [July 4, 2021, 5:19am UTC](https://discourse.julialang.org/t/saving-to-pdf-using-palatino-roman-doesnt-show-negative-signs-with-plots-jl/64003/9 "2021-07-04T05:19:22Z")

</div>

You will find the above fonts [here](https://freefontsdownload.net).
